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)  

generator.py
Go to the documentation of this file.
1 # Copyright 2014 IBM Corp.
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 # http://www.apache.org/licenses/LICENSE-2.0
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.
14 
15 """ID Generator provider interface."""
16 
17 import abc
18 
19 from keystone.common import manager
20 import keystone.conf
21 from keystone import exception
22 
23 
24 CONF = keystone.conf.CONF
25 
26 
27 class Manager(manager.Manager):
28  """Default pivot point for the identifier generator backend."""
29 
30  driver_namespace = 'keystone.identity.id_generator'
31  _provides_api = 'id_generator_api'
32 
33  def __init__(self):
34  super(Manager, self).__init__(CONF.identity_mapping.generator)
35 
36 
37 class IDGenerator(object, metaclass=abc.ABCMeta):
38  """Interface description for an ID Generator provider."""
39 
40  @abc.abstractmethod
41  def generate_public_ID(self, mapping):
42  """Return a Public ID for the given mapping dict.
43 
44  :param dict mapping: The items to be hashed.
45 
46  The ID must be reproducible and no more than 64 chars in length.
47  The ID generated should be independent of the order of the items
48  in the mapping dict.
49 
50  """
51  raise exception.NotImplemented() # pragma: no cover
keystone.identity.generator.Manager.__init__
def __init__(self)
Definition: generator.py:33
keystone.identity.generator.Manager
Definition: generator.py:27
keystone.conf
Definition: __init__.py:1
keystone.exception.NotImplemented
Definition: exception.py:621
keystone.identity.generator.IDGenerator.generate_public_ID
def generate_public_ID(self, mapping)
Definition: generator.py:41
keystone.identity.generator.IDGenerator
Definition: generator.py:37
keystone.common
Definition: __init__.py:1