pulumi/pkg/backend
Thomas Gummerer 76abb5c14c
prefer environment over config for PULUMI_ACCESS_TOKEN (#16970)
The common order of priority for configuration is (in descending order
of priority):
- command line flags
- environment variables
- configuration

When a user uses the `PULUMI_ACCESS_TOKEN` environment variable, we also
currently save this to a configuration file. While it could be
considered somewhat questionable writing the secret in the environment
variable to disk in the first place, it is somewhat likely that users
rely on that behaviour and we don't want to change that.

However it is also very confusing to users that if they change the
`PULUMI_ACCESS_TOKEN` environment variable that we still keep re-using
the access token that is already stored in the configuration. It could
potentially be considered a breaking to prefer the `PULUMI_ACCESS_TOKEN`
variable over the access token set in the configuration. However setting
the `PULUMI_ACCESS_TOKEN` to something different is an explicit action,
and users are very unlikely to expect the token from the configuration
file to be used at this point.

Make the configuration in the environment variable the priority to be
less surprising to users.

Fixes https://github.com/pulumi/pulumi/issues/5293
Fixes https://github.com/pulumi/pulumi/issues/13919 (cc @ringods, not
sure if we can declare this issue fixed? We still write the access token
to disk because I'm worried about backwards compatibility if we don't.
Happy to keep this issue open if you prefer)
2024-08-14 08:46:58 +00:00
..
display Don't set `PendingReplacement` until `Delete` succeeds (#16699) 2024-07-18 12:27:06 +00:00
diy New deployment settings wizards and environment variables management comands (#16564) 2024-07-03 20:24:26 +00:00
filestate Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
httpstate prefer environment over config for PULUMI_ACCESS_TOKEN (#16970) 2024-08-14 08:46:58 +00:00
state [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
apply.go turn on the golangci-lint exhaustive linter (#15028) 2024-01-17 16:50:41 +00:00
apply_test.go Make `engine.NewEvent` type safe (#14590) 2023-11-16 16:54:03 +00:00
backend.go New deployment settings wizards and environment variables management comands (#16564) 2024-07-03 20:24:26 +00:00
backend_test.go Allow anything in resource names (#14107) 2023-11-20 08:59:00 +00:00
cancellation_scope.go Make `engine.NewEvent` type safe (#14590) 2023-11-16 16:54:03 +00:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
errors.go Clean up uses of .Error() (#14965) 2023-12-20 15:54:06 +00:00
inmemoryPersister.go Revert "Revert "Run integration tests and dev builds with race detection" (#15998)" (#16148) 2024-05-09 16:15:41 +00:00
mock.go New deployment settings wizards and environment variables management comands (#16564) 2024-07-03 20:24:26 +00:00
policypack.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
query.go Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
snapshot.go [snapshot] Elide writes for RRO with no changes (#15976) 2024-04-18 22:09:08 +00:00
snapshot_test.go Remove `Step.Apply`'s `preview` parameter (#16367) 2024-06-14 10:19:13 +00:00
stack.go Implement preview-only refresh (#15330) 2024-02-01 20:30:40 +00:00
updates.go [cli] Include config from ESC in `pulumi config` (#14560) 2023-11-21 10:44:45 +00:00
watch.go Enable perfsprint linter (#14813) 2023-12-12 12:19:42 +00:00