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

feat: fetch & cache groups from UserInfo Endpoint #12062

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

the-technat
Copy link
Contributor

@the-technat the-technat commented Jan 20, 2023

Second try with a new approach to fix #8272 using a server-side approach. Every time the user does a request with it's OIDC token, argocd-server fetches the user's group information from the UserInfo endpoint (if enabled). The UserInfo response is cached (by default until the OIDC token expires) to avoid unneccesary requests/traffic.

For review some things to point out:

  • I've tested this locally using standalone dex
  • I've tested this inside @swisspost's development environment with our IDP

Closes #8272

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

@the-technat the-technat force-pushed the feature/server-side-groups-store branch from beabd86 to 6c382e8 Compare January 20, 2023 16:11
@the-technat the-technat changed the title Enhancement: fetch & cache groups from UserInfo Endpoint feat: fetch & cache groups from UserInfo Endpoint Jan 20, 2023
@the-technat the-technat force-pushed the feature/server-side-groups-store branch 2 times, most recently from 4afd686 to 52d5839 Compare January 20, 2023 16:36
@codecov
Copy link

codecov bot commented Jan 20, 2023

Codecov Report

Attention: 98 lines in your changes are missing coverage. Please review.

Comparison is base (6ede1a8) 49.55% compared to head (72885b9) 49.53%.

Files Patch % Lines
util/oidc/oidc.go 47.01% 59 Missing and 12 partials ⚠️
util/settings/settings.go 14.28% 18 Missing ⚠️
server/server.go 59.09% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12062      +/-   ##
==========================================
- Coverage   49.55%   49.53%   -0.02%     
==========================================
  Files         269      269              
  Lines       47039    47215     +176     
==========================================
+ Hits        23310    23389      +79     
- Misses      21443    21528      +85     
- Partials     2286     2298      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@the-technat the-technat force-pushed the feature/server-side-groups-store branch 22 times, most recently from 30c49f7 to 081e72e Compare January 27, 2023 06:51
@the-technat the-technat force-pushed the feature/server-side-groups-store branch from 081e72e to 8d86e43 Compare January 30, 2023 10:29
@the-technat the-technat marked this pull request as draft January 30, 2023 12:54
@the-technat the-technat force-pushed the feature/server-side-groups-store branch from 8d86e43 to d9f94d9 Compare January 31, 2023 06:52
@the-technat the-technat force-pushed the feature/server-side-groups-store branch 2 times, most recently from 5fa9e65 to 502d932 Compare September 6, 2023 09:01
@the-technat the-technat force-pushed the feature/server-side-groups-store branch from 502d932 to 13f81ac Compare September 21, 2023 06:25
@the-technat the-technat requested review from a team as code owners September 21, 2023 06:25
@the-technat the-technat force-pushed the feature/server-side-groups-store branch 4 times, most recently from 0d72f89 to 69be24c Compare September 28, 2023 07:10
@the-technat the-technat force-pushed the feature/server-side-groups-store branch 3 times, most recently from 96d4fa5 to c8413ba Compare October 12, 2023 18:58
Copy link
Member

@jannfis jannfis left a comment

Choose a reason for hiding this comment

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

LGTM so far, just some minor things. Please address them, then I'll merge the PR :)

util/oidc/oidc.go Outdated Show resolved Hide resolved
util/oidc/oidc.go Show resolved Hide resolved
util/oidc/oidc.go Outdated Show resolved Hide resolved
util/oidc/oidc.go Outdated Show resolved Hide resolved
util/oidc/oidc.go Outdated Show resolved Hide resolved
@the-technat the-technat force-pushed the feature/server-side-groups-store branch 5 times, most recently from c5cbd3b to 3497aac Compare November 17, 2023 16:05
@the-technat the-technat force-pushed the feature/server-side-groups-store branch from 3497aac to 72885b9 Compare November 17, 2023 16:16
Copy link
Member

@jannfis jannfis left a comment

Choose a reason for hiding this comment

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

LGTM! 🎉

@jannfis
Copy link
Member

jannfis commented Nov 21, 2023

Again, please accept my apologies for the delayed review cycles. Thanks so much for contributing this! ❤️

@jannfis jannfis merged commit 819f0b3 into argoproj:master Nov 21, 2023
25 checks passed
@the-technat the-technat deleted the feature/server-side-groups-store branch November 21, 2023 20:49
alexymantha pushed a commit to alexymantha/argo-cd that referenced this pull request Nov 22, 2023
filiprafaj pushed a commit to filiprafaj/argo-cd that referenced this pull request Nov 23, 2023
vladfr pushed a commit to vladfr/argo-cd that referenced this pull request Dec 13, 2023
tesla59 pushed a commit to tesla59/argo-cd that referenced this pull request Dec 16, 2023
lyda pushed a commit to lyda/argo-cd that referenced this pull request Mar 28, 2024
Hariharasuthan99 pushed a commit to AmadeusITGroup/argo-cd that referenced this pull request Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

Optionally query OIDC UserInfo to gather group claims
3 participants