common.application_layer.rest_api package

Subpackages

Submodules

common.application_layer.rest_api.routes module

common.application_layer.rest_api.routes.auth_routes(config: Configurator)

server routes for authentication (and jwt’s) :param config: Pyramid server config object

common.application_layer.rest_api.routes.by_id_routes(config: Configurator)

Routes for accessing objects by ID

common.application_layer.rest_api.routes.default_routes(config: Configurator)

Uncategorized server routes

Parameters:

config – Pyramid server config object

common.application_layer.rest_api.routes.gbo_calculator_routes(config: Configurator)

routes for accessing GBO Sensitivity Calculator API through TTAT wrapper service :param config: Pyramid server config object

common.application_layer.rest_api.routes.includeme(config: Configurator)

Function that gets included in server.py:main(); calls all route adding functions

Parameters:

config – Pyramid server config object

common.application_layer.rest_api.server module

common.application_layer.rest_api.tweens module

common.application_layer.rest_api.tweens.error_logger_tween_factory(handler, registry)
common.application_layer.rest_api.tweens.get_user_info(request)
common.application_layer.rest_api.tweens.logger_tween_factory(handler, registry)

Module contents

common.application_layer.rest_api.get_entity(entity_id: str | int, sub_repo: SubRepository[C]) → C

Get an entity from the db :param entity_id: The identifying key for the entity to retrieve. :param sub_repo: SubRepository to retrieve the entity from :return: The entity identified by id :raises: NameError if id is bad

ValueError if sub_repo doesn’t contain an entity identified by id

common.application_layer.rest_api.get_entity_404(request, entity_id: int, entity_type: type[C]) → C
common.application_layer.rest_api.make_expected_params_message(expected_keys: list[str], actual_keys: KeysView[str])

Generate a message about which keys from the expected set are missing, and which from the actual set are wrongly included.

Parameters:
  • expected_keys – The keys which are expected to exist

  • actual_keys – The keys which were actually provided

Returns:

A string message about what went wrong here