Skip to content

fix(storage): pass signingEndpoint to URLSigner in file.getSignedUrl - #8982

Open
thiyaguk09 wants to merge 3 commits into
googleapis:mainfrom
thiyaguk09:fix/8829-signing-endpoint
Open

fix(storage): pass signingEndpoint to URLSigner in file.getSignedUrl#8982
thiyaguk09 wants to merge 3 commits into
googleapis:mainfrom
thiyaguk09:fix/8829-signing-endpoint

Conversation

@thiyaguk09

Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #8829

@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Jul 28, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for passing a signingEndpoint configuration option to URLSigner when generating a signed URL, along with corresponding unit tests. The feedback suggests spreading the base configuration (SIGNED_URL_CONFIG) before applying the signingEndpoint property in the test to prevent accidental overwrites.

Comment thread handwritten/storage/test/file.ts
@thiyaguk09
thiyaguk09 force-pushed the fix/8829-signing-endpoint branch from 5b15d39 to 4074d75 Compare July 28, 2026 13:45
@thiyaguk09
thiyaguk09 marked this pull request as ready for review July 28, 2026 13:46
@thiyaguk09
thiyaguk09 requested a review from a team as a code owner July 28, 2026 13:46
@thiyaguk09
thiyaguk09 force-pushed the fix/8829-signing-endpoint branch from 4074d75 to 9599274 Compare July 28, 2026 15:02
contentMd5: cfg.contentMd5,
contentType: cfg.contentType,
host: cfg.host,
signingEndpoint: cfg.signingEndpoint,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When URLSigner receives this parameter, it passes it to auth.sign() as a second argument. The issue is that the public AuthClient interface only defines one parameter (sign(blobToSign: string)).

If a developer provides a custom AuthClient implementation based on our interface, Javascript will silently drop this new signingEndpoint argument at runtime. The user will receive a signed URL generated from the default endpoint, and they'll have no idea their custom config was ignored.

Suggestion: Could we update the AuthClient interface in src/signer.ts to explicitly include the optional parameter? sign(blobToSign: string, signingEndpoint?: string): Promise;

This will ensure custom implementers are aware they need to support it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the AuthClient interface in src/signer.ts, it is now ​sign(blobToSign: string, signingEndpoint?: string): Promise<string>;

@rajeevpodar rajeevpodar left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verify the custom auth support code flow.

@thiyaguk09
thiyaguk09 force-pushed the fix/8829-signing-endpoint branch from 9599274 to 63b2ee2 Compare July 29, 2026 05:09
@thiyaguk09
thiyaguk09 requested a review from rajeevpodar July 29, 2026 05:51
@thiyaguk09
thiyaguk09 force-pushed the fix/8829-signing-endpoint branch from 4b75dd8 to b528a85 Compare July 30, 2026 04:48
thiyaguk09 and others added 3 commits July 31, 2026 13:48
@thiyaguk09
thiyaguk09 force-pushed the fix/8829-signing-endpoint branch from b528a85 to bd98c61 Compare July 31, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config option signingEndpoint is not used when passed to getSignedUrl

2 participants