pulumi/pkg/backend/httpstate
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
..
client Fix deployment settings serialization and keys consistency (#16904) 2024-08-12 19:28:13 +00:00
testdata [snapshot] Use a newer diff package 2023-05-16 12:33:30 -07:00
backend.go prefer environment over config for PULUMI_ACCESS_TOKEN (#16970) 2024-08-14 08:46:58 +00:00
backend_test.go Support always qualifying stack names (#11081) (#15857) 2024-04-04 10:11:46 +00:00
console.go Add support for a PULUMI_CONSOLE_DOMAIN env var (#4410) 2020-04-17 11:50:00 -07:00
console_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
diffs.go Clean up uses of .Error() (#14965) 2023-12-20 15:54:06 +00:00
diffs_post_1.20.go Clean up uses of .Error() (#14965) 2023-12-20 15:54:06 +00:00
diffs_pre_1.20.go [snapshot] Use a newer diff package 2023-05-16 12:33:30 -07:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
environments.go [cli] Include config from ESC in `pulumi config` (#14560) 2023-11-21 10:44:45 +00:00
mock.go Update pu/pu to support deployment run command (#16492) 2024-07-01 14:18:44 +00:00
policypack.go Add packagemanager prompt to pulumi new for nodejs (#16417) 2024-06-21 11:35:06 +00:00
snapshot.go Lift context parameter to SerializeDeployment/Resource/Operations/Properties (#15929) 2024-04-15 07:45:46 +00:00
snapshot_test.go Add display to the engine tests (#16050) 2024-05-13 07:18:25 +00:00
stack.go Support always qualifying stack names (#11081) (#15857) 2024-04-04 10:11:46 +00:00
state.go Run integration tests with race detection (#15895) 2024-04-11 15:58:42 +00:00
token_source.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
token_source_test.go Skip TestTokenSourceWithQuicklyExpiringInitialToken (#16515) 2024-06-28 07:42:46 +00:00