Module Expr Str Import alias Import alias Import alias ImportFrom alias identifier ImportFrom alias identifier ImportFrom alias ImportFrom alias identifier ImportFrom alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias identifier ImportFrom alias Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot NameLoad body Assign NameStore Call NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Raise Call AttributeLoad NameLoad attr NameLoad If BoolOpOr UnaryOpNot Call NameLoad NameLoad Str CompareIs AttributeLoad NameLoad attr NameLoad body Assign NameStore Call NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Raise Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr NameLoad body Return AttributeLoad NameLoad attr TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr Assign NameStore Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Dict Str Str Str Str NameLoad NameLoad NameLoad NameLoad If AttributeLoad AttributeLoad NameLoad attr attr body Assign AttributeStore NameLoad attr BinOpMod AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Index Num Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body With Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Str Str Str Num body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body With Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Str Str Str Num Str NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad TryExcept body If Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr If CompareEq NameLoad Str body Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr orelse If BoolOpAnd CompareEq NameLoad Str UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Str attr Call NameLoad Lambda arguments args NameParam defaults BinOpMod Str NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body With Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Return NameLoad handlers ExceptHandler type NameLoad name NameStore body With Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot NameLoad body Assign NameStore Str Raise Call AttributeLoad NameLoad attr NameLoad Return BinOpAdd BinOpAdd AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str body Expr Str TryExcept body Assign NameStore AttributeLoad NameLoad attr If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore NameLoad Return NameLoad handlers ExceptHandler type NameLoad name NameStore body With Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad handlers ExceptHandler type NameLoad name NameStore body With Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str body Expr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad attr orelse Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Return NameLoad handlers ExceptHandler type NameLoad name NameStore body With Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad handlers ExceptHandler type NameLoad name NameStore body With Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad decorator_list decorator_list
N/A N/A 
Key manager implementation for Barbican
 N/A array N/A base64 N/A binascii barbicanclient client barbican_client keystoneauth1 loading ks_loading keystoneauth1 session oslo_log log logging oslo_utils excutils N/A nova.conf nova exception nova.i18n _ nova.i18n _LE nova.keymgr key keymgr_key nova.keymgr key_mgr N/A CONF N/A N/A nova conf CONF N/A LOG N/A N/A logging getLogger __name__ BarbicanKeyManager N/A N/A key_mgr KeyManager N/A N/A Key Manager Interface that wraps the Barbican client API. __init__ N/A N/A self N/A N/A N/A N/A self _barbican_client None N/A N/A self _current_context None N/A N/A self _base_url None N/A _get_barbican_client N/A N/A self ctxt N/A N/A N/A Creates a client to connect to the Barbican service.

        :param ctxt: the user context for authentication
        :return: a Barbican Client object
        :raises Forbidden: if the ctxt is None
         N/A N/A ctxt N/A N/A msg N/A _ User is not authorized to use key manager. N/A N/A N/A LOG error msg N/A N/A N/A exception Forbidden msg N/A N/A N/A N/A hasattr ctxt project_id N/A N/A ctxt project_id None N/A N/A msg N/A _ Unable to create Barbican Client without project_id. N/A N/A N/A LOG error msg N/A N/A N/A exception KeyManagerError msg N/A N/A N/A self _barbican_client N/A N/A self _current_context ctxt N/A N/A N/A self _barbican_client N/A N/A N/A _SESSION N/A N/A ks_loading load_session_from_conf_options CONF N/A N/A N/A N/A nova conf barbican barbican_group name N/A auth N/A N/A ctxt get_auth_plugin N/A N/A service_type service_name interface N/A N/A N/A N/A CONF barbican catalog_info split : N/A region_name N/A N/A CONF barbican os_region_name N/A service_parameters N/A service_type service_name interface region_name service_type service_name interface region_name N/A N/A N/A CONF barbican endpoint_template N/A N/A N/A self _base_url N/A N/A N/A CONF barbican endpoint_template N/A N/A ctxt to_dict N/A N/A N/A self _base_url N/A N/A _SESSION get_endpoint auth service_parameters N/A N/A self _barbican_endpoint N/A N/A N/A N/A self _base_url rpartition / N/A 0 N/A sess N/A N/A session Session auth auth N/A N/A self _barbican_client N/A N/A barbican_client Client session sess endpoint N/A self _barbican_endpoint N/A N/A self _current_context ctxt N/A N/A N/A Exception N/A e N/A N/A N/A N/A excutils save_and_reraise_exception N/A N/A N/A N/A LOG error N/A _LE Error creating Barbican client: %s e N/A N/A self _barbican_client N/A create_key N/A N/A self ctxt expiration name payload_content_type mode algorithm length N/A None Nova Compute Key application/octet-stream CBC AES 256 N/A N/A Creates a key.

        :param ctxt: contains information of the user and the environment
                     for the request (nova/context.py)
        :param expiration: the date the key will expire
        :param name: a friendly name for the secret
        :param payload_content_type: the format/type of the secret data
        :param mode: the algorithm mode (e.g. CBC or CTR mode)
        :param algorithm: the algorithm associated with the secret
        :param length: the bit length of the secret

        :return: the UUID of the new key
        :raises Exception: if key creation fails
         N/A barbican_client N/A N/A self _get_barbican_client ctxt N/A N/A N/A key_order N/A N/A N/A barbican_client orders create_key name algorithm length mode payload_content_type expiration N/A order_ref N/A N/A key_order submit N/A order N/A N/A N/A barbican_client orders get order_ref N/A N/A N/A self _retrieve_secret_uuid N/A order secret_ref N/A N/A N/A Exception N/A e N/A N/A N/A N/A excutils save_and_reraise_exception N/A N/A N/A N/A LOG error N/A _LE Error creating key: %s e N/A store_key N/A N/A self ctxt key expiration name payload_content_type payload_content_encoding algorithm bit_length mode from_copy N/A None Nova Compute Key application/octet-stream base64 AES 256 CBC False N/A N/A Stores (i.e., registers) a key with the key manager.

        :param ctxt: contains information of the user and the environment for
                     the request (nova/context.py)
        :param key: the unencrypted secret data. Known as "payload" to the
                    barbicanclient api
        :param expiration: the expiration time of the secret in ISO 8601
                           format
        :param name: a friendly name for the key
        :param payload_content_type: the format/type of the secret data
        :param payload_content_encoding: the encoding of the secret data
        :param algorithm: the algorithm associated with this secret key
        :param bit_length: the bit length of this secret key
        :param mode: the algorithm mode used with this secret key
        :param from_copy: establishes whether the function is being used
                    to copy a key. In case of the latter, it does not
                    try to decode the key

        :returns: the UUID of the stored key
        :raises Exception: if key storage fails
         N/A barbican_client N/A N/A self _get_barbican_client ctxt N/A N/A N/A N/A N/A key get_algorithm N/A N/A algorithm N/A N/A key get_algorithm N/A N/A payload_content_type text/plain N/A N/A payload_content_encoding None N/A encoded_key N/A N/A key get_encoded N/A N/A N/A N/A payload_content_type application/octet-stream N/A from_copy N/A N/A key_list N/A N/A key get_encoded N/A string_key N/A N/A join N/A map N/A N/A N/A byte N/A N/A %02x byte key_list N/A encoded_key N/A N/A base64 b64encode N/A N/A binascii unhexlify string_key N/A N/A encoded_key N/A N/A key get_encoded N/A secret N/A N/A N/A barbican_client secrets create name encoded_key payload_content_type payload_content_encoding algorithm bit_length mode expiration N/A secret_ref N/A N/A secret store N/A N/A N/A self _retrieve_secret_uuid secret_ref N/A N/A N/A Exception N/A e N/A N/A N/A N/A excutils save_and_reraise_exception N/A N/A N/A N/A LOG error N/A _LE Error storing key: %s e N/A copy_key N/A N/A self ctxt key_id N/A N/A N/A Copies (i.e., clones) a key stored by barbican.

        :param ctxt: contains information of the user and the environment for
                     the request (nova/context.py)
        :param key_id: the UUID of the key to copy
        :return: the UUID of the key copy
        :raises Exception: if key copying fails
         N/A N/A N/A secret N/A N/A self _get_secret ctxt key_id N/A con_type N/A N/A secret content_types N/A default N/A secret_data N/A N/A self _get_secret_data secret payload_content_type con_type N/A key N/A N/A keymgr_key SymmetricKey N/A secret algorithm secret_data N/A copy_uuid N/A N/A self store_key ctxt key N/A secret expiration N/A secret name con_type base64 N/A secret algorithm N/A secret bit_length N/A secret mode True N/A copy_uuid N/A N/A N/A Exception N/A e N/A N/A N/A N/A excutils save_and_reraise_exception N/A N/A N/A N/A LOG error N/A _LE Error copying key: %s e N/A _create_secret_ref N/A N/A self key_id N/A N/A N/A Creates the URL required for accessing a secret.

        :param key_id: the UUID of the key to copy

        :return: the URL of the requested secret
         N/A N/A key_id N/A N/A msg Key ID is None N/A N/A N/A exception KeyManagerError msg N/A N/A N/A N/A self _base_url /secrets/ key_id N/A _retrieve_secret_uuid N/A N/A self secret_ref N/A N/A N/A Retrieves the UUID of the secret from the secret_ref.

        :param secret_ref: the href of the secret

        :return: the UUID of the secret
         N/A N/A N/A N/A secret_ref rpartition / N/A 2 N/A _get_secret_data N/A N/A self secret payload_content_type N/A application/octet-stream N/A N/A Retrieves the secret data given a secret and content_type.

        :param ctxt: contains information of the user and the environment for
                     the request (nova/context.py)
        :param secret: the secret from barbican with the payload of data
        :param payload_content_type: the format/type of the secret data

        :returns: the secret data
        :raises Exception: if data cannot be retrieved
         N/A N/A N/A generated_data N/A secret payload N/A N/A payload_content_type application/octet-stream N/A N/A secret_data N/A N/A base64 b64encode generated_data N/A N/A secret_data generated_data N/A secret_data N/A N/A N/A Exception N/A e N/A N/A N/A N/A excutils save_and_reraise_exception N/A N/A N/A N/A LOG error N/A _LE Error getting secret data: %s e N/A _get_secret N/A N/A self ctxt key_id N/A N/A N/A Returns the metadata of the secret.

        :param ctxt: contains information of the user and the environment for
                     the request (nova/context.py)
        :param key_id: UUID of the secret

        :return: the secret's metadata
        :raises Exception: if there is an error retrieving the data
         N/A barbican_client N/A N/A self _get_barbican_client ctxt N/A N/A N/A secret_ref N/A N/A self _create_secret_ref key_id N/A N/A N/A N/A barbican_client secrets get secret_ref N/A N/A N/A Exception N/A e N/A N/A N/A N/A excutils save_and_reraise_exception N/A N/A N/A N/A LOG error N/A _LE Error getting secret metadata: %s e N/A get_key N/A N/A self ctxt key_id payload_content_type N/A application/octet-stream N/A N/A Retrieves the specified key.

        :param ctxt: contains information of the user and the environment for
                     the request (nova/context.py)
        :param key_id: the UUID of the key to retrieve
        :param payload_content_type: The format/type of the secret data

        :return: SymmetricKey representation of the key
        :raises Exception: if key retrieval fails
         N/A N/A N/A secret N/A N/A self _get_secret ctxt key_id N/A secret_data N/A N/A self _get_secret_data secret payload_content_type N/A N/A payload_content_type application/octet-stream N/A N/A key_data N/A N/A N/A N/A array array B N/A N/A base64 b64decode secret_data tolist N/A N/A key_data secret_data N/A key N/A N/A keymgr_key SymmetricKey N/A secret algorithm key_data N/A key N/A N/A N/A Exception N/A e N/A N/A N/A N/A excutils save_and_reraise_exception N/A N/A N/A N/A LOG error N/A _LE Error getting key: %s e N/A delete_key N/A N/A self ctxt key_id N/A N/A N/A Deletes the specified key.

        :param ctxt: contains information of the user and the environment for
                     the request (nova/context.py)
        :param key_id: the UUID of the key to delete
        :raises Exception: if key deletion fails
         N/A barbican_client N/A N/A self _get_barbican_client ctxt N/A N/A N/A secret_ref N/A N/A self _create_secret_ref key_id N/A N/A N/A N/A barbican_client secrets delete secret_ref N/A N/A N/A Exception N/A e N/A N/A N/A N/A excutils save_and_reraise_exception N/A N/A N/A N/A LOG error N/A _LE Error deleting key: %s e N/A N/A