Closed a-gierczak closed 1 month ago
You can either
NewURLSignerHMAC
, but also possibly a different implementation of the URLSigner
interface), set it in Options.URLSigner
, and pass it to the constructor. Then you have direct access to the signer. It sounds like this is what you're doing.base_url
and secret_key_path
to create the bucket, and separately create an URLSignerHMAC
to use for validation; it should work as long as you pass the same parameters.None of the provider structs are public, by design -- they are intended to be treated as blob.Bucket
after construction, not have special functions for specific providers.
Is your feature request related to a problem? Please describe.
Currently, you can use the built-in URLSignerHMAC to presign URLs by passing
base_url
andsecret_key_path
query params toOpenBucket
. However, there is no way to actually validate the signature later, as URLSigner is not publicly exposed in file blob.Describe the solution you'd like
Make
fileblob.bucket
struct public, and add aURLSigner()
method onbucket
that would returnbucket.opts.URLSigner
Describe alternatives you've considered
The workaround I'm using right now is having my own URLSigner constructor, which calls
fileblob.NewURLSignerHMAC
(basically copy-paste implementation from fileblob), and storing it in my struct along with the bucket. Then, I'm passing this URLSigner tofileblob.OpenBucket
options.