1
0
mirror of synced 2026-10-24 12:59:22 +03:00

2 Commits

Author SHA1 Message Date
Eugene Kalinin
e9af93ff29 fix(providers): clearer errors when GitHub OIDC token request fails (#5062)
The GitHub Actions provider decoded the response body without checking the
status code, so a failing OIDC endpoint surfaced as a raw json error:

  fetching ambient OIDC credentials: invalid character 'u' looking for
  beginning of value

Check the status code first and report it along with a truncated body, and
wrap decode failures with the provider name:

  fetching ambient OIDC credentials: identity token request to provider
  github-actions failed with status 502 Bad Gateway: "upstream connect
  error or disconnect/reset before headers"

Fixes #4438

Signed-off-by: Eugene Kalinin <e.v.kalinin@gmail.com>
2026-08-18 09:09:02 -07:00
Sebastien Tardif
8a86a7cf84 fix: use Header.Set to prevent duplicate Authorization on retry (#4870)
The GitHub Actions OIDC token provider uses Header.Add inside a retry
loop. On each retry iteration, an additional Authorization header is
appended to the request. By the third attempt, three identical headers
are sent. Some servers and proxies reject requests with duplicate
Authorization headers, causing retries to fail when they should
succeed.

Replace Header.Add with Header.Set so only one Authorization header
is ever present, regardless of how many retries occur.

Add a test that forces two retries via connection hijack and asserts
exactly one Authorization header is received on every attempt.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
2026-05-18 09:40:23 -04:00