Move stray notification options into config module

These are basically the only configuration options in keystone defined
outside of keystone/common/config.py, so the only goal here is to
centralize them into one place.

Change-Id: I1369fd7835b31e57a094d07deb6a1aacc1d314b5
This commit is contained in:
Dolph Mathews 2016-06-02 16:17:44 -05:00
parent c1e712e187
commit 671cb9c5d9
4 changed files with 18 additions and 29 deletions

View File

@ -90,10 +90,6 @@
# but is insecure. (boolean value)
#insecure_debug = false
#
# From keystone.notifications
#
# Default publisher_id for outgoing notifications (string value)
#default_publisher_id = <None>

View File

@ -153,6 +153,24 @@ FILE_OPTIONS = {
'or authenticated user to get more information than '
'normal, such as why authentication failed. This may '
'be useful for debugging but is insecure.'),
cfg.StrOpt('default_publisher_id',
help='Default publisher_id for outgoing notifications'),
cfg.StrOpt('notification_format', default='basic',
choices=['basic', 'cadf'],
help='Define the notification format for Identity Service '
'events. A "basic" notification has information about '
'the resource being operated on. A "cadf" '
'notification has the same information, as well as '
'information about the initiator of the event.'),
cfg.MultiStrOpt('notification_opt_out', default=[],
help='Define the notification options to opt-out '
'from. The value expected is: '
'identity.<resource_type>.<operation>. This '
'field can be set multiple times in order to add '
'more notifications to opt-out from. For example:'
'\n notification_opt_out=identity.user.created'
'\n notification_opt_out=identity.authenticate.'
'success'),
],
'identity': [
cfg.StrOpt('default_domain_id', default='default',

View File

@ -36,29 +36,6 @@ from keystone.common import utils
_CATALOG_HELPER_OBJ = None
notifier_opts = [
cfg.StrOpt('default_publisher_id',
help='Default publisher_id for outgoing notifications'),
cfg.StrOpt('notification_format', default='basic',
choices=['basic', 'cadf'],
help='Define the notification format for Identity Service '
'events. A "basic" notification has information about '
'the resource being operated on. A "cadf" notification '
'has the same information, as well as information about '
'the initiator of the event.'),
cfg.MultiStrOpt('notification_opt_out', default=[],
help='Define the notification options to opt-out from. '
'The value expected is: '
'identity.<resource_type>.<operation>. This field '
'can be set multiple times in order to add more '
'notifications to opt-out from. For example:\n '
'notification_opt_out=identity.user.created\n '
'notification_opt_out=identity.authenticate.success'),
]
config_section = None
list_opts = lambda: [(config_section, notifier_opts), ]
LOG = log.getLogger(__name__)
# NOTE(gyee): actions that can be notified. One must update this list whenever
# a new action is supported.
@ -93,7 +70,6 @@ SERVICE = 'identity'
CONF = cfg.CONF
CONF.register_opts(notifier_opts)
# NOTE(morganfainberg): Special case notifications that are only used
# internally for handling token persistence token deletions

View File

@ -182,7 +182,6 @@ keystone.revoke =
oslo.config.opts =
keystone = keystone.common.config:list_opts
keystone.notifications = keystone.notifications:list_opts
oslo.config.opts.defaults =
keystone = keystone.common.config:set_external_opts_defaults