swh.vault.api.server module

swh.vault.api.server.get_vault(config: Optional[Dict[str, Any]] = None)swh.vault.interface.VaultInterface[source]
class swh.vault.api.server.VaultServerApp(app_name: Optional[str] = None, backend_class: Optional[Callable] = None, backend_factory: Optional[Union[Callable, str]] = None, middlewares=(), **kwargs)[source]

Bases: MutableMapping[str, Any]

client_exception_classes: Tuple[Type[Exception], ] = (<class 'swh.vault.exc.NotFoundExc'>,)
swh.vault.api.server.check_config(cfg: Dict[str, Any]) → Dict[str, Any][source]

Ensure the configuration is ok to run a local vault server, and propagate defaults.

  • EnvironmentError if the configuration is not for local instance

  • ValueError if one of the following keys is missing – vault, cache, storage,

  • scheduler


New configuration dict to instantiate a local vault server instance.

swh.vault.api.server.make_app(config: Dict[str, Any])swh.vault.api.server.VaultServerApp[source]

Ensure the configuration is ok, then instantiate the server application

swh.vault.api.server.make_app_from_configfile(config_path: Optional[str] = None, **kwargs)swh.vault.api.server.VaultServerApp[source]

Load and check configuration if ok, then instantiate (once) a vault server application.