Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple JWT Auth - All endpoints #96

Open
5 of 7 tasks
k-macmillan opened this issue Dec 11, 2024 · 0 comments
Open
5 of 7 tasks

Simple JWT Auth - All endpoints #96

k-macmillan opened this issue Dec 11, 2024 · 0 comments
Assignees
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

Comments

@k-macmillan
Copy link
Member

k-macmillan commented Dec 11, 2024

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.

  • Ticket is understood, and QA has been contacted (if the ticket has a QA label).

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

  • The APIRouter in v2/v3 use the dependencies parameter and Depends to specify the list/tuple of dependencies (only the auth method for now)
  • Use the ENP_TEMP_AUTH env var to authenticate the JWT
  • Expire check for more than 60 seconds after creation
  • main.py routes removed or have authentication added other than the hello world route
  • Only one parameter for auth, and it is loaded in as a task definition secret
  • This work is added to the sprint review slide deck (key win bullet point and demo slide)

QA 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/

@k-macmillan k-macmillan added Dev Reviewed Reviewed by Tech Lead Notify Board trigger labels Dec 11, 2024
@cris-oddball cris-oddball added QA Reviewed Reviewed by Quality Assurance QA Issue requires QA collaboration labels Dec 12, 2024
@kbelikova-oddball kbelikova-oddball added the PM Reviewed Reviewed by Product Manager label Dec 12, 2024
@mchlwellman mchlwellman mentioned this issue Jan 2, 2025
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

5 participants