def process_auth_options(parser, options): """Configures process-wide authentication parameters based on |options|.""" # Validate that authentication method is known. if options.auth_method not in dict(net.AUTH_METHODS): parser.error('Invalid --auth-method value: %s' % options.auth_method) # Process the rest of the flags based on actual method used. # Only oauth is configurable now. config = None if options.auth_method == 'oauth': config = oauth.extract_oauth_config_from_options(options) # Now configure 'net' globally to use this for every request. net.configure_auth(options.auth_method, config)
def process_auth_options(parser, options): """Configures process-wide authentication parameters based on |options|.""" if options.auth_method not in net.AUTH_METHODS: parser.error('Invalid --auth-method value: %s' % options.auth_method) net.configure_auth(options.auth_method, oauth_options=options)