Patch gem for id.me. Fix unit, system and integration tests to align with new data model changes.#3018
Patch gem for id.me. Fix unit, system and integration tests to align with new data model changes.#3018manojwadhwa81 wants to merge 132 commits into
Conversation
… into jd/dpc-5127-multiple-oidc
| @@ -100,8 +100,9 @@ def renew | |||
| end | |||
|
|
|||
| def set_idp_token | |||
There was a problem hiding this comment.
should this method take the csp as a param?
| csp_user = CspUser.find_or_create_by!(user: @user, csp: csp, uuid: user_info['sub']) | ||
|
|
||
| # Update emails based upon the latest information in user info. | ||
| new_emails = user_info['all_emails'] || user_info['emails'] || user_info['emails_confirmed'] |
There was a problem hiding this comment.
can this be a separate method? like
def fetch_user_emails(user_info)
user_info['all_emails'] || user_info['emails'] || user_info['emails_confirmed']
end
There was a problem hiding this comment.
Yes, but i'd like to take a step further and normalize responses into one structure e.g DPCUserInfo, so as to centralize translation and consumer access. This would be an extension of the work we discussed in today's call for creating DPCSession/CSPSession.
| def ial_2_actions(user, auth) | ||
| data = auth.extra.raw_info | ||
|
|
||
| return unless data.ial == 'http://idmanagement.gov/ns/assurance/ial/2' |
There was a problem hiding this comment.
are the only possible values 1 and 2?
There was a problem hiding this comment.
Yes, based upon what i know. IAL1 is primarily self attestation, and with the right configuration, we can ask only IAL2 responses to be sent back to us and others will land up in the error queue.
🎫 Ticket
https://jira.cms.gov/browse/DPC-5371
🛠 Changes
Added new query methods to User model to centralize logic sprinkled elsewhere in code
New helper methods added to LoginSupport
Update test cases to a) Use new helper methods b) Set-up data as needed to synch up with new changes in InvitationController and LoginDotGov Controller
Add email / deactivate email in registration flow.
ℹ️ Context
This PR covers the area at the intersection of multiple stores e.g. DPC-5371, DPC-5368, DPC-5372.
It updates all the test cases that were previously left untouched due to overlaps of the work done by different team members.
🧪 Validation
Updated all the test cases to a) synch with new models and b) test new conditions