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

Convert SAS times to UTC before formatting #171

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions azblob/zc_sas_query_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ const (
func FormatTimesForSASSigning(startTime, expiryTime, snapshotTime time.Time) (string, string, string) {
ss := ""
if !startTime.IsZero() {
ss = startTime.Format(SASTimeFormat) // "yyyy-MM-ddTHH:mm:ssZ"
ss = startTime.UTC().Format(SASTimeFormat) // "yyyy-MM-ddTHH:mm:ssZ"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @someone1 ,

Thanks for reaching out !
We are happy to see your contribution.

There are couple of things which I'd like to point out

  1. We always merge to dev branch before releasing it to master. So I changed the base to dev branch
  2. There is a conflict in merge which will be removed if you do the required changes in either formatSASTimeWithDefaultFormat() function or send UTC time as argument itself.

Also, it'd be nice if you can see whether formatSASTimeWithDefaultFormat() func is getting used some other function call because if that is the case, we need to see if UTC time is required in that function or not?

}
se := ""
if !expiryTime.IsZero() {
se = expiryTime.Format(SASTimeFormat) // "yyyy-MM-ddTHH:mm:ssZ"
se = expiryTime.UTC().Format(SASTimeFormat) // "yyyy-MM-ddTHH:mm:ssZ"
}
sh := ""
if !snapshotTime.IsZero() {
sh = snapshotTime.Format(SnapshotTimeFormat)
sh = snapshotTime.UTC().Format(SnapshotTimeFormat)
}
return ss, se, sh
}
Expand Down