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

Specify pulumi access token per command run #263

Merged
merged 3 commits into from
Mar 14, 2024
Merged

Conversation

glena
Copy link
Contributor

@glena glena commented Feb 28, 2024

@glena glena marked this pull request as ready for review March 6, 2024 15:07
cmd/esc/cli/login.go Outdated Show resolved Hide resolved
cmd/esc/cli/login.go Outdated Show resolved Hide resolved
Comment on lines +157 to +168
backendURL := esc.workspace.GetCurrentCloudURL(nil)

nAccount, err := esc.login.Login(
ctx,
backendURL,
false,
"esc",
"Pulumi ESC environments",
nil,
false,
display.Options{Color: esc.colors},
)
Copy link
Member

Choose a reason for hiding this comment

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

I think the only remaining question I have is what the experience is like if no access token is specified via PULUMI_ACCESS_TOKEN? If we fall through to the err != nil case below I think that we'll be regressing the UX, as the user will see could not determine current cloud instead of no credentials. Please run esc login to log in.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is the same experience you have with the pulumi cli where it asks you to authenticate

image image

Copy link
Member

Choose a reason for hiding this comment

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

excellent; thanks!

Copy link
Member

Choose a reason for hiding this comment

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

what about in non-interactive scenarios?

Copy link
Member

Choose a reason for hiding this comment

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

(try running with the output redirected, for example)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the output
image

@glena glena requested a review from pgavlin March 13, 2024 11:40
@glena glena merged commit 3484c0a into pulumi:main Mar 14, 2024
6 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.

Specify pulumi access token per command run
2 participants