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

Added Oauth2/Keycloak configs, decorators #56

Merged
merged 2 commits into from
Feb 12, 2024

Conversation

jcadam14
Copy link
Contributor

@jcadam14 jcadam14 commented Feb 5, 2024

Closes #46

  • Updated config.py to pull in KeycloakSettings
  • Updated the main.py to instantiate the OAuth2AuthorizationCodeBearer (based on keycloak settings) and setup the FastAPI/Starlette authentication middleware
  • Added @requires("authenticated") to our two current GETs
  • Added pytest mocks and functions to be able to test unauth'd and auth'd GETs

@jcadam14 jcadam14 linked an issue Feb 5, 2024 that may be closed by this pull request
@jcadam14 jcadam14 self-assigned this Feb 5, 2024
Copy link

github-actions bot commented Feb 5, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src
  config.py
  main.py
  src/entities/engine
  engine.py
  src/routers
  filing.py
Project Total  

This report was generated by python-coverage-comment-action

pyproject.toml Outdated
Comment on lines 54 to 57
"INST_DB_USER=user",
"INST_DB_PWD=user",
"INST_DB_HOST=localhost:5432",
"INST_DB_NAME=filing"
"INST_DB_NAME=filing",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should've probably caught this in one of the earlier PRs, the INST_ prefix was meant for the institutions database; at that time in the user-fi module, I was thinking we may need to interact with more than just one db, thus the prefix to differentiate; since we're pretty much in the one db for the app paradigm, we can probably drop the prefix; or change it to probably the FILING_ prefix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha I thought it meant "instance" like DB instance lol. Will update to drop the prefix

Copy link
Contributor Author

@jcadam14 jcadam14 Feb 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok updated, and wrote the following stories to update in docker-deploy and helm chart files, respectively:
cfpb/sbl-project#131
Issue 42 in EKS repo

@jcadam14 jcadam14 requested a review from lchen-2101 February 8, 2024 22:47
Copy link
Collaborator

@lchen-2101 lchen-2101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lchen-2101 lchen-2101 merged commit 700d005 into main Feb 12, 2024
3 checks passed
@lchen-2101 lchen-2101 deleted the 46-add-oauth2-calls-to-filing-api branch February 12, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add oauth2 calls to filing-api
2 participants