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)
Go to the documentation of this file.
1 # Copyright 2018 Catalyst Cloud Ltd
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may
4 # not use this file except in compliance with the License. You may obtain
5 # a copy of the License at
6 #
7 #
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 # License for the specific language governing permissions and limitations
13 # under the License.
15 from oslo_config import cfg
17 from keystone.conf import utils
20 key_repository = cfg.StrOpt(
21  'key_repository',
22  default='/etc/keystone/fernet-keys/',
23  help=utils.fmt("""
24 Directory containing Fernet receipt keys. This directory must exist before
25 using `keystone-manage fernet_setup` for the first time, must be writable by
26 the user running `keystone-manage fernet_setup` or `keystone-manage
27 fernet_rotate`, and of course must be readable by keystone's server process.
28 The repository may contain keys in one of three states: a single staged key
29 (always index 0) used for receipt validation, a single primary key (always the
30 highest index) used for receipt creation and validation, and any number of
31 secondary keys (all other index values) used for receipt validation. With
32 multiple keystone nodes, each node must share the same key repository contents,
33 with the exception of the staged key (index 0). It is safe to run
34 `keystone-manage fernet_rotate` once on any one node to promote a staged key
35 (index 0) to be the new primary (incremented from the previous highest index),
36 and produce a new staged key (a new key with index 0); the resulting repository
37 can then be atomically replicated to other nodes without any risk of race
38 conditions (for example, it is safe to run `keystone-manage fernet_rotate` on
39 host A, wait any amount of time, create a tarball of the directory on host A,
40 unpack it on host B to a temporary location, and atomically move (`mv`) the
41 directory into place on host B). Running `keystone-manage fernet_rotate`
42 *twice* on a key repository without syncing other nodes will result in receipts
43 that can not be validated by all nodes.
44 """))
46 max_active_keys = cfg.IntOpt(
47  'max_active_keys',
48  default=3,
49  min=1,
50  help=utils.fmt("""
51 This controls how many keys are held in rotation by `keystone-manage
52 fernet_rotate` before they are discarded. The default value of 3 means that
53 keystone will maintain one staged key (always index 0), one primary key (the
54 highest numerical index), and one secondary key (every other index). Increasing
55 this value means that additional secondary keys will be kept in the rotation.
56 """))
59 GROUP_NAME = __name__.split('.')[-1]
60 ALL_OPTS = [
61  key_repository,
62  max_active_keys,
63 ]
66 def register_opts(conf):
67  conf.register_opts(ALL_OPTS, group=GROUP_NAME)
70 def list_opts():
71  return {GROUP_NAME: ALL_OPTS}
def register_opts(conf)
def list_opts()