SyncApiProvider: also retry when the Retry-After response header is missing.
ApiProvider: (sync and async) retry on all methods except POST.
ApiProvider: (sync and async) retry on 429, 500, 502, 503, 504.
Use a timeout for fetching jwks in TokenVerifier.
Changed celery task logger args/kwargs back to argsrepr/kwargsrepr.
Sanitize error responses.
Remove 501 error response on NotImplementedError.
Solved aiohttp 'Unclosed client session' warning.
Revert changes done in 0.9.1 in CCTokenGateway.
Added CCTokenGateway.fetch_headers()
Added optional 'headers' parameter to ApiProvider.
Renamed 'fetch_token' parameter in api client to 'headers_factory' and made it optional.
Added 'headers_factory' to upload/download functions.
Allow 201 "CREATED" status code in upload_file.
Manage.update now automatically retries if a Conflict is raised.
AlreadyExists is not a subclass of Conflict anymore.
Skip health check access logs.
Fix access logging of correlation id.
Workaround celery issues with message headers: use the body (kwargs) instead.
Automatically dump and restore correlation_id in dramatiq actors.
Fixed logging of correlation_id in fastapi access logger.
Add correlation_id to logging and accept X-Correlation-Id header in fastapi service.
Add SyncFluentbitGateway
.
Log the nanosecond-precision "time" instead of the second-precision logtime
in [Sync]FluentbitGateway
.
Disable the default multipart encoding in SyncApiProvider
.
Added file
parameter to ApiProvider
to upload files (async is a TODO).
trailing_slash
option to ApiProvider
.Adapt call signature of the fetch_token
callable in ApiProvider
.
Add clean_python.oauth.client_credentials
.
Fix blocking behaviour of fetch_token
in ApiProvider
.
Fix missing api_client.Response
.
Added async ApiProvider
and ApiGateway
.
Added request_raw
to ApiProvider
for handling arbitrary responses.
Repository
subclasses.Mapper
type use it in SyncApiGateway.mapper
.SyncApiProvider
.SyncApiGateway
and made it compatible with urllib==1.*
.Added SyncGateway
, SyncRepository
, and InMemorySyncGateway
.
Added optional api_client
subpackage (based on urllib3
).
Added fastapi_profiler
and renamed existing profiler
to dramatiq_profiler
.
Added S3Gateway.remove_filtered
.
Added clean_python.s3.KeyMapper
.
Adapt InternalGateway
so that it derives from Gateway
.
Renamed the old InternalGateway
to TypedInternalGateway
.
Added SQLDatabase.truncate_tables()
.
InternalGateway.update
.responses
via route_options.execute
in SQLProvider
,
SQLDatabase
and SQLTransaction
.Don't use environment variables in setup_debugger.
Add Id type (replaces int), it can also be a string.
Added S3Gateway.
Reinstate static type linter (mypy).
SQLDatabase.create_extension()
.TokenVerifier.force()
for testing purposes.Add scope
kwarg to http_method decorators (get, post, etc.)
Moved the Context
(ctx
) to clean_python.base
and changed its attributes to
path
, user
and tenant
.
The SQLGateway
can now be constructed with multitenant=True
which makes it
automatically filter the tenant
column with the current ctx.tenant
.
Add HTTP Bearer to OpenAPI security schema.
Import debugpy at module level on setup_debugger import. Don't check for DEBUG environment variable when setting up.
Pydantic 2.x support. Drops Pydantic 1.x support, use 0.1.x for Pydantic 1.x. See https://docs.pydantic.dev/latest/migration/
BadRequest
is a subclass of Exception
instead of ValidationError
/ ValueError
.
oauth2.OAuth2Settings
is split into two new objects: TokenVerifierSettings
and
OAuth2SPAClientSettings
. The associated call signature of Service
was changed.
Various import fixes.
Avoid inject==5.* because of its incompatibility with VS Code (pylance / pyright).
Initial project structure created with cookiecutter and cookiecutter-python-template.
Ported base functions from internal raster-service project.