-
Notifications
You must be signed in to change notification settings - Fork 28
BB2-4294: Update fhir_ids on token refresh #1437
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
base: master
Are you sure you want to change the base?
Conversation
…omments for now to pass flake8
…ken-refresh-fhir-update' into brandon/BB2-4294-token-refresh-fhir-update
…still need to functional test this)
…ity of this ticket, added a TODO
| # Confirm fhir_id_v3 is None before calling the function | ||
| assert crosswalk.fhir_id_v3 is None | ||
|
|
||
| user, crosswalk_type = get_and_update_from_refresh(user_mbi, username, user_hicn_hash, mock_request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a test/want a test that asserts that the result of an update via each method produces the same result? E.g. something that calls one refresh, caches a result/value from the DB, then resets the DB (say, by nulling out the v3 id), calls the other refresh, and then compares the two? Or, because of how we mock things, is that redundant/not meaningful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By other refresh, do you mean the two ways we now call _get_and_update_user? I can write a test that calls get_and_update_user_from_initial_auth, then we modify some values, then call get_and_update_from_refresh and verify that the values have been updated correctly if we think that would be useful.
I don't think it's absolutely necessary as we have tests for both functions already, but happy to add the test if we want it.
JIRA Ticket:
BB2-4294
What Does This PR Do?
This PR ensures that both fhir_id_v2 and fhir_id_v3 are populated if null, or updated if the value in the DB is different than what is returned from BFD, on refresh token flow (this already happened on authorization flow).
What Should Reviewers Watch For?
If you're reviewing this PR, please check for these things in particular:
Validation
What Security Implications Does This PR Have?
Please indicate if this PR does any of the following:
security engineer's approval.
Any Migrations?
etc)