The nova.keymgr.mock_key_mgr Module

A mock implementation of a key manager that stores keys in a dictionary.

This key manager implementation is primarily intended for testing. In particular, it does not store keys persistently. Lack of a centralized key store also makes this implementation unsuitable for use among different services.

Note: Instantiating this class multiple times will create separate key stores. Keys created in one instance will not be accessible from other instances of this class.

class MockKeyManager

Bases: nova.keymgr.key_mgr.KeyManager

This mock key manager implementation supports all the methods specified by the key manager interface. This implementation stores keys within a dictionary, and as a result, it is not acceptable for use across different services. Side effects (e.g., raising exceptions) for each method are handled as specified by the key manager interface.

This key manager is not suitable for use in production deployments.

copy_key(ctxt, key_id, **kwargs)
create_key(ctxt, **kwargs)

Creates a key.

This implementation returns a UUID for the created key. A Forbidden exception is raised if the specified context is None.

delete_key(ctxt, key_id, **kwargs)

Deletes the key identified by the specified id.

A Forbidden exception is raised if the context is None and a KeyError is raised if the UUID is invalid.

get_key(ctxt, key_id, **kwargs)

Retrieves the key identified by the specified id.

This implementation returns the key that is associated with the specified UUID. A Forbidden exception is raised if the specified context is None; a KeyError is raised if the UUID is invalid.

store_key(ctxt, key, **kwargs)

Stores (i.e., registers) a key with the key manager.

Previous topic

The nova.keymgr.key_mgr Module

Next topic

The nova.keymgr.not_implemented_key_mgr Module

Project Source

This Page