Skip to content

Patch gem for id.me. Fix unit, system and integration tests to align with new data model changes.#3018

Open
manojwadhwa81 wants to merge 132 commits into
mainfrom
mw/handle-userinfo-jwt
Open

Patch gem for id.me. Fix unit, system and integration tests to align with new data model changes.#3018
manojwadhwa81 wants to merge 132 commits into
mainfrom
mw/handle-userinfo-jwt

Conversation

@manojwadhwa81
Copy link
Copy Markdown

🎫 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

@manojwadhwa81 manojwadhwa81 requested a review from a team as a code owner May 28, 2026 15:14
@manojwadhwa81 manojwadhwa81 changed the title Add helper methods to User model and LoginSupport. Updated test cases for model changs Patch gem for id.me. Fix unit, system and integration tests to align with new data model changes. May 29, 2026
@@ -100,8 +100,9 @@ def renew
end

def set_idp_token
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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']
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

are the only possible values 1 and 2?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

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.

3 participants