-
Notifications
You must be signed in to change notification settings - Fork 9
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
Feat: analytics for auth claims flow #2125
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
back-end
Django views, sessions, middleware, models, migrations etc.
deployment-dev
[auto] Changes that will trigger a deploy if merged to dev
tests
Related to automated testing (unit, UI, integration, etc.)
and removed
deployment-dev
[auto] Changes that will trigger a deploy if merged to dev
labels
May 29, 2024
lalver1
force-pushed
the
feat/analytics-oauth-claims
branch
from
May 29, 2024 22:37
36ca2eb
to
477edcb
Compare
angela-tran
reviewed
May 30, 2024
lalver1
force-pushed
the
feat/analytics-oauth-claims
branch
from
June 3, 2024 20:05
477edcb
to
b67a7b1
Compare
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
lalver1
force-pushed
the
feat/analytics-oauth-claims
branch
from
June 4, 2024 15:50
a10bafe
to
f3cba88
Compare
lalver1
force-pushed
the
feat/analytics-oauth-claims
branch
from
June 4, 2024 17:35
f3cba88
to
4b253c2
Compare
|
lalver1
force-pushed
the
feat/analytics-oauth-claims
branch
from
June 5, 2024 20:07
4b253c2
to
3efdc5b
Compare
thekaveman
requested changes
Jun 5, 2024
lalver1
force-pushed
the
feat/analytics-oauth-claims
branch
from
June 6, 2024 15:57
3efdc5b
to
75cfeb0
Compare
thekaveman
approved these changes
Jun 6, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #2049
How to test
To test the error condition, insert something like
claim_value = "20"
after line 73 inbenefits.oauth.views.authorize
. Then check that"error_code": 20
appears as a property of"event_properties"
in the log.Notes
The behavior originally described in these notes was fixed by #2127.
When running the testtest_authorize_success_without_verifier_claim
, the oauth middlewareVerifierUsesAuthVerificationSessionRequired
that decorates theauthorize
view seems to behave differently compared to debugging the application.Specifically, line 19 inbenefits/oauth/middleware.py
evaluates to a<Mock>
object if running the test, but it evaluates to a boolean if debugging the application.To see this behavior, debug the test and notice that line 19 evaluates to a<Mock>
object, so theif
condition evaluates toTrue
and returnsNone
instead of returning the user error page.However, when debugging the application and setting
claim
inAuthProvider
to blank (to simulate a missing verifier claim in the database), line 19 will evaluate toFalse
and the conditional will return the user error page.Also, seems likeverifier.auth_provider.claim = ""
in the test only setsverifier_claim = verifier.auth_provider.claim
(line 64 in the view). For a test closer to the behavior being tested, we may need to set theclaim
to blank in a fixture similar tomodel_AuthProvider_with_verification
.