Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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 ''
def list_opts():
trustee_opts = ks_loading.get_auth_common_conf_options()
trustee_opts.extend(ks_loading.get_auth_plugin_conf_options(
PASSWORD_PLUGIN))
yield TRUSTEE_CONF_GROUP, trustee_opts
def list_opts():
return {
neutron_group: (
ALL_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') +
confutils.get_ksa_adapter_opts(DEFAULT_SERVICE_TYPE))
}
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
(conf_planner.watcher_planner, conf_planner.WATCHER_PLANNER_OPTS),
(conf_applier.watcher_applier, conf_applier.APPLIER_MANAGER_OPTS),
(conf_de.watcher_decision_engine,
(conf_de.WATCHER_DECISION_ENGINE_OPTS)),
(conf_nova_client.nova_client, conf_nova_client.NOVA_CLIENT_OPTS),
(conf_glance_client.glance_client,
conf_glance_client.GLANCE_CLIENT_OPTS),
(conf_cinder_client.cinder_client,
conf_cinder_client.CINDER_CLIENT_OPTS),
(conf_ceilometer_client.ceilometer_client,
conf_ceilometer_client.CEILOMETER_CLIENT_OPTS),
(conf_neutron_client.neutron_client,
conf_neutron_client.NEUTRON_CLIENT_OPTS),
(conf_auth.WATCHER_CLIENTS_AUTH,
(ka_loading.get_auth_common_conf_options() +
ka_loading.get_auth_plugin_conf_options('password') +
ka_loading.get_session_conf_options()))
]
def register_opts(conf):
""" Registers all the sections in this module.
"""
for section in SECTIONS:
conf.register_group(
cfg.OptGroup(name=section.name,
title=section.title,
help=section.help))
conf.register_opts(section.options, group=section.name)
conf.register_opts(
ks_loading.get_auth_plugin_conf_options('password'),
group='keystone_authtoken'
)
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 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)