Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signed URL does not respect host specified in StorageOptions #1094

Open
frankyn opened this issue Oct 7, 2021 · 0 comments
Open

Signed URL does not respect host specified in StorageOptions #1094

frankyn opened this issue Oct 7, 2021 · 0 comments
Assignees
Labels
api: storage Issues related to the googleapis/java-storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@frankyn
Copy link
Member

frankyn commented Oct 7, 2021

When generating a signed URL the following code snippet doesn't respect the Host supplied by StorageOptions.

Storage storage = StorageOptions.getDefaultInstance().toBuilder().setHost("http://example.com/").build().getService();
URL signedUrl =  storage.signUrl(
                                          state.getBlobInfo(),
                                          1,
                                          TimeUnit.HOURS,
                                          SignUrlOption.httpMethod(HttpMethod.POST),
                                          SignUrlOption.withExtHeaders(
                                              ImmutableMap.of("x-goog-resumable", "start")),
                                          SignUrlOption.signWith(c.getServiceAccountSigner()),
                                          SignUrlOption.withV2Signature());

Edit to add:
When a custom endpoint is set on the client, Sign URLs and Post Policies should automatically use that domain.

Optional: allow users to set a custom hostname for Sign URL and Post policy methods

See: go/signurl-custom-endpoint-gcs

@frankyn frankyn added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Oct 7, 2021
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/java-storage API. label Oct 7, 2021
@BenWhitehead BenWhitehead added this to the Retry Conformance Project milestone Oct 8, 2021
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Jan 6, 2022
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 5, 2022
@BenWhitehead BenWhitehead added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Apr 6, 2022
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 googleapis/java-storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

4 participants