feat: Added sas token authentication for azure backend

This commit is contained in:
jonaustin09
2024-01-09 22:03:13 -08:00
committed by Ben McClelland
parent 06ccd7496e
commit e5fc12042b
2 changed files with 44 additions and 6 deletions
+9 -2
View File
@@ -22,7 +22,7 @@ import (
)
var (
azAccount, azKey, azServiceURL string
azAccount, azKey, azServiceURL, azSASToken string
)
func azureCommand() *cli.Command {
@@ -46,6 +46,13 @@ func azureCommand() *cli.Command {
Aliases: []string{"k"},
Destination: &azKey,
},
&cli.StringFlag{
Name: "sas-token",
Usage: "azure blob storage SAS token",
EnvVars: []string{"AZ_SAS_TOKEN"},
Aliases: []string{"st"},
Destination: &azSASToken,
},
&cli.StringFlag{
Name: "url",
Usage: "azure service URL",
@@ -63,7 +70,7 @@ func runAzure(ctx *cli.Context) error {
azServiceURL = fmt.Sprintf("https://%s.blob.core.windows.net/", azAccount)
}
be, err := azure.New(azAccount, azKey, azServiceURL)
be, err := azure.New(azAccount, azKey, azServiceURL, azSASToken)
if err != nil {
return fmt.Errorf("init azure: %v", err)
}