app.main module

app.main.lifespan(app)[source]

FastAPI lifespan context manager handling graceful shutdown.

Yields immediately on startup (no startup work needed) and, on shutdown, flushes the buffered DSL execution-log queue so a graceful stop does not drop pending audit rows. The flush is best-effort: failures are logged and swallowed so they never block shutdown.

Parameters:

app (FastAPI) – The application instance whose state may hold the dsl_execution_observer to flush.

app.main.get_project_data()[source]

Retrieves project data from the pyproject.toml file.

Returns:

dict – Project data from the toml file.

app.main.get_swagger_oauth_config()[source]

Builds Swagger UI OAuth init configuration from environment-based settings.

Returns:

dict – Swagger OAuth init configuration.

Return type:

dict

app.main.custom_openapi()[source]

Customizes the OpenAPI schema for the FastAPI application.

Returns:

dict – The customized OpenAPI schema.

app.main.get_git_commit_hash()[source]

Returns the current git commit hash, or “unknown” if not available.

Returns:

str – The current git commit hash, or “unknown” if not available.

Return type:

str