-
Notifications
You must be signed in to change notification settings - Fork 865
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
GetSASURI is more complete and has grouped params #662
Conversation
GetSASURI also includes signed identifier and overridable headers Got rid of GetSASURIWithSignedIPAndProtocol
func (c *Container) GetSASURIWithSignedIPAndProtocol(expiry time.Time, permissions string, signedIPRange string, HTTPSOnly bool) (string, error) { | ||
// ContainerSASPermissions includes the available permissions for | ||
// a container SAS URI. | ||
type ContainerSASPermissions struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this could be a superset of BlobSASPermissions (or perhaps some other "base" type) to avoid duplication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
storage/container.go
Outdated
return c.bsc.client.commonSASURI(expiry, uri, permissions, signedIPRange, canonicalizedResource, signedResource, HTTPSOnly) | ||
|
||
// build permissions string | ||
permissions := "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this logic into a base type and make it a method so you don't have to repeat it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
storage/blobsasuri.go
Outdated
SASOptions | ||
} | ||
|
||
// SASOptions includes options used by SAS URIs for diffrenet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
different :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
storage/blobsasuri.go
Outdated
} | ||
|
||
func (c *Client) commonSASURI(expiry time.Time, uri, permissions, signedIPRange, canonicalizedResource, signedResource string, HTTPSOnly bool) (string, error) { | ||
func (c *Client) commonSASURI(options SASOptions, uri, permissions, canonicalizedResource, signedResource string, headers OverrideHeaders) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commonSASURI isn't really completely common. It's valid to use for blob and fileservice but not tables or queues (unless we add a few conditionals in there). Maybe rename it to reflect blob/fileservice usage only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
// See https://msdn.microsoft.com/en-us/library/azure/ee395415.aspx | ||
func (b *Blob) GetSASURIWithSignedIPAndProtocol(expiry time.Time, permissions string, signedIPRange string, HTTPSOnly bool) (string, error) { | ||
// See https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas | ||
func (b *Blob) GetSASURI(options BlobSASOptions) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be sure to document this breaking change in the change log.
GetSASURI func now receive grouped parameters
GetSASURI also includes signed identifier and overridable headers
Got rid of GetSASURIWithSignedIPAndProtocol
PTAL
@marstr @jhendrixMSFT