-
Notifications
You must be signed in to change notification settings - Fork 823
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
GCS Signed URL Support #5233
Comments
I'd like to give this a try and write a first draft. Maybe I can write more later. |
@tustvold Could you please assign this issue to me? It will serve as a reminder for me. |
@tustvold Hi, I'm confused about the code. Can I ask some questions?
additional information:
|
Yep. GCP has different kind of services accounts like reqsign implemented most of them which worth to take a look: https://github.com/Xuanwo/reqsign/blob/main/src/google/credential.rs |
I think it is important to separate the credential from how it is obtained, as we support a large number of auth options beyond service account credentials. For request authorization all that is needed is a JWT so that is what GcpCredential contains, and there are then various ways of obtaining such a JWT Now the problem comes that signing requires additional information, this will need to be plumbed through from the builder, sourced either from the underlying credential provider before it is type erased, or as an explicit config option passed to the builder. #5073 is also likely relevant here. I'll try to find some time today to stub out some code for you |
Done some more digging, in no particular order InstanceMetadata So the instance metadata token endpoint only provides an access token, and no email, although this can be retrieved with a retrieved with
AuthorizedUserCredentials As described here the configuration metadata does not contain information on the calling identity. Additionally as described here the returned access token is opaque and does not provide information on the identity either. However, the information can be retrieved by calling a specific API endpoint here.
This would then enable calling the signBlob API. HMAC Keys I am not sure this is something we will want to support, but you can also sign requests using HMAC keys. Conclusion I think we will need an approach that allows different signing methodologies based on the underlying credential provider. The simplest way to do this is likely to implement Let me know if anything isn't clear. |
Thank you for your assistance, and I will attempt to implement it. |
Any progress on this issue? I would be willing to step in and help out where possible. |
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
#4876 added support for generating S3 URLs, via the Signer trait. This ticket tracks implementing Signer for GoogleCloudStorage
Describe the solution you'd like
The process for generating signed URLs is described here.
Once the stringToSign has been constructed there are two mechanisms for generating the signature:
The latter approach will support all GcpCredentialProvider and is therefore probably the approach to start with. The former is a touch more fiddly, and will likely involve some rejigging of GoogleCloudStorageBuilder::build to expose this ServiceAccountKey in such a way that it can be used by the Signer implementation. It would be perfectly acceptable for the first version to only support the signBlob approach.
Describe alternatives you've considered
Additional context
Split out of #3027
The text was updated successfully, but these errors were encountered: