Skip to content

fix(storage): pass universe_domain in generate_signed_post_policy_v4 - #19243

Merged
nidhiii-27 merged 3 commits into
mainfrom
fix/storage-post-policy-universe-domain
Dec 1, 2026
Merged

nidhiii-27 merged 3 commits into
mainfrom
fix/storage-post-policy-universe-domain

Conversation

@nidhiii-27

@nidhiii-27 nidhiii-27 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Client.generate_signed_post_policy_v4 now passes self.universe_domain to _sign_message, aligning its configuration handling with Blob.generate_signed_url. Existing signing behavior for clients using the default universe domain and local credential signing remains unchanged. Added unit test coverage in packages/google-cloud-storage/tests/unit/test_client.py and packages/google-cloud-storage/tests/unit/test__signing.py.

`Client.generate_signed_post_policy_v4` now passes `self.universe_domain` to `_sign_message`, aligning its configuration handling with `Blob.generate_signed_url`. Existing signing behavior for clients using the default universe domain and local credential signing remains unchanged. Added unit test coverage in `packages/google-cloud-storage/tests/unit/test_client.py`.

[Generated-by: AI]

@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 updates the generate_signed_post_policy_v4 method in client.py to pass the universe_domain parameter to _sign_message when signing a post policy with an access token and service account email. It also adds a corresponding unit test to verify this behavior. There are no review comments, so I have no feedback to provide.

@nidhiii-27

Copy link
Copy Markdown
Contributor Author

/gcbrun

@nidhiii-27
nidhiii-27 marked this pull request as ready for review November 27, 2026 08:59
@nidhiii-27
nidhiii-27 requested review from a team as code owners November 27, 2026 08:59
@nidhiii-27
nidhiii-27 requested review from chandra-siri and removed request for a team November 27, 2026 08:59

@shradhakatyal shradhakatyal 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.

LGTM. self.universe_domain always returns a non-empty value, and the default-universe behaviour is unchanged.

Test_sign_message.test_sign_bytes_w_universe_domain verifies that _sign_message sends the request to the iamcredentials endpoint for the provided universe_domain and returns the expected signature. Existing _sign_message behavior with the default universe domain remains unchanged. Added unit test coverage in packages/google-cloud-storage/tests/unit/test__signing.py.

[Generated-by: AI]
@nidhiii-27

Copy link
Copy Markdown
Contributor Author

Re: feedback from @shradhakatyal

Thank you for the review! Added Test_sign_message.test_sign_bytes_w_universe_domain in packages/google-cloud-storage/tests/unit/test__signing.py.

Co-authored by AI Agent

@nidhiii-27

Copy link
Copy Markdown
Contributor Author

/gcbrun

@nidhiii-27 nidhiii-27 added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Nov 30, 2026
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Nov 30, 2026
@nidhiii-27 nidhiii-27 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 1, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 1, 2026
@nidhiii-27
nidhiii-27 merged commit 4e60cbf into main Dec 1, 2026
83 checks passed
@nidhiii-27
nidhiii-27 deleted the fix/storage-post-policy-universe-domain branch December 1, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants