Skip to content

Commit

Permalink
fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ddowker committed Nov 29, 2023
1 parent 5d70ce8 commit 53b3c78
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions broker/fragment/store_azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type azureBackend struct {
udc *service.UserDelegationCredential
udcExp *time.Time

sharedKeyCredentials *service.SharedKeyCredential
sharedKeyCredentials *sas.SharedKeyCredential
}

func (a *azureBackend) Provider() string {
Expand All @@ -60,7 +60,7 @@ func (a *azureBackend) Provider() string {
// https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/storage/azblob/service/examples_test.go#L285
func (a *azureBackend) SignGet(ep *url.URL, fragment pb.Fragment, d time.Duration) (string, error) {
var (
sasQueryParams QueryParameters
sasQueryParams sas.QueryParameters
err error
)

Expand All @@ -72,12 +72,14 @@ func (a *azureBackend) SignGet(ep *url.URL, fragment pb.Fragment, d time.Duratio

if ep.Scheme == "azure" {
// Note: for arize we assume azure scheme is for blob SAS (as opposed to container SAS in azure-ad case)
perms := sas.BlobPermissions{Add: true, Read: true, Write: true}

sasQueryParams, err = sas.BlobSignatureValues{
Protocol: sas.ProtocolHTTPS, // Users MUST use HTTPS (not HTTP)
ExpiryTime: time.Now().UTC().Add(d),
ContainerName: cfg.containerName,
BlobName: blobName,
Permissions: sas.BlobPermissions{Add: true, Read: true, Write: true}.String(),
Permissions: perms.String(),
}.SignWithSharedKey(a.sharedKeyCredentials)

if err != nil {
Expand Down

0 comments on commit 53b3c78

Please sign in to comment.