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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

aali309
Copy link

@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 stopped on Bunnyshell

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔵 /bns:start to start the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove 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 76.05634% with 17 lines in your changes missing coverage. Please review.

Please upload report for BASE (master@6d8d32f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
util/session/sessionmanager.go 68.18% 11 Missing and 3 partials ⚠️
cmd/argocd/commands/project_role.go 0.00% 1 Missing ⚠️
server/server.go 0.00% 1 Missing ⚠️
util/oidc/oidc.go 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #20683   +/-   ##
=========================================
  Coverage          ?   55.19%           
=========================================
  Files             ?      325           
  Lines             ?    55290           
  Branches          ?        0           
=========================================
  Hits              ?    30515           
  Misses            ?    22158           
  Partials          ?     2617           

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

Comment on lines 9 to 10
if federatedClaims, ok := claims["federated_claims"].(map[string]interface{}); ok {
if userID, exists := federatedClaims["user_id"].(string); exists && userID != "" {
Copy link
Member

Choose a reason for hiding this comment

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

nit: move the values "federated_claims", "user_id", "sub" to constants.

@@ -8,7 +8,7 @@ RUN ln -s /usr/lib/$(uname -m)-linux-gnu /usr/lib/linux-gnu
# Please make sure to also check the contained yarn version and update the references below when upgrading this image's version
FROM docker.io/library/node:22.9.0@sha256:69e667a79aa41ec0db50bc452a60e705ca16f35285eaf037ebe627a65a5cdf52 as node

FROM docker.io/library/golang:1.23.3@sha256:d56c3e08fe5b27729ee3834854ae8f7015af48fd651cd25d1e3bcf3c19830174 as golang
FROM docker.io/library/golang:1.23.1@sha256:4f063a24d429510e512cc730c3330292ff49f3ade3ae79bda8f84a24fa25ecb0 as golang
Copy link
Member

Choose a reason for hiding this comment

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

Is this downgrade on purpose or the PR just needs a rebase?

Copy link
Author

Choose a reason for hiding this comment

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

Yes did it on purpose when testing virtually, I forgot to revert.

Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
…#20700)"

This reverts commit cc7c21e.

Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
@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
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)
2 participants