Skip to content

Conversation

@PaleHazy
Copy link
Contributor

@PaleHazy PaleHazy commented Apr 24, 2025

Closes #22738

I updated the login and relogin command to have the ability to overwrite the callback scheme, host and port as one flag for the local server

this is necessary for some environments that are not the local machine and need to be redirected elsewhere from the idp.

I did not see any unit tests that were testing changing the port so I figured this would be fine. I can add some if there is a want for the callback validation

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).

@PaleHazy PaleHazy requested a review from a team as a code owner April 24, 2025 21:10
@bunnyshell
Copy link

bunnyshell bot commented Apr 24, 2025

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

@PaleHazy
Copy link
Contributor Author

I am not sure if I should change

bindAddr := net.JoinHostPort(host, strconv.Itoa(port))
oauth2conf.RedirectURL = fmt.Sprintf("http://%s/auth/callback", bindAddr)

...

srv := &http.Server{Addr: bindAddr}

to actually bind to localhost instead hardcoded

...

srv := &http.Server{Addr: net.JoinHostPort("localhost", strconv.Itoa(port))}

@codecov
Copy link

codecov bot commented Apr 24, 2025

Codecov Report

❌ Patch coverage is 36.36364% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.42%. Comparing base (f4c4c66) to head (9584283).
⚠️ Report is 14 commits behind head on master.

Files with missing lines Patch % Lines
cmd/argocd/commands/login.go 25.00% 6 Missing ⚠️
cmd/argocd/commands/relogin.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #22784      +/-   ##
==========================================
- Coverage   60.46%   60.42%   -0.05%     
==========================================
  Files         350      350              
  Lines       60105    60113       +8     
==========================================
- Hits        36345    36325      -20     
- Misses      20828    20849      +21     
- Partials     2932     2939       +7     

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

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.

LGTM. You need to run make codegen-local to generate the docs

@agaudreault agaudreault enabled auto-merge (squash) September 12, 2025 21:10
Signed-off-by: Alexandre Gaudreault <[email protected]>
auto-merge was automatically disabled September 12, 2025 21:36

Head branch was pushed to by a user without write access

@PaleHazy PaleHazy requested a review from a team as a code owner September 12, 2025 21:36
@agaudreault agaudreault merged commit 3af3a05 into argoproj:master Sep 15, 2025
28 checks passed
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.

Ability to set callback/redirect URL on sso login flow from CLI

2 participants