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

Refactor: AuthProvider to ClaimsProvider #2256

Merged
merged 9 commits into from
Aug 5, 2024
Merged

Conversation

angela-tran
Copy link
Member

@angela-tran angela-tran commented Jul 31, 2024

Closes #2233 - see Acceptance Criteria on that ticket.

Testing locally

  1. Checkout the main branch
  2. Make sure your local_fixtures.json (or whatever fixture you are using) has an AuthProvider and an EligiblityVerifier that has a foreign key reference to that auth provider
  3. Run bin/reset_db.sh (now your local DB mirrors the structure of the dev environment)
  4. Checkout this PR's branch
  5. Run bin/init.sh (running this PR's migration on top of existing DB structure)
  • For all EligibilityVerifiers that with a reference to an AuthProvider, confirm those references were maintained, only now the field is called "Claims provider" in the admin interface, claims_provider in the database
  • Confirm the Can X auth provider permissions are removed from the database
  • Confirm the Can X claims provider permissions are added to the database
  • Confirm the Cal-ITP group has Can [view|change] claims provider permissions
  • Flows using claims from IdG should still work

@angela-tran angela-tran added this to the Admin tool: agency users milestone Jul 31, 2024
@angela-tran angela-tran self-assigned this Jul 31, 2024
@github-actions github-actions bot added documentation [auto] Improvements or additions to documentation deployment-dev [auto] Changes that will trigger a deploy if merged to dev tests Related to automated testing (unit, UI, integration, etc.) migrations [auto] Review for potential model changes/needed data migrations updates back-end Django views, sessions, middleware, models, migrations etc. and removed documentation [auto] Improvements or additions to documentation tests Related to automated testing (unit, UI, integration, etc.) labels Jul 31, 2024
Copy link

Copy link

github-actions bot commented Jul 31, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  benefits/core
  admin.py
  context_processors.py
  middleware.py
  models.py
  benefits/eligibility
  verify.py
  views.py
  benefits/enrollment
  views.py
  benefits/oauth
  analytics.py
  middleware.py
  views.py
Project Total  

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

@angela-tran angela-tran marked this pull request as ready for review August 2, 2024 23:18
@angela-tran angela-tran requested a review from a team as a code owner August 2, 2024 23:18
@angela-tran
Copy link
Member Author

Ready for review

@angela-tran
Copy link
Member Author

Not sure if this one (authentication providers) needs to be updated and/or what the right wording would be.

`benefits` is a [Django 5][django] web application. The application talks to one or more [Eligibility Verification APIs](https://docs.calitp.org/eligibility-api/specification) or authentication providers. These APIs and the application itself are

@thekaveman
Copy link
Member

Not sure if this one (authentication providers) needs to be updated and/or what the right wording would be.

`benefits` is a [Django 5][django] web application. The application talks to one or more [Eligibility Verification APIs](https://docs.calitp.org/eligibility-api/specification) or authentication providers. These APIs and the application itself are

I think claims providers here is fine?

Copy link
Member

@lalver1 lalver1 left a comment

Choose a reason for hiding this comment

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

The code changes look good! These were verified:

  • For all EligibilityVerifiers that with a reference to an AuthProvider, confirm those references were maintained, only now the field is called "Claims provider" in the admin interface, claims_provider in the database
  • Confirm the Can X auth provider permissions are removed from the database
  • Confirm the Can X claims provider permissions are added to the database
  • Confirm the Cal-ITP group has Can [view|change] claims provider permissions
  • Flows using claims from IdG should still work

Just saw a minor typo in oauth.md.


The [data migration file](./data.md) contains sample values for an `AuthProvider` configuration. You can set values for a real Open ID Connect provider in environment variables so that they are used instead of the sample values.
The [data migration file](./data.md) contains sample values for an `ClaimsProvider` configuration. You can set values for a real Open ID Connect provider in environment variables so that they are used instead of the sample values.
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, tiny typo, maybe change:

an ClaimsProvider

to

a ClaimsProvider

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! Made that change in ee3df8ec

Copy link
Member

@thekaveman thekaveman left a comment

Choose a reason for hiding this comment

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

This looks great 👍 !!!

@angela-tran
Copy link
Member Author

Thanks for the reviews!

@angela-tran angela-tran merged commit 9ce852c into main Aug 5, 2024
17 checks passed
@angela-tran angela-tran deleted the refactor/claimsprovider branch August 5, 2024 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-end Django views, sessions, middleware, models, migrations etc. deployment-dev [auto] Changes that will trigger a deploy if merged to dev migrations [auto] Review for potential model changes/needed data migrations updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Model refactor: AuthProvider
3 participants