Example #1
0
def list_opts():
    return {
        placement_group.name:
        (placement_opts + ks_loading.get_session_conf_options() +
         ks_loading.get_auth_common_conf_options() +
         ks_loading.get_auth_plugin_conf_options('v3password'))
    }
Example #2
0
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')
    }
Example #3
0
    def test_common_conf_options(self):
        opts = loading.get_auth_common_conf_options()

        self.assertEqual(2, len(opts))
        auth_type = [o for o in opts if o.name == 'auth_type'][0]
        self.assertEqual(1, len(auth_type.deprecated_opts))
        self.assertIsInstance(auth_type.deprecated_opts[0], cfg.DeprecatedOpt)
Example #4
0
File: opts.py Project: rabi/aodh
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 #5
0
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 #6
0
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")
    }
Example #7
0
def add_auth_opts(options):
    """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
Example #8
0
def list_opts():
    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 = copy.deepcopy(opts)
    opts_copy.insert(0, loading.get_auth_common_conf_options()[0])

    plugins = ['password', 'v2password', 'v3password']
    for name in plugins:
        plugin = loading.get_plugin_loader(name)
        add_options(opts_copy, loading.get_auth_plugin_conf_options(plugin))
    add_options(opts_copy, loading.get_session_conf_options())

    adapter_opts = loading.get_adapter_conf_options(include_deprecated=False)
    # adding defaults for valid interfaces
    cfg.set_defaults(adapter_opts,
                     service_type='identity',
                     valid_interfaces=['internal', 'public'])
    add_options(opts_copy, adapter_opts)
    opts_copy.sort(key=lambda x: x.name)
    return opts_copy
Example #9
0
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
0
def list_opts():
    """Return a list of oslo_config options available in auth_token middleware.

    The returned list includes the non-deprecated oslo_config options which may
    be registered at runtime by the project. The purpose of this is to allow
    tools like the Oslo sample config file generator to discover the options
    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 = (keystonemiddleware.auth_token._OPTS +
                       loading.get_auth_common_conf_options())

    return [(_base.AUTHTOKEN_GROUP, copy.deepcopy(auth_token_opts))]
Example #11
0
def add_auth_opts(options, service_type=None):
    """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())
    if service_type:
        adapter_opts = kaloading.get_adapter_conf_options(
            include_deprecated=False)
        # adding defaults for valid interfaces
        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 #12
0
def list_opts():
    """Return a list of oslo_config options available in auth_token middleware.

    The returned list includes the non-deprecated oslo_config options which may
    be registered at runtime by the project. The purpose of this is to allow
    tools like the Oslo sample config file generator to discover the options
    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 = (keystonemiddleware.auth_token._OPTS +
                       loading.get_auth_common_conf_options())

    return [(_base.AUTHTOKEN_GROUP, copy.deepcopy(auth_token_opts))]
Example #13
0
def add_auth_opts(options):
    """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
Example #14
0
def add_auth_opts(options, service_type=None):
    """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())
    if service_type:
        adapter_opts = kaloading.get_adapter_conf_options(
            include_deprecated=False)
        # adding defaults for valid interfaces
        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 #15
0
    def test_common_conf_options(self):
        opts = loading.get_auth_common_conf_options()

        self.assertEqual(2, len(opts))
        auth_type = [o for o in opts if o.name == 'auth_type'][0]
        self.assertEqual(1, len(auth_type.deprecated_opts))
        self.assertIsInstance(auth_type.deprecated_opts[0], cfg.DeprecatedOpt)
Example #16
0
def list_opts():
    return [
        ('DEFAULT',
         itertools.chain(ceilometer.agent.manager.OPTS,
                         ceilometer.api.app.OPTS,
                         ceilometer.cmd.polling.CLI_OPTS,
                         ceilometer.compute.util.OPTS,
                         ceilometer.compute.virt.inspector.OPTS,
                         ceilometer.compute.virt.libvirt.inspector.OPTS,
                         ceilometer.dispatcher.OPTS,
                         ceilometer.ipmi.notifications.ironic.OPTS,
                         ceilometer.middleware.OPTS,
                         ceilometer.nova_client.OPTS,
                         ceilometer.objectstore.swift.OPTS,
                         ceilometer.pipeline.OPTS,
                         ceilometer.sample.OPTS,
                         ceilometer.service.OPTS,
                         ceilometer.utils.OPTS,)),
        ('api', ceilometer.api.app.API_OPTS),
        ('collector',
         itertools.chain(ceilometer.collector.OPTS,
                         [ceilometer.service.COLL_OPT])),
        ('compute', ceilometer.compute.discovery.OPTS),
        ('coordination', ceilometer.coordination.OPTS),
        ('database', ceilometer.storage.OPTS),
        ('dispatcher_file', ceilometer.dispatcher.file.OPTS),
        ('dispatcher_gnocchi', ceilometer.dispatcher.gnocchi.dispatcher_opts),
        ('event', ceilometer.event.converter.OPTS),
        ('exchange_control', ceilometer.exchange_control.EXCHANGE_OPTS),
        ('hardware', ceilometer.hardware.discovery.OPTS),
        ('ipmi',
         itertools.chain(ceilometer.ipmi.platform.intel_node_manager.OPTS,
                         ceilometer.ipmi.pollsters.OPTS)),
        ('meter', ceilometer.meter.notifications.OPTS),
        ('notification',
         itertools.chain(ceilometer.notification.OPTS,
                         [ceilometer.service.NOTI_OPT])),
        ('polling', ceilometer.agent.manager.POLLING_OPTS),
        ('publisher', ceilometer.publisher.utils.OPTS),
        ('publisher_notifier', ceilometer.publisher.messaging.NOTIFIER_OPTS),
        ('rgw_admin_credentials', ceilometer.objectstore.rgw.CREDENTIAL_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.
        ('service_credentials', (
            ceilometer.keystone_client.CLI_OPTS +
            loading.get_auth_common_conf_options() +
            loading.get_auth_plugin_conf_options('password'))),
        ('service_types',
         itertools.chain(ceilometer.energy.kwapi.SERVICE_OPTS,
                         ceilometer.image.discovery.SERVICE_OPTS,
                         ceilometer.neutron_client.SERVICE_OPTS,
                         ceilometer.nova_client.SERVICE_OPTS,
                         ceilometer.objectstore.rgw.SERVICE_OPTS,
                         ceilometer.objectstore.swift.SERVICE_OPTS,)),
        ('storage', ceilometer.dispatcher.STORAGE_OPTS),
        ('vmware', ceilometer.compute.virt.vmware.inspector.OPTS),
        ('xenapi', ceilometer.compute.virt.xenapi.inspector.OPTS),
    ]
Example #17
0
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'))
    }
Example #18
0
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))
    }
Example #19
0
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')),
        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
Example #20
0
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))]
Example #21
0
def list_opts():
    return {
        vendordata_group:
        (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 #22
0
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.
    # Also, the default loaded plugin is password-aodh-legacy for
    # backward compatibily
    return [('service_credentials',
             (loading.get_auth_common_conf_options() +
              loading.get_auth_plugin_conf_options('password')))]
Example #23
0
File: opts.py Project: zqfan/aodh
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.
    # Also, the default loaded plugin is password-aodh-legacy for
    # backward compatibily
    return [('service_credentials', (
            loading.get_auth_common_conf_options() +
            loading.get_auth_plugin_conf_options('password')))]
Example #24
0
def list_opts():
    return {
        cinder_group.name:
        (cinder_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 #25
0
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
    ))]
Example #26
0
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 #27
0
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 #28
0
def list_opts():
    return {
        vendordata_group: (
            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 #29
0
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 #30
0
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 #31
0
def list_opts():
    return {
        placement_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 #32
0
def list_opts():
    return {
        placement_group.name:
        (placement_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))
    }
Example #33
0
def list_opts():
    opts = {
        None:
        context_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')
    }
    return opts
Example #34
0
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'))
    }
Example #35
0
def list_opts():
    return {
        placement_group.name: (
            placement_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 #36
0
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 #37
0
def list_neutron_opts():
    opt_list = copy.deepcopy(config.neutron_opts)
    opt_list.insert(0, ks_loading.get_auth_common_conf_options()[0])
    # 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)
    opt_list.sort(key=operator.attrgetter('name'))
    return [(config.neutron_group, opt_list)]
Example #38
0
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)]
Example #39
0
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)]
Example #40
0
def list_neutron_opts():
    opt_list = copy.deepcopy(config.neutron_opts)
    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)
    opt_list.sort(key=operator.attrgetter('name'))
    return [(config.neutron_group, opt_list)]
Example #41
0
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 #42
0
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 #43
0
def _gen_opts_from_plugins():
    opts = copy.deepcopy(neutron_options)
    opts.insert(0, ks_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 = ks_loading.get_plugin_loader(name)
        for plugin_option in ks_loading.get_auth_plugin_conf_options(plugin):
            for option in opts:
                if option.name == plugin_option.name:
                    break
            else:
                opts.append(plugin_option)
    opts.sort(key=lambda x: x.name)
    return opts
Example #44
0
def _gen_opts_from_plugins():
    opts = copy.deepcopy(neutron_options)
    opts.insert(0, ks_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 = ks_loading.get_plugin_loader(name)
        for plugin_option in ks_loading.get_auth_plugin_conf_options(plugin):
            for option in opts:
                if option.name == plugin_option.name:
                    break
            else:
                opts.append(plugin_option)
    opts.sort(key=lambda x: x.name)
    return opts
Example #45
0
def list_auth_opts(group):
    group_conf = AUTH_GROUPS_OPTS.get(group)
    kwargs = {'conf': CONF, 'group': group}
    deprecations = group_conf.get('deprecations')
    if deprecations:
        kwargs['deprecated_opts'] = deprecations
    opts = ks_loading.register_session_conf_options(**kwargs)
    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 [(group, opt_list)]
Example #46
0
def list_opts():
    return [
        ('api', watcher.api.app.API_SERVICE_OPTS),
        ('watcher_goals', strategy_selector.WATCHER_GOALS_OPTS),
        ('watcher_decision_engine',
         decision_engine_manger.WATCHER_DECISION_ENGINE_OPTS),
        ('watcher_applier', applier_manager.APPLIER_MANAGER_OPTS),
        ('watcher_planner', planner_manager.WATCHER_PLANNER_OPTS),
        ('nova_client', clients.NOVA_CLIENT_OPTS),
        ('glance_client', clients.GLANCE_CLIENT_OPTS),
        ('cinder_client', clients.CINDER_CLIENT_OPTS),
        ('ceilometer_client', clients.CEILOMETER_CLIENT_OPTS),
        ('neutron_client', clients.NEUTRON_CLIENT_OPTS),
        ('watcher_clients_auth',
         (ka_loading.get_auth_common_conf_options() +
          ka_loading.get_auth_plugin_conf_options('password') +
          ka_loading.get_session_conf_options()))
    ]
Example #47
0
def list_opts():
    """Legacy aggregation of all the watcher config options"""
    return [('DEFAULT', (conf_api.AUTH_OPTS + exception.EXC_LOG_OPTS +
                         paths.PATH_OPTS + utils.UTILS_OPTS)),
            ('api', conf_api.API_SERVICE_OPTS), ('database', db.SQL_OPTS),
            ('watcher_planner', conf_planner.WATCHER_PLANNER_OPTS),
            ('watcher_applier', conf_applier.APPLIER_MANAGER_OPTS),
            ('watcher_decision_engine', (conf_de.WATCHER_DECISION_ENGINE_OPTS +
                                         conf_de.WATCHER_CONTINUOUS_OPTS)),
            ('nova_client', conf_nova_client.NOVA_CLIENT_OPTS),
            ('glance_client', conf_glance_client.GLANCE_CLIENT_OPTS),
            ('cinder_client', conf_cinder_client.CINDER_CLIENT_OPTS),
            ('ceilometer_client',
             conf_ceilometer_client.CEILOMETER_CLIENT_OPTS),
            ('neutron_client', conf_neutron_client.NEUTRON_CLIENT_OPTS),
            ('watcher_clients_auth',
             (ka_loading.get_auth_common_conf_options() +
              ka_loading.get_auth_plugin_conf_options('password') +
              ka_loading.get_session_conf_options()))]
Example #48
0
    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 #49
0
def add_auth_options(options, group):

    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())
    opts.sort(key=lambda x: x.name)
    return [(group, opts)]
Example #50
0
def add_auth_options(options, group):

    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())
    opts.sort(key=lambda x: x.name)
    return [(group, opts)]
Example #51
0
def list_opts():
    return [
        ('DEFAULT',
         itertools.chain(searchlight.common.property_utils.property_opts,
                         searchlight.common.config.common_opts)),
        ('elasticsearch', searchlight.elasticsearch.search_opts),
        ('service_credentials',
         itertools.chain(
             searchlight.elasticsearch.plugins.openstack_clients.client_opts,
             loading.get_auth_common_conf_options(),
             list_auth_opts())),
        ('resource_plugin',
         searchlight.elasticsearch.plugins.base.indexer_opts),
        ('paste_deploy', searchlight.common.config.paste_deploy_opts),
        ('profiler', searchlight.common.wsgi.profiler_opts),
        ('listener', searchlight.listener.listener_opts),
        ('api',
         itertools.chain(searchlight.api.versions.versions_opts,
                         searchlight.common.wsgi.bind_opts,
                         searchlight.common.wsgi.socket_opts,
                         searchlight.common.wsgi.eventlet_opts)),
    ]
Example #52
0
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
Example #53
0
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

from keystoneauth1 import loading
from keystoneclient.v3 import client as ks_client_v3
from oslo_config import cfg

CONF = cfg.CONF

CFG_GROUP = "keystone_auth"

loading.register_auth_conf_options(CONF, CFG_GROUP)
loading.register_session_conf_options(CONF, CFG_GROUP)

opts = (loading.get_auth_common_conf_options() +
        loading.get_session_conf_options() +
        loading.get_auth_plugin_conf_options('password'))


def get_session(conf, project):
    """Get an auth session."""
    auth_plugin = loading.load_auth_from_conf_options(conf, CFG_GROUP,
                                                      project_name=project)
    return loading.load_session_from_conf_options(conf, CFG_GROUP,
                                                  auth=auth_plugin)


def get_client(conf, project):
    """Return a client for Keystone."""
    sess = get_session(conf, project)
Example #54
0
from keystonemiddleware.auth_token import _identity
from keystonemiddleware.auth_token import _opts
from keystonemiddleware.auth_token import _request
from keystonemiddleware.auth_token import _signing_dir
from keystonemiddleware.auth_token import _user_plugin
from keystonemiddleware.i18n import _


_LOG = logging.getLogger(__name__)
_CACHE_INVALID_INDICATOR = 'invalid'
oslo_cache.configure(cfg.CONF)


AUTH_TOKEN_OPTS = [
    (_base.AUTHTOKEN_GROUP,
     _opts._OPTS + _auth.OPTS + loading.get_auth_common_conf_options())
]


def list_opts():
    """Return a list of oslo_config options available in auth_token middleware.

    The returned list includes all oslo_config options which may be registered
    at runtime by the project.

    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.

    NOTE: This function is no longer used for oslo_config sample generation.
Example #55
0
from keystoneauth1.access import access as ka_access
from keystoneauth1.identity import access as ka_access_plugin
from keystoneauth1.identity import v3 as ka_v3
from keystoneauth1 import loading as ka_loading
from keystoneclient.v3 import client as kc_v3
from oslo_config import cfg
from oslo_log import log as logging

from fuge.common import exception
from fuge.common.i18n import _LE

CONF = cfg.CONF
CFG_GROUP = 'keystone_auth'
LOG = logging.getLogger(__name__)

keystone_auth_opts = (ka_loading.get_auth_common_conf_options() +
                      ka_loading.get_auth_plugin_conf_options('password'))

CONF.import_group('keystone_authtoken', 'keystonemiddleware.auth_token')
ka_loading.register_auth_conf_options(CONF, CFG_GROUP)
ka_loading.register_session_conf_options(CONF, CFG_GROUP)
CONF.set_default('auth_type', default='password', group=CFG_GROUP)


class KeystoneClientV3(object):
    """Keystone client wrapper so we can encapsulate logic in one place."""

    def __init__(self, context):
        self.context = context
        self._client = None
        self._session = None
Example #56
0
                ' this currently only affects the allow_expired check.'),
    cfg.BoolOpt('service_token_roles_required', default=False,
                help='For backwards compatibility reasons we must let valid'
                ' service tokens pass that don\'t pass the service_token_roles'
                ' check as valid. Setting this true will become the default'
                ' in a future release and should be enabled if possible.'),
]


CONF = cfg.CONF
CONF.register_opts(_OPTS, group=_base.AUTHTOKEN_GROUP)
loading.register_auth_conf_options(cfg.CONF, _base.AUTHTOKEN_GROUP)


auth_token_opts = [
    (_base.AUTHTOKEN_GROUP, _OPTS + loading.get_auth_common_conf_options()),
]

__all__ = (
    'list_opts',
)


def list_opts():
    """Return a list of oslo_config options available in auth_token middleware.

    The returned list includes the non-deprecated oslo_config options which may
    be registered at runtime by the project. The purpose of this is to allow
    tools like the Oslo sample config file generator to discover the options
    exposed to users by this middleware.
Example #57
0
 def test_get_common(self):
     opts = loading.get_auth_common_conf_options()
     for opt in opts:
         self.assertIsInstance(opt, cfg.Opt)
     self.assertEqual(2, len(opts))
Example #58
0
from voluptuous import In
from voluptuous import Length
from voluptuous import Required
from voluptuous import Schema

from cloudkitty import collector
from cloudkitty import utils as ck_utils


LOG = logging.getLogger(__name__)

# NOTE(mc): The deprecated section should be removed in a future release.
COLLECTOR_GNOCCHI_OPTS = 'collector_gnocchi'
DEPRECATED_COLLECTOR_GNOCCHI_OPTS = 'gnocchi_collector'

keystone_opts = ks_loading.get_auth_common_conf_options() + \
    ks_loading.get_session_conf_options()

keystone_opts = [
    cfg.Opt(
        o.name,
        type=o.type,
        help=o.help,
        deprecated_group=DEPRECATED_COLLECTOR_GNOCCHI_OPTS,
    ) for o in keystone_opts
]

collector_gnocchi_opts = [
    cfg.StrOpt(
        'gnocchi_auth_type',
        default='keystone',