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

fix: Override sub with federated_claims.user_id when dex is used #20683

Merged
merged 26 commits into from
Jan 30, 2025

Conversation

aali309
Copy link
Contributor

@aali309 aali309 commented Nov 6, 2024

Fixes: #17908

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).
  • The title of the PR conforms to the Toolchain Guide
  • 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.
  • 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).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

Copy link

bunnyshell bot commented Nov 6, 2024

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

@aali309 aali309 force-pushed the ldap-rbac branch 9 times, most recently from 3f5b5c7 to dee232e Compare November 12, 2024 20:57
@aali309 aali309 force-pushed the ldap-rbac branch 2 times, most recently from eb08b64 to e374df5 Compare November 14, 2024 17:12
Copy link

codecov bot commented Nov 17, 2024

Codecov Report

Attention: Patch coverage is 61.60000% with 48 lines in your changes missing coverage. Please review.

Project coverage is 55.50%. Comparing base (6f5537b) to head (95f1e4e).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
util/session/sessionmanager.go 69.04% 10 Missing and 3 partials ⚠️
cmd/argocd/commands/project_role.go 0.00% 12 Missing ⚠️
server/server.go 31.25% 9 Missing and 2 partials ⚠️
cmd/argocd/commands/login.go 50.00% 5 Missing and 1 partial ⚠️
server/rbacpolicy/rbacpolicy.go 40.00% 2 Missing and 1 partial ⚠️
util/claims/claims.go 86.95% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #20683      +/-   ##
==========================================
- Coverage   55.59%   55.50%   -0.09%     
==========================================
  Files         339      340       +1     
  Lines       57346    57417      +71     
==========================================
- Hits        31881    31870      -11     
- Misses      22784    22847      +63     
- Partials     2681     2700      +19     

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

cmd/argocd/commands/utils/claims.go Outdated Show resolved Hide resolved
test/container/Dockerfile Outdated Show resolved Hide resolved
@aali309 aali309 marked this pull request as ready for review November 18, 2024 15:25
@aali309 aali309 requested a review from a team as a code owner November 18, 2024 15:25
@aali309 aali309 force-pushed the ldap-rbac branch 4 times, most recently from 4cf2359 to d131b41 Compare November 21, 2024 19:44
Copy link
Member

@ishitasequeira ishitasequeira left a comment

Choose a reason for hiding this comment

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

Overall code change looks good!!

@jannfis @pasha-codefresh do you see any concerns with the change?

@aali309 aali309 force-pushed the ldap-rbac branch 2 times, most recently from 4e8b021 to 1393382 Compare December 3, 2024 21:06
@agaudreault agaudreault self-requested a review December 4, 2024 05:17
Copy link
Member

@agaudreault agaudreault left a comment

Choose a reason for hiding this comment

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

The change from RegisterClaims to MapClaims makes this PR a lot more impactful and the blast radius is hard to grasp, especially that not the same claims seems to be added in the context object.

util/session/sessionmanager.go Outdated Show resolved Hide resolved
@aali309 aali309 force-pushed the ldap-rbac branch 3 times, most recently from 68b2da0 to df53a24 Compare December 12, 2024 04:09
Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
@agaudreault
Copy link
Member

Hey @aali309. Thanks for the changes. The logic look good. I will push some style refactor and changes to the unit tests so we can merge this in the next version 🚀 🎉

@agaudreault agaudreault merged commit 85c6d26 into argoproj:master Jan 30, 2025
26 checks passed
@aali309 aali309 deleted the ldap-rbac branch January 31, 2025 17:21
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.

RBAC using LDAP is not working (Not assigning the policies)
3 participants