Skip to content

Invalid APITALLY_CLIENT_ID causes all requests to fail #160

@alexbeattie42

Description

@alexbeattie42

Having an invalid client id with apitally middleware causes all fastapi requests to fail.

Reproduction

Using the following value will reproduce the issue:
APITALLY_CLIENT_ID="1234"

Issue

raise ValueError(f"invalid client_id '{client_id}' (expecting hexadecimal UUID format)")
ValueError: invalid client_id '1234' (expecting hexadecimal UUID format)

Throws this exception here:
https://github.com/apitally/apitally-py/blob/main/apitally/client/client_base.py#49

which is unhandled by the middleware stack here:
https://github.com/apitally/apitally-py/blob/main/apitally/starlette.py#L86

Solution

An invalid client id should be logged as an error, but not cause a 500 error which prevents any requests from being processed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions