oso.framework.entrypoint namespace

Submodules

oso.framework.entrypoint.component module

Component Entrypoint.

class oso.framework.entrypoint.component.ComponentConfig(*, entry: ImportString)[source]

Bases: AutoLoadConfig

Require an entrypoint.

entry

The python import string that points to the function returning a flask.Flask application, or the instance itself.

Type:

pydantic.ImportString, envvar=APP__ENTRY

class oso.framework.entrypoint.component.Entry(options: Any)[source]

Bases: BaseApplication

Main Application Entry.

cfg

Gunicorn’s configuration set.

Type:

gunicorn.config.Config

options

Cached rendered configuration.

Type:

typing.Any

Parameters:

options (typing.Any) – The parsed configuration.

load_config()[source]

This method is used to load the configuration from one or several input(s). Custom Command line, configuration file. You have to override this method in your class.

class oso.framework.entrypoint.component.GunicornConfig(*, workers: Annotated[int, Gt(gt=0)] = 1, timeout: Annotated[int, Ge(ge=0)] = 0, logger_class: str = 'oso.framework.entrypoint.component.JsonGunicornLogger')[source]

Bases: AutoLoadConfig

Common Gunicorn configuration.

workers

Number of workers gunicorn should utilize.

Type:

int, default=1, envvar=GUNICORN__WORKERS

timeout

Timeout in seconds, with 0 being infinite.

Type:

int, default=0, envvar=GUNICORN__TIMEOUT

logger_class

Logger type to use for Gunicorn. Defaults to a structured logging class with the same configuration as main application.

Type:

str, default=`.JsonGunicornLogger`, envvar=GUNICORN__LOGGER_CLASS

class oso.framework.entrypoint.component.JsonGunicornLogger(cfg)[source]

Bases: Logger

Use the format of the main application’s structured logs.

oso.framework.entrypoint.component.main() None[source]

Entrypoint.

oso.framework.entrypoint.mock module

Mock IBM Offline Signing Orchestrator Flow.

class oso.framework.entrypoint.mock.MockOSO(config)[source]

Bases: object

Define a mock that mocks an iteration.

iteration(e1: str, e2: str)[source]

Run a mock iteration. e1 -> e2.

phase1()[source]

Run a mock iteration. FE -> BE.

phase2()[source]

Run a mock iteration. BE -> FE.

oso.framework.entrypoint.mock.main()[source]

Entrypoint.

oso.framework.entrypoint.nginx module

Nginx Entrypoint.

class oso.framework.entrypoint.nginx.NginxConfig(*, timeout: timedelta = datetime.timedelta(seconds=60))[source]

Bases: AutoLoadConfig

Exposed Nginx Configuration.

timeout

Controls Nginx timeout.

Type:

datetime.timedelta, default=60s, envvar=NGINX__TIMEOUT

oso.framework.entrypoint.nginx.access_logs(fifo: PosixPath) None[source]

Nginx Access Logs.

Convert access logs into structured logs. The format is set by the generated nginx configuration in the format of KEY=VALUE pairs, separated by tablines.

oso.framework.entrypoint.nginx.main() None[source]

Entrypoint.

oso.framework.entrypoint.nginx.nginx_logs(fifo: PosixPath) None[source]

Nginx Logs.

Routine to parse nginx logs into structured logs. Nginx logs are in the format of:

DATE TIME [LEVEL] THREAD: EVENT, META_KEY: META_VALUE, ...