swh.vault.api.server module#

swh.vault.api.server.get_vault()[source]#
class swh.vault.api.server.VaultServerApp(*args, backend_class=None, backend_factory=None, **kwargs)[source]#

Bases: RPCServerApp

extra_type_decoders: Dict[str, Callable] = {'core_swhid': <bound method _BaseSWHID.from_string of <class 'swh.model.swhids.CoreSWHID'>>}#

Value of extra_decoders passed to json_loads or msgpack_loads to be able to deserialize more object types.

extra_type_encoders: List[Tuple[type, str, Callable]] = [(<class 'swh.model.swhids.CoreSWHID'>, 'core_swhid', <class 'str'>)]#

Value of extra_encoders passed to json_dumps or msgpack_dumps to be able to serialize more object types.

swh.vault.api.server.argument_error_handler(exception)[source]#
swh.vault.api.server.my_error_handler(exception)[source]#
swh.vault.api.server.index()[source]#
swh.vault.api.server.check_config(cfg: Dict[str, Any]) Dict[str, Any][source]#

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

Raises:
  • EnvironmentError if the configuration is not for postgresql instance

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

  • scheduler

Returns:

New configuration dict to instantiate a postgresql vault server instance.

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

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