From b2d4cc6241955fd0c5472c89ea096fe0b4615145 Mon Sep 17 00:00:00 2001 From: Thiyagu K Date: Tue, 28 Jul 2026 08:17:27 +0000 Subject: [PATCH 1/3] feat: support passing signingEndpoint to getSignedUrl in file operations --- handwritten/storage/src/file.ts | 1 + handwritten/storage/test/file.ts | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/handwritten/storage/src/file.ts b/handwritten/storage/src/file.ts index 27765d935a99..d5aa40bf96e1 100644 --- a/handwritten/storage/src/file.ts +++ b/handwritten/storage/src/file.ts @@ -3236,6 +3236,7 @@ class File extends ServiceObject { contentMd5: cfg.contentMd5, contentType: cfg.contentType, host: cfg.host, + signingEndpoint: cfg.signingEndpoint, }; if (cfg.cname) { diff --git a/handwritten/storage/test/file.ts b/handwritten/storage/test/file.ts index 26823995b907..48b281082e14 100644 --- a/handwritten/storage/test/file.ts +++ b/handwritten/storage/test/file.ts @@ -3794,11 +3794,30 @@ describe('File', () => { contentType: config.contentType, cname: CNAME, virtualHostedStyle: true, + signingEndpoint: undefined, }); done(); }); }); + it('should pass signingEndpoint to URLSigner', done => { + const signingEndpoint = 'https://my-endpoint.com'; + const config = { + signingEndpoint, + ...SIGNED_URL_CONFIG, + }; + + file.getSignedUrl(config, (err: Error | null) => { + assert.ifError(err); + const getSignedUrlArgs = signerGetSignedUrlStub.getCall(0).args; + assert.strictEqual( + getSignedUrlArgs[0]['signingEndpoint'], + signingEndpoint + ); + done(); + }); + }); + it('should add "x-goog-resumable: start" header if action is resumable', done => { SIGNED_URL_CONFIG.action = 'resumable'; SIGNED_URL_CONFIG.extensionHeaders = { From b2933026d9c46b58ad8f715136843b998034ca12 Mon Sep 17 00:00:00 2001 From: Thiyagu K Date: Tue, 28 Jul 2026 15:33:18 +0530 Subject: [PATCH 2/3] Updated Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- handwritten/storage/test/file.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handwritten/storage/test/file.ts b/handwritten/storage/test/file.ts index 48b281082e14..d9f9185a16e8 100644 --- a/handwritten/storage/test/file.ts +++ b/handwritten/storage/test/file.ts @@ -3803,8 +3803,8 @@ describe('File', () => { it('should pass signingEndpoint to URLSigner', done => { const signingEndpoint = 'https://my-endpoint.com'; const config = { - signingEndpoint, ...SIGNED_URL_CONFIG, + signingEndpoint, }; file.getSignedUrl(config, (err: Error | null) => { From bd98c615b9c27ba66a33b1d9c5c25523dc7f718f Mon Sep 17 00:00:00 2001 From: Thiyagu K Date: Wed, 29 Jul 2026 05:36:56 +0000 Subject: [PATCH 3/3] feat: add optional signingEndpoint parameter to AuthClient.sign method --- handwritten/storage/src/signer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handwritten/storage/src/signer.ts b/handwritten/storage/src/signer.ts index a657cef6133d..ba5c17c04b75 100644 --- a/handwritten/storage/src/signer.ts +++ b/handwritten/storage/src/signer.ts @@ -25,7 +25,7 @@ type GoogleAuthLike = Pick; * @deprecated Use {@link GoogleAuth} instead */ export interface AuthClient { - sign(blobToSign: string): Promise; + sign(blobToSign: string, signingEndpoint?: string): Promise; getCredentials(): Promise<{ client_email?: string; }>;