Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormatTimesForSASSigning should convert to UTC before formatting #170

Closed
someone1 opened this issue Apr 17, 2020 · 1 comment · May be fixed by #171
Closed

FormatTimesForSASSigning should convert to UTC before formatting #170

someone1 opened this issue Apr 17, 2020 · 1 comment · May be fixed by #171
Assignees

Comments

@someone1
Copy link

Which version of the SDK was used?

v0.8.0

Which platform are you using? (ex: Windows, Linux, Debian)

Arch Linux

What problem was encountered?

Passing in time.Now().Add(time.Hour) to BlobSASSignatureValues.ExpiryTime results in the time string dropping TZ data and assuming it's in UTC. My local is in EST but the format string omits any Time Zone addition with a static Z ending: 2006-01-02T15:04:05Z

How can we reproduce the problem in the simplest way?

https://play.golang.org/p/YB02MQG3m1T

Something like

azblob.FormatTimesForSASSigning(time.Now().In(time.FixedZone("UTC-8", -8*60*60), time.Time{}, time.TIme{})

It should be an easy fix - could have saved me a load of hours as I saw the time format with a Z ending in the encoded query and assumed it was properly converting to UTC (didn't pay close enough attention to the actual numbers though)

Have you found a mitigation/solution?

Pass in the time values in the struct as UTC myself

someone1 added a commit to someone1/azure-storage-blob-go that referenced this issue Apr 17, 2020
@mohsha-msft
Copy link
Contributor

Inactive. Please reopen once you address comments on the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants