Python keystoneauth1.loading.get_auth_plugin_conf_options() Examples

The following are 23 code examples of keystoneauth1.loading.get_auth_plugin_conf_options(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module keystoneauth1.loading , or try the search function .
Example #1
Source File: config.py    From drydock with Apache License 2.0 6 votes vote down vote up
def list_opts():
    opts = {
        'DEFAULT': DrydockConfig.options,
        'logging': DrydockConfig.logging_options,
        'plugins': DrydockConfig.plugin_options,
        'timeouts': DrydockConfig.timeout_options,
        'database': DrydockConfig.database_options,
        'network': DrydockConfig.network_options,
    }

    package_path = os.path.dirname(os.path.abspath(__file__))
    parent_module = ".".join(__name__.split('.')[:-1])
    module_names = _list_module_names(package_path, parent_module)
    imported_modules = _import_modules(module_names)
    _append_config_options(imported_modules, opts)
    # Assume we'll use the password plugin, so include those options in the configuration template
    opts['keystone_authtoken'] = loading.get_auth_plugin_conf_options(
        'password')
    return _tupleize(opts) 
Example #2
Source File: conf_fixture.py    From karbor with Apache License 2.0 6 votes vote down vote up
def set_defaults(conf):
    conf.set_default('connection', 'sqlite://', group='database')
    conf.set_default('sqlite_synchronous', False, group='database')
    conf.set_default('policy_dirs', [], group='oslo_policy')
    conf.set_default('auth_strategy', 'noauth')
    conf.set_default('state_path', os.path.abspath(
        os.path.join(os.path.dirname(__file__), '..', '..', '..')))
    conf.set_default('provider_config_dir',
                     os.path.join(os.path.dirname(__file__), 'fake_providers'))
    loading.register_auth_conf_options(conf, 'trustee')
    opts = loading.get_auth_plugin_conf_options('password')
    conf.register_opts(opts, 'trustee')
    conf.set_default('auth_type', 'password', group='trustee')
    conf.set_default('auth_section', None, group='trustee')
    conf.set_default('auth_url', 'http://192.168.1.2/identity',
                     group='trustee')
    conf.set_default('username', 'karbor', group='trustee')
    conf.set_default('password', 'password', group='trustee')
    conf.set_default('user_domain_id', 'default', group='trustee')
    conf.set_default('trigger_poll_interval', 1) 
Example #3
Source File: config.py    From qinling with Apache License 2.0 6 votes vote down vote up
def list_opts():
    keystone_middleware_opts = auth_token.list_opts()
    keystone_loading_opts = [(
        'keystone_authtoken', loading.get_auth_plugin_conf_options('password')
    )]

    qinling_opts = [
        (API_GROUP, api_opts),
        (PECAN_GROUP, pecan_opts),
        (ENGINE_GROUP, engine_opts),
        (STORAGE_GROUP, storage_opts),
        (KUBERNETES_GROUP, kubernetes_opts),
        (ETCD_GROUP, etcd_opts),
        (RLIMITS_GROUP, rlimits_opts),
        (None, [launch_opt]),
        (None, default_opts),
    ]

    return keystone_middleware_opts + keystone_loading_opts + qinling_opts 
Example #4
Source File: keystone.py    From ironic-inspector with Apache License 2.0 6 votes vote down vote up
def add_auth_options(options, service_type):
    def add_options(opts, opts_to_add):
        for new_opt in opts_to_add:
            for opt in opts:
                if opt.name == new_opt.name:
                    break
            else:
                opts.append(new_opt)

    opts = copy.deepcopy(options)
    opts.insert(0, loading.get_auth_common_conf_options()[0])
    # NOTE(dims): There are a lot of auth plugins, we just generate
    # the config options for a few common ones
    plugins = ['password', 'v2password', 'v3password']
    for name in plugins:
        plugin = loading.get_plugin_loader(name)
        add_options(opts, loading.get_auth_plugin_conf_options(plugin))
    add_options(opts, loading.get_session_conf_options())
    adapter_opts = loading.get_adapter_conf_options(
        include_deprecated=False)
    cfg.set_defaults(adapter_opts, service_type=service_type,
                     valid_interfaces=DEFAULT_VALID_INTERFACES)
    add_options(opts, adapter_opts)
    opts.sort(key=lambda x: x.name)
    return opts 
Example #5
Source File: client_auth.py    From manila with Apache License 2.0 6 votes vote down vote up
def list_opts(group):
        """Generates a list of config option for a given group

        :param group: group name
        :return: list of auth default configuration
        """
        opts = copy.deepcopy(ks_loading.get_session_conf_options())
        opts.insert(0, ks_loading.get_auth_common_conf_options()[0])

        for plugin_option in ks_loading.get_auth_plugin_conf_options(
                'password'):
            found = False
            for option in opts:
                if option.name == plugin_option.name:
                    found = True
                    break
            if not found:
                opts.append(plugin_option)
        opts.sort(key=lambda x: x.name)
        return [(group, opts)] 
Example #6
Source File: config.py    From drydock with Apache License 2.0 6 votes vote down vote up
def list_opts():
    opts = {
        'DEFAULT': DrydockConfig.options,
        'logging': DrydockConfig.logging_options,
        'plugins': DrydockConfig.plugin_options,
        'timeouts': DrydockConfig.timeout_options,
        'database': DrydockConfig.database_options,
    }

    package_path = os.path.dirname(os.path.abspath(__file__))
    parent_module = ".".join(__name__.split('.')[:-1])
    module_names = _list_module_names(package_path, parent_module)
    imported_modules = _import_modules(module_names)
    _append_config_options(imported_modules, opts)
    # Assume we'll use the password plugin, so include those options in the configuration template
    opts['keystone_authtoken'] = loading.get_auth_plugin_conf_options(
        'password')
    return _tupleize(opts) 
Example #7
Source File: opts.py    From kuryr with Apache License 2.0 5 votes vote down vote up
def get_keystoneauth_conf_options():
    opt_list = []
    opt_list.insert(0, ks_loading.get_auth_common_conf_options()[0])
    opt_list += ks_loading.get_session_conf_options()
    # NOTE(apuimedo): There are a lot of auth plugins, we just generate the
    # config options for a few common ones
    for name in ENABLED_AUTH_PLUGINS:
        for plugin_option in ks_loading.get_auth_plugin_conf_options(name):
            if all(option.name != plugin_option.name for option in opt_list):
                opt_list.append(plugin_option)
    return opt_list 
Example #8
Source File: config.py    From drydock with Apache License 2.0 5 votes vote down vote up
def register_options(self, enable_keystone=True):
        self.conf.register_opts(DrydockConfig.options)
        self.conf.register_opts(
            DrydockConfig.bootactions_options, group='bootactions')
        self.conf.register_opts(DrydockConfig.logging_options, group='logging')
        self.conf.register_opts(DrydockConfig.plugin_options, group='plugins')
        self.conf.register_opts(DrydockConfig.network_options, group='network')
        self.conf.register_opts(
            DrydockConfig.database_options, group='database')
        self.conf.register_opts(
            DrydockConfig.timeout_options, group='timeouts')
        if enable_keystone:
            self.conf.register_opts(
                loading.get_auth_plugin_conf_options('password'),
                group='keystone_authtoken') 
Example #9
Source File: opts.py    From aodh with Apache License 2.0 5 votes vote down vote up
def list_keystoneauth_opts():
    # NOTE(sileht): the configuration file contains only the options
    # for the password plugin that handles keystone v2 and v3 API
    # with discovery. But other options are possible.
    return [('service_credentials', (
            loading.get_auth_common_conf_options() +
            loading.get_auth_plugin_conf_options('password')))] 
Example #10
Source File: placement.py    From cyborg with Apache License 2.0 5 votes vote down vote up
def list_opts():
    return {
        PLACEMENT_CONF_SECTION: (
            ks_loading.get_session_conf_options() +
            ks_loading.get_auth_common_conf_options() +
            ks_loading.get_auth_plugin_conf_options('password') +
            ks_loading.get_auth_plugin_conf_options('v2password') +
            ks_loading.get_auth_plugin_conf_options('v3password') +
            confutils.get_ksa_adapter_opts(DEFAULT_SERVICE_TYPE))
    } 
Example #11
Source File: nova.py    From cyborg with Apache License 2.0 5 votes vote down vote up
def list_opts():
    return {
        nova_group.name: (
            ks_loading.get_session_conf_options() +
            ks_loading.get_auth_common_conf_options() +
            ks_loading.get_auth_plugin_conf_options('password') +
            ks_loading.get_auth_plugin_conf_options('v2password') +
            ks_loading.get_auth_plugin_conf_options('v3password') +
            confutils.get_ksa_adapter_opts(DEFAULT_SERVICE_TYPE))
    } 
Example #12
Source File: service_token.py    From cyborg with Apache License 2.0 5 votes vote down vote up
def list_opts():
    return {
        service_user: (
            service_user_opts +
            ks_loading.get_session_conf_options() +
            ks_loading.get_auth_common_conf_options() +
            ks_loading.get_auth_plugin_conf_options('password') +
            ks_loading.get_auth_plugin_conf_options('v2password') +
            ks_loading.get_auth_plugin_conf_options('v3password'))
    } 
Example #13
Source File: zaqar.py    From senlin with Apache License 2.0 5 votes vote down vote up
def list_opts():
    return {
        ZAQAR_GROUP: (ksa_loading.get_auth_common_conf_options() +
                      ksa_loading.get_auth_plugin_conf_options('password'))
    } 
Example #14
Source File: basic_and_keystone_auth.py    From vitrage with Apache License 2.0 5 votes vote down vote up
def __init__(self, application, conf):
        super(BasicAndKeystoneAuth, self).__init__(application, conf)

        self.application = application

        self.oslo_conf = cfg.ConfigOpts()
        self.oslo_conf([],
                       project='vitrage',
                       validate_default_values=True)
        password_option = loading.get_auth_plugin_conf_options('password')
        self.oslo_conf.register_opts(password_option, group=CFG_GROUP)
        self.auth_url = self.oslo_conf.service_credentials.auth_url or '' 
Example #15
Source File: config.py    From drydock with Apache License 2.0 5 votes vote down vote up
def register_options(self, enable_keystone=True):
        self.conf.register_opts(DrydockConfig.options)
        self.conf.register_opts(
            DrydockConfig.bootactions_options, group='bootactions')
        self.conf.register_opts(DrydockConfig.logging_options, group='logging')
        self.conf.register_opts(DrydockConfig.plugin_options, group='plugins')
        self.conf.register_opts(
            DrydockConfig.database_options, group='database')
        self.conf.register_opts(
            DrydockConfig.timeout_options, group='timeouts')
        if enable_keystone:
            self.conf.register_opts(
                loading.get_auth_plugin_conf_options('password'),
                group='keystone_authtoken') 
Example #16
Source File: keystone.py    From magnum with Apache License 2.0 5 votes vote down vote up
def list_opts():
    keystone_auth_opts = (ka_loading.get_auth_common_conf_options() +
                          ka_loading.get_auth_plugin_conf_options('password'))
    return {
        keystone_auth_group: keystone_auth_opts
    } 
Example #17
Source File: opts.py    From searchlight with Apache License 2.0 5 votes vote down vote up
def list_auth_opts():
    # Inspired by similar code in neutron
    opt_list = []
    for plugin in ['password', 'v2password', 'v3password']:
        plugin_options = loading.get_auth_plugin_conf_options(plugin)
        for plugin_option in plugin_options:
            if all(option.name != plugin_option.name for option in opt_list):
                opt_list.append(plugin_option)

    opt_list.sort(key=operator.attrgetter('name'))
    return opt_list 
Example #18
Source File: default.py    From armada with Apache License 2.0 5 votes vote down vote up
def list_opts():
    return {
        'DEFAULT': default_options,
        'keystone_authtoken': loading.get_auth_plugin_conf_options('password')} 
Example #19
Source File: default.py    From armada with Apache License 2.0 5 votes vote down vote up
def register_opts(conf):
    conf.register_opts(default_options)
    conf.register_opts(
        loading.get_auth_plugin_conf_options('password'),
        group='keystone_authtoken') 
Example #20
Source File: default.py    From armada with Apache License 2.0 5 votes vote down vote up
def list_opts():
    return {
        'DEFAULT': default_options,
        'keystone_authtoken': (
            ks_loading.get_session_conf_options()
            + ks_loading.get_auth_common_conf_options()
            + ks_loading.get_auth_plugin_conf_options('password')
            + ks_loading.get_auth_plugin_conf_options('v3password'))
    } 
Example #21
Source File: opts.py    From octavia with Apache License 2.0 5 votes vote down vote up
def add_auth_opts():
    opts = ks_loading.register_session_conf_options(
        cfg.CONF, constants.SERVICE_AUTH)
    opt_list = copy.deepcopy(opts)
    opt_list.insert(0, ks_loading.get_auth_common_conf_options()[0])
    # NOTE(mhickey): There are a lot of auth plugins, we just generate
    # the config options for a few common ones
    plugins = ['password', 'v2password', 'v3password']
    for name in plugins:
        for plugin_option in ks_loading.get_auth_plugin_conf_options(name):
            if all(option.name != plugin_option.name for option in opt_list):
                opt_list.append(plugin_option)
    opt_list.sort(key=operator.attrgetter('name'))
    return (constants.SERVICE_AUTH, opt_list) 
Example #22
Source File: opts.py    From ec2-api with Apache License 2.0 5 votes vote down vote up
def list_auth_opts():
    opt_list = ks_loading.register_session_conf_options(CONF, GROUP_AUTHTOKEN)
    opt_list.insert(0, ks_loading.get_auth_common_conf_options()[0])
    # NOTE(mhickey): There are a lot of auth plugins, we just generate
    # the config options for a few common ones
    plugins = ['password', 'v2password', 'v3password']
    for name in plugins:
        for plugin_option in ks_loading.get_auth_plugin_conf_options(name):
            if all(option.name != plugin_option.name for option in opt_list):
                opt_list.append(plugin_option)
    opt_list.sort(key=operator.attrgetter('name'))
    return [(GROUP_AUTHTOKEN, opt_list)] 
Example #23
Source File: keystone.py    From zun with Apache License 2.0 5 votes vote down vote up
def list_opts():
    keystone_auth_opts = (ka_loading.get_auth_common_conf_options() +
                          ka_loading.get_auth_plugin_conf_options('password'))
    return {
        keystone_auth_group: keystone_auth_opts
    }