Simple JWT Auth - All endpoints #96
Labels
Dev Reviewed
Reviewed by Tech Lead
Notify
Board trigger
PM Reviewed
Reviewed by Product Manager
QA Reviewed
Reviewed by Quality Assurance
QA
Issue requires QA collaboration
User Story - Business Need
Implement a simple JWT check. This is to allow our devs the ability to make requests to va-enp-api when it is deployed. For now, all endpoints will use the JWT auth. Future work will involve admin routes and refactoring authentication entirely.
User Story(ies)
As a VA Notify dev
I want only authenticated responses being processed
So that we remain secure, even in testing
Additional Info and Resources
FastAPI basically has a built in way to apply this to every route in a router with a parameter called dependencies.
Acceptance Criteria
APIRouter
in v2/v3 use thedependencies
parameter and Depends to specify the list/tuple of dependencies (only the auth method for now)ENP_TEMP_AUTH
env var to authenticate the JWTQA Considerations
Unauthenticated requests fail in a graceful way.
Potential Dependencies
ENP_TEMP_AUTH
SSM param needs to exist and the task definition needs to pull it in as a secret.Out of Scope
An infra ticket will add the env var to SSM
https://fastapi.tiangolo.com/advanced/security/oauth2-scopes/
The text was updated successfully, but these errors were encountered: