Skip to content

Possible Gcloud Java bug in signurl? #739

Closed
@OverclockedTim

Description

@OverclockedTim

So I'm using gcloud storage in a managed VM app and generally loving it, but I've hit something that I really think it is a bug so I wanted to throw it out there and see what people think.

I'm doing a few things with Storage and most of them are working perfectly Reads work perfectly, writes work perfectly, creates work perfectly. However, when I attempt to sign a URL like so:

Storage storage = StorageOptions.defaultInstance().service();

URL url = storage.signUrl(
BlobInfo.builder(BUCKET_NAME,
OBJECT_NAME).build(),
30,
TimeUnit.MINUTES,
Storage.SignUrlOption.httpMethod(HttpMethod.GET));

I end up getting a "Signing key not provided" exception:

java.lang.IllegalArgumentException: Signing key was not provided and could not be derived
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
at com.google.gcloud.storage.StorageImpl.signUrl(StorageImpl.java:531)
...

This occurs on a deployed Managed VM server. It also occurs locally when gcloud is authorized either to myself or to a service account. In other words, it appears that storage.signUrl is not picking up signing authorization from the standard locations. I have not yet tried to manually add a signing option from a generated key, but that seems like it should not required. Additionally, the signUrl example from the gcloud-java source in maven has no additional signingKey in the SignUrlOptions which leads me to believe that it is intended for signUrl to pick up its authorization from the environment.

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.auth

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions