Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _config_options():
trustee_opts = loading.get_auth_common_conf_options()
trustee_opts.extend(loading.get_auth_plugin_conf_options(PASSWORD_PLUGIN))
yield TRUSTEE_CONF_GROUP, trustee_opts
"""Add auth options to sample config
As these are dynamically registered at runtime,
this adds options for most used auth_plugins
when generating sample config.
"""
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, kaloading.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 = kaloading.get_plugin_loader(name)
add_options(opts, kaloading.get_auth_plugin_conf_options(plugin))
add_options(opts, kaloading.get_session_conf_options())
opts.sort(key=lambda x: x.name)
return opts
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
exposed to users by this middleware.
Deprecated Options should not show up here so as to not be included in
sample configuration.
Each element of the list is a tuple. The first element is the name of the
group under which the list of elements in the second element will be
registered. A group name of None corresponds to the [DEFAULT] group in
config files.
This function is discoverable via the entry point
'keystonemiddleware.auth_token' under the 'oslo.config.opts' namespace.
:returns: a list of (group_name, opts) tuples
"""
auth_token_opts = (_OPTS + loading.get_auth_common_conf_options())
return [(_base.AUTHTOKEN_GROUP, copy.deepcopy(auth_token_opts))]
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', itertools.chain(
loading.get_auth_common_conf_options(),
loading.get_auth_plugin_conf_options('password'),
ceilometer.keystone_client.CLI_OPTS
))]
def list_auth_opts():
opt_list = copy.deepcopy(_nova_options)
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 [(NOVA_GROUP, opt_list)]
def list_opts():
return {ironic_group: (
ironic_options +
ks_loading.get_session_conf_options() +
ks_loading.get_auth_common_conf_options() +
ks_loading.get_auth_plugin_conf_options('v3password') +
confutils.get_ksa_adapter_opts(DEFAULT_SERVICE_TYPE,
deprecated_opts=deprecated_opts))
}
def list_opts():
opts = {
None: default_opts,
'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')
),
engine_group: engine_opts,
barbican_group: (
barbican_opts +
ks_loading.get_session_conf_options() +
ks_loading.get_auth_common_conf_options() +
ks_loading.get_auth_plugin_conf_options('v3password')
),
jsonpath_group: jsonpath_opts
}
return opts