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

Add tests for EntraID's specific GetUserInfo #415

Merged
merged 5 commits into from
Mar 17, 2025
Merged

Conversation

denisonbarbosa
Copy link
Member

@denisonbarbosa denisonbarbosa commented Feb 28, 2025

We were lacking tests for the MSEntraID's GetUserInfo function. Now we properly test the groups parsing and filtering.

UDENG-6033

@denisonbarbosa denisonbarbosa force-pushed the entraid-grps-tests branch 3 times, most recently from 1337b92 to db784e2 Compare February 28, 2025 12:29
@denisonbarbosa denisonbarbosa marked this pull request as ready for review February 28, 2025 12:34
@denisonbarbosa denisonbarbosa requested a review from a team as a code owner February 28, 2025 12:34
Copy link
Contributor

@adombeck adombeck left a comment

Choose a reason for hiding this comment

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

Excellent work!

Since we only care about the .Claims() method in the ID Token, we can
switch to using a interface in the providers definitions so we can mock
an ID token in the tests.
We used to parse it only when needed, but that created some issues when
testing it, since the https protocol could not be overriden and we don´t
want to install certificates when running tests.
This would panic if the group did not have a displayName. It's unlikely
to happen often (if it happens at all), but we should cover this
possibility nonetheless.
This is mainly focused on mocking the groups endpoint, but we could
extend it later if necessary.
@denisonbarbosa denisonbarbosa merged commit b5c6def into main Mar 17, 2025
4 checks passed
@denisonbarbosa denisonbarbosa deleted the entraid-grps-tests branch March 17, 2025 13:54
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