Skip to content

docs(storage): warn about V2 signed URL query parameter behavior - #15430

Closed
sahusneha2004 wants to merge 1 commit into
mainfrom
docs/v2-signed-url-warning
Closed

sahusneha2004 wants to merge 1 commit into
mainfrom
docs/v2-signed-url-warning

Conversation

@sahusneha2004

Copy link
Copy Markdown
Contributor

Problem

Storage.SignUrlOption.withV2Signature(), Storage.signUrl(...), and Blob.signUrl(...) Javadocs did not include a warning explaining how V2 Signed URLs handle query parameters (unlike SignUrlOption.withQueryParams(...)), even though V2 signing is the default when neither withV2Signature() nor withV4Signature() is passed.

Changes

  • Added a Javadoc warning to Storage.SignUrlOption.withV2Signature() in Storage.java noting that query parameters are not used to compute a V2 signature (so they can be added, removed, or altered after signing) and recommending withV4Signature() instead, along with @see links to Canonical Requests and the V2 Signing Process.
  • Added a matching Javadoc warning to Storage.signUrl(...) in Storage.java and Blob.signUrl(...) in Blob.java noting that V2 signing is the default and recommending SignUrlOption.withV4Signature().

Tests

  • Ran mvn test checkstyle:check@checkstyle javadoc:javadoc -pl java-storage/google-cloud-storage -Dtest=V4SigningTest,SignatureInfoTest: 0 Checkstyle violations, Javadoc build succeeded, and 27/27 tests passed.

Document in Storage#signUrl, Storage.SignUrlOption#withV2Signature, and Blob#signUrl Javadocs that V2 Signed URLs do not include query parameters in signature computation, so query parameters can be added, removed, or altered after signing, and recommend withV4Signature() instead.

[Generated-by: AI]
@sahusneha2004 sahusneha2004 added the ai-generated Pull Request generated by AI label Dec 3, 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 updates the Javadoc documentation in Blob.java and Storage.java to add warning messages regarding the default use of V2 signing in signUrl. It explains that V2 signed URLs do not use query parameters to compute the signature, allowing them to be altered after signing, and recommends using V4 signing instead. There are no review comments to address, and the changes look good.

@sahusneha2004
sahusneha2004 marked this pull request as ready for review December 4, 2026 05:58
@sahusneha2004
sahusneha2004 requested review from a team as code owners December 4, 2026 05:58
@sahusneha2004
sahusneha2004 marked this pull request as draft December 4, 2026 06:21
@sahusneha2004
sahusneha2004 deleted the docs/v2-signed-url-warning branch December 4, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Pull Request generated by AI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant