-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
backendURL := esc.workspace.GetCurrentCloudURL(nil) | ||
|
||
nAccount, err := esc.login.Login( | ||
ctx, | ||
backendURL, | ||
false, | ||
"esc", | ||
"Pulumi ESC environments", | ||
nil, | ||
false, | ||
display.Options{Color: esc.colors}, | ||
) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excellent; thanks!
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix: #223
Add parity with the pulumi cli behavior supporting PULUMI_ACCESS_TOKEN and PULUMI_BACKEND_URL
I see the pulumi cli does an implicit login when it loads the backend
When ESC you have to explicitly login https://github.com/pulumi/esc/blob/4ce3ea5d470e475f1146e85cfcd7a75ea7516200/cmd/esc/cli/login.go#L82C29-L91
Added to that, ESC do not has parity on how the
backendURL
is calculated, relying on thePULUMI_BACKEND_URL