keystone  18.0.0
About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Victoria" series (maintained release).
  Fossies Dox: keystone-18.0.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

__init__.py
Go to the documentation of this file.
1 # Licensed under the Apache License, Version 2.0 (the "License"); you may
2 # not use this file except in compliance with the License. You may obtain
3 # a copy of the License at
4 #
5 # http://www.apache.org/licenses/LICENSE-2.0
6 #
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 # License for the specific language governing permissions and limitations
11 # under the License.
12 
13 import logging
14 
15 from oslo_cache import core as cache
16 from oslo_config import cfg
17 from oslo_log import log
18 from oslo_log import versionutils
19 import oslo_messaging
20 from oslo_middleware import cors
21 from osprofiler import opts as profiler
22 
23 from keystone.conf import application_credential
24 from keystone.conf import assignment
25 from keystone.conf import auth
26 from keystone.conf import catalog
27 from keystone.conf import credential
28 from keystone.conf import default
29 from keystone.conf import domain_config
30 from keystone.conf import endpoint_filter
31 from keystone.conf import endpoint_policy
32 from keystone.conf import eventlet_server
33 from keystone.conf import federation
34 from keystone.conf import fernet_receipts
35 from keystone.conf import fernet_tokens
36 from keystone.conf import identity
37 from keystone.conf import identity_mapping
38 from keystone.conf import jwt_tokens
39 from keystone.conf import ldap
40 from keystone.conf import memcache
41 from keystone.conf import oauth1
42 from keystone.conf import policy
43 from keystone.conf import receipt
44 from keystone.conf import resource
45 from keystone.conf import revoke
46 from keystone.conf import role
47 from keystone.conf import saml
48 from keystone.conf import security_compliance
49 from keystone.conf import shadow_users
50 from keystone.conf import token
51 from keystone.conf import tokenless_auth
52 from keystone.conf import totp
53 from keystone.conf import trust
54 from keystone.conf import unified_limit
55 from keystone.conf import wsgi
56 
57 CONF = cfg.CONF
58 
59 
60 conf_modules = [
61  application_credential,
62  assignment,
63  auth,
64  catalog,
65  credential,
66  default,
67  domain_config,
68  endpoint_filter,
69  endpoint_policy,
70  eventlet_server,
71  federation,
72  fernet_receipts,
73  fernet_tokens,
74  identity,
75  identity_mapping,
76  jwt_tokens,
77  ldap,
78  memcache,
79  oauth1,
80  policy,
81  receipt,
82  resource,
83  revoke,
84  role,
85  saml,
86  security_compliance,
87  shadow_users,
88  token,
89  tokenless_auth,
90  totp,
91  trust,
92  unified_limit,
93  wsgi
94 ]
95 
96 
97 oslo_messaging.set_transport_defaults(control_exchange='keystone')
98 _DEPRECATED_REASON = ('This option is only used by eventlet mode which has '
99  'been removed from Keystone in Newton release.')
100 
101 
103  """Set the default for the default_log_levels option for keystone.
104 
105  Keystone uses some packages that other OpenStack services don't use that do
106  logging. This will set the default_log_levels default level for those
107  packages.
108 
109  This function needs to be called before CONF().
110 
111  """
112  extra_log_level_defaults = [
113  'dogpile=INFO',
114  'routes=INFO',
115  ]
116 
117  log.register_options(CONF)
118  log.set_defaults(default_log_levels=log.get_default_log_levels() +
119  extra_log_level_defaults)
120 
121 
123  """Set up logging for the keystone package."""
124  log.setup(CONF, 'keystone')
125  logging.captureWarnings(True)
126 
127 
128 def configure(conf=None):
129  if conf is None:
130  conf = CONF
131 
132  conf.register_cli_opt(
133  cfg.BoolOpt('standard-threads', default=False,
134  help='Do not monkey-patch threading system modules.',
135  deprecated_for_removal=True,
136  deprecated_reason=_DEPRECATED_REASON,
137  deprecated_since=versionutils.deprecated.STEIN))
138  conf.register_cli_opt(
139  cfg.StrOpt('pydev-debug-host',
140  help='Host to connect to for remote debugger.',
141  deprecated_for_removal=True,
142  deprecated_reason=_DEPRECATED_REASON,
143  deprecated_since=versionutils.deprecated.STEIN))
144  conf.register_cli_opt(
145  cfg.PortOpt('pydev-debug-port',
146  help='Port to connect to for remote debugger.',
147  deprecated_for_removal=True,
148  deprecated_reason=_DEPRECATED_REASON,
149  deprecated_since=versionutils.deprecated.STEIN))
150 
151  for module in conf_modules:
152  module.register_opts(conf)
153 
154  # register any non-default auth methods here (used by extensions, etc)
155  auth.setup_authentication()
156 
157  # add oslo.cache related config options
158  cache.configure(conf)
159 
160 
162  """Update default configuration options for oslo.middleware."""
163  cors.set_defaults(
164  allow_headers=['X-Auth-Token',
165  'X-Openstack-Request-Id',
166  'X-Subject-Token',
167  'X-Project-Id',
168  'X-Project-Name',
169  'X-Project-Domain-Id',
170  'X-Project-Domain-Name',
171  'X-Domain-Id',
172  'X-Domain-Name',
173  'Openstack-Auth-Receipt'],
174  expose_headers=['X-Auth-Token',
175  'X-Openstack-Request-Id',
176  'X-Subject-Token',
177  'Openstack-Auth-Receipt'],
178  allow_methods=['GET',
179  'PUT',
180  'POST',
181  'DELETE',
182  'PATCH']
183  )
184 
185  # configure OSprofiler options
186  profiler.set_defaults(CONF, enabled=False, trace_sqlalchemy=False)
187 
188  # Oslo.cache is always enabled by default for request-local caching
189  # TODO(morganfainberg): Fix this to not use internal interface when
190  # oslo.cache has proper interface to set defaults added. This is
191  # just a bad way to do this.
192  opts = cache._opts.list_opts()
193  for opt_list in opts:
194  if opt_list[0] == 'cache':
195  for o in opt_list[1]:
196  if o.name == 'enabled':
197  o.default = True
198 
199 
201  """Override all configuration default values for keystone."""
keystone.conf.set_external_opts_defaults
def set_external_opts_defaults()
Definition: __init__.py:161
keystone.conf.setup_logging
def setup_logging()
Definition: __init__.py:122
keystone.conf.set_default_for_default_log_levels
def set_default_for_default_log_levels()
Definition: __init__.py:102
keystone.conf.set_config_defaults
def set_config_defaults()
Definition: __init__.py:200
keystone.conf.configure
def configure(conf=None)
Definition: __init__.py:128
keystone.conf
Definition: __init__.py:1