Repository navigation
fix(storage): skip authentication for custom endpoints by default - #9982
Open
thiyaguk09 wants to merge 2 commits into
Open
thiyaguk09 wants to merge 2 commits into
thiyaguk09 wants to merge 2 commits into
Conversation
Skip Google authentication, universe domain checks, and ADC project ID lookups for custom and emulator endpoints unless useAuthWithCustomEndpoint is explicitly set to true.
- Forward customEndpoint, useAuthWithCustomEndpoint, and projectIdRequired: false from Storage to StorageTransport.
- Bypass GoogleAuth and assertUniverseDomain in StorageTransport#makeRequest on unauthenticated custom endpoints, dispatching via plain Gaxios while preserving defaults, interceptors, retries, timeouts, headers, streaming, and error decoration.
- Resolve explicit projectId / {{projectId}} tokens without calling getProjectId(), strip unresolved exact-placeholder query params, reject unresolved path/embedded tokens, and preserve falsy primitive query values while stripping empty query objects.
- Guard assertUniverseDomain in File#createWriteStream for simple (resumable: false) uploads on unauthenticated custom endpoints.
- Update XMLMultiPartUploadHelper in TransferManager to use plain Gaxios and skip assertUniverseDomain on unauthenticated custom endpoints.
Fixes googleapis#9873
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for unauthenticated custom endpoints (such as local emulators) and dynamic {{projectId}} placeholder resolution across the Storage client, Transport, and Transfer Manager. Two key feedback points were raised: first, when creating a new Gaxios instance for unauthenticated custom endpoints in transfer-manager.ts, custom interceptors from the transport's gaxiosInstance should be copied over to avoid bypassing user-configured interceptors; second, in storage-transport.ts, queryParameters in baseRequestOpts should be explicitly overridden with the resolved queryParameters object to ensure downstream code does not see unresolved placeholders.
- Pass resolved and stripped queryParameters on request options in StorageTransport#makeRequest so interceptors observe normalized values on config.queryParameters. - Copy request and response interceptors from storageTransport.gaxiosInstance and omit defaults.adapter when constructing the unauthenticated Gaxios requester in XMLMultiPartUploadHelper. - Add unit tests for both behaviors in storage-transport and transfer-manager.
thiyaguk09
marked this pull request as ready for review
November 27, 2026 06:44
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Skip Google authentication, universe domain checks, and ADC project ID lookups for custom and emulator endpoints unless useAuthWithCustomEndpoint is explicitly set to true.
Fixes #9873