Repository navigation
fix(auth): honor an explicit zero GCP metadata timeout - #2481
Conversation
HAYDEN-OAI
left a comment
There was a problem hiding this comment.
Reviewed the GCP metadata timeout handling. Explicit timeout: 0 is now preserved, the 10-second default remains unchanged, and the behavior matches the existing Azure provider. No actionable concerns.
Castiron custom code✅ No new custom-code files detected. 32 mixed files remain; 0 existing customizations changed. Compared 32 existing customizations unchanged
A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload the exact patch produced by this run (requires repository access): gh run download 32995225292 --repo openai/openai-node \
--name castiron-custom-code-32995225292-1 --dir /tmp/castiron-custom-code-32995225292-1
git apply --stat /tmp/castiron-custom-code-32995225292-1/custom-code.patch
cat /tmp/castiron-custom-code-32995225292-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 6992683aaf2014d5e625e8eeebb3906bd8651ff0 2b85e42b41de07129a795e6e7e41b91b8a9a6968
python3 scripts/castiron/custom_code_report.py report \
--base 6992683aaf2014d5e625e8eeebb3906bd8651ff0 \
--head 2b85e42b41de07129a795e6e7e41b91b8a9a6968 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-2b85e42b41de
cat /tmp/castiron-custom-code-2b85e42b41de/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
Changes being requested
gcpIDTokenProvidercomputes its metadata request timeout withconfig?.timeout || 10_000, so an explicittimeout: 0is silently replaced with 10,000 ms. The Azure IMDS provider in the same file usesconfig?.timeout ?? 10_000for the identically documented option, so the two providers currently behave differently for the same configuration.This change switches the GCP provider to the nullish coalescing the file already uses for Azure, and adds explicit-zero regression tests for both providers in
tests/auth/subject-token-providers.test.ts(mocked fetch, no live network; the Azure test is a parity control pinning the already-correct behavior).Verified locally (Node 24.18.0): the GCP regression fails on
main(the singlesetTimeoutcall receives10000instead of0) and passes with this change; the provider test file passes 14/14; lint, build, and the full test suite pass apart from the two pre-existing macOS-only failures addressed in #2480.Additional context & links
One-line production change; the only other
config?.timeoutdefault in the file already used??.