-
Notifications
You must be signed in to change notification settings - Fork 2
Factor out authentication #7
Copy link
Copy link
Open
Description
The currently only API endpoint in PIA cleanly separates authentication and business logic (SBOM upload), albeit in the same function.
Factoring out authentication improves readability, allows re-use of the authentication implementation for other endpoints, and has the potential to reject requests based on the header and before parsing the body.
Suitable features in FastAPI:
- Dependency Injection: does not allow request rejection before body parsing, but seems idiomatic for authentication
- Middleware: allows rejection before body parsing
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels