From 0a3c465555017706c5ef023f0a1831a458e0cf00 Mon Sep 17 00:00:00 2001 From: "Kaltenbach, Jonas" Date: Mon, 17 Oct 2022 14:32:15 +0200 Subject: [PATCH] changed renew sas check --- pkg/azurestore/azureservice.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/azurestore/azureservice.go b/pkg/azurestore/azureservice.go index 10e0cb3..d1d5ad4 100644 --- a/pkg/azurestore/azureservice.go +++ b/pkg/azurestore/azureservice.go @@ -152,8 +152,8 @@ func NewAzureService(config *AzConfig) (AzService, error) { func (service *azService) NewBlob(ctx context.Context, name string) (AzBlob, error) { var fileBlob AzBlob url := service.ContainerURL.URL() - skeParam := url.Query().Get("ske") - if skeParam != "" { + if service.SasUrl != "" { + skeParam := url.Query().Get("ske") sasEndDate, _ := time.Parse(time.RFC3339, skeParam) if sasEndDate.Before(time.Now()) { // Renew SAS and append it to URL @@ -355,5 +355,6 @@ func getSasToken(sasUrl string) (sas string, err error) { if readErr != nil { return "", readErr } + fmt.Println("Requested SAS Token.") return string(sasResponse), nil }