pulumi/pkg/backend/httpstate
Thomas Gummerer 898e02e3ab
stop the token source loop correctly on 403 errors (#17714)
In the token source loop, when a 403 error happens, there's no way it's
going to succeed in the future, and we want to abort it. We try to do so
currently, however we're passing the incorrect type to `errors.As`, and
thus never get an expiredTokenError, and never abort the loop.

Note that we are no longer retrying this in a tight loop, but if someone
calls `GetToken` frequently for whatever reason, we'd still end up in
the same situation as in https://github.com/pulumi/home/issues/3660.

Fix that, and add a test that reproduces the whole round trip through
the client by setting up a fake http server.

Fixes https://github.com/pulumi/pulumi/issues/17551
2024-11-08 08:31:50 +00:00
..
client Add explanations about features to improve UX (#17307) 2024-09-26 14:40:51 +00:00
testdata Persist metadata about snapshot integrity errors (#17291) 2024-11-06 17:35:27 +00:00
backend.go simplify the keep running in the service backend (#17702) 2024-11-06 15:49:23 +00:00
backend_test.go Let `Backend.CreateStack` accept an initial state (#17369) 2024-09-26 08:00:52 +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 Persist metadata about snapshot integrity errors (#17291) 2024-11-06 17:35:27 +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 Merge ESC Projects feature branch (#17226) 2024-09-10 23:08:09 +00:00
mock.go Update pu/pu to support deployment run command (#16492) 2024-07-01 14:18:44 +00:00
policypack.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
snapshot.go Lift context parameter to SerializeDeployment/Resource/Operations/Properties (#15929) 2024-04-15 07:45:46 +00:00
snapshot_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
stack.go Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
state.go stop the token source loop correctly on 403 errors (#17714) 2024-11-08 08:31:50 +00:00
token_source.go Keep the token source loop going in the face of errors (#17519) 2024-10-08 15:16:04 +00:00
token_source_test.go stop the token source loop correctly on 403 errors (#17714) 2024-11-08 08:31:50 +00:00