Skip to content

Commit 511608b

Browse files
authored
fix(storage): add universe domain to defaultSignBytesFunc (#11521)
1 parent 678944b commit 511608b

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

storage/bucket.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,19 @@ func (b *BucketHandle) defaultSignBytesFunc(email string) func([]byte) ([]byte,
319319
return func(in []byte) ([]byte, error) {
320320
ctx := context.Background()
321321

322+
opts := []option.ClientOption{option.WithHTTPClient(b.c.hc)}
323+
324+
if b.c.creds != nil {
325+
universeDomain, err := b.c.creds.GetUniverseDomain()
326+
if err != nil {
327+
return nil, err
328+
}
329+
opts = append(opts, option.WithUniverseDomain(universeDomain))
330+
}
331+
322332
// It's ok to recreate this service per call since we pass in the http client,
323333
// circumventing the cost of recreating the auth/transport layer
324-
svc, err := iamcredentials.NewService(ctx, option.WithHTTPClient(b.c.hc))
334+
svc, err := iamcredentials.NewService(ctx, opts...)
325335
if err != nil {
326336
return nil, fmt.Errorf("unable to create iamcredentials client: %w", err)
327337
}

0 commit comments

Comments
 (0)