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

Update the UAA-based login flow to discover org id #815

Merged
merged 2 commits into from
Sep 25, 2024

Conversation

vuil
Copy link
Contributor

@vuil vuil commented Sep 24, 2024

best case effort to retrieve org name/id from the metadata file from a predetermined URL.

Env vars to support setting of these values are still supported as a fallback.

What this PR does / why we need it

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

  1. Updated and ran unit tests.

  2. Verify that tanzu login to a uaa-based endpoint retrieves the org id:


> tanzu login --endpoint https://some.tpsm.host --insecure-skip-tls-verify
[i] Opening the browser window to complete the login
Log in by visiting this link:

    https://some.tpsm.host/auth/oauth/authorize?client_id=tp_cli_app&code_challenge=hKNsxxxx&code_challenge_method=S256&redirect_uri=http%3A%2F%2F127.0.0.1%3A62785%2Fcallback&response_type=code&state=c5f12xxxxx

    Optionally, paste your authorization code: [...]


[ok] Successfully logged in to 'https://some.tpsm.host' and created a tanzu context
> tanzu context current
  Name:            tpsm-4b01bf5c
  Type:            tanzu
  Organization:    Tanzu Platform Self Managed (703dde2e-12df-41c4-af07-153989894d1d)
  Project:         none set
  Kube Config:     /Users/foo/.config/tanzu/kube/config
  Kube Context:    tanzu-cli-tpsm-4b01bf5c
tanzu-cli (discover-sm-org)> grep 703dde2e-12df-41c4-af07-153989894d1d /Users/foo/.config/tanzu/kube/config
    server: https://some.tpsm.host/org/703dde2e-12df-41c4-af07-153989894d1d

Release note

Streamline UAA-based Tanzu Platform login to not require Org ID

Additional information

Special notes for your reviewer

@vuil vuil requested a review from a team as a code owner September 24, 2024 22:37
best case effort to retrieve org name/id from the metadata file from a
predetermined URL.

Env vars to support setting of these values are still supported as a
fallback.
Copy link
Contributor

@prkalle prkalle left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

Copy link
Contributor

@anujc25 anujc25 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks

Copy link
Contributor

@prkalle prkalle left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@anujc25 anujc25 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks

pkg/command/context.go Outdated Show resolved Hide resolved
@vuil vuil merged commit 9294e28 into vmware-tanzu:main Sep 25, 2024
7 checks passed
@marckhouzam marckhouzam added this to the v1.5.0 milestone Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants