This repository has been archived by the owner on Oct 18, 2021. It is now read-only.
generated from beyondstorage/go-service-example
-
Notifications
You must be signed in to change notification settings - Fork 2
storage: Add SSE part in formatFileObject #17
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Xuanwo
reviewed
Apr 25, 2021
utils.go
Outdated
@@ -294,6 +294,12 @@ func (s *Storage) formatFileObject(v azblob.BlobItemInternal) (o *typ.Object, er | |||
if value := v.Properties.AccessTier; value != "" { | |||
sm.AccessTier = string(value) | |||
} | |||
if v.Properties.CustomerProvidedKeySha256 != nil && *v.Properties.CustomerProvidedKeySha256 != "" { |
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.
How about value := v.Properties.CustomerProvidedKeySha256; len(value) != 0
?
Xuanwo
changed the title
storage: add SSE part in formatFileObject
storage: Add SSE part in formatFileObject
Apr 25, 2021
xxchan
commented
Apr 25, 2021
@@ -209,6 +210,9 @@ func (s *Storage) stat(ctx context.Context, path string, opt pairStorageStat) (o | |||
if v := output.EncryptionScope(); v != "" { | |||
sm.EncryptionScope = v | |||
} | |||
if v, err := strconv.ParseBool(output.IsServerEncrypted()); err != nil { | |||
sm.ServerEncrypted = v | |||
} |
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.
should be err == nil
……
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.
An IsServerEncrypted
API returns string, so weird.
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.
That's because ...
// IsServerEncrypted returns the value for header x-ms-server-encrypted.
func (bgpr BlobGetPropertiesResponse) IsServerEncrypted() string {
return bgpr.rawResponse.Header.Get("x-ms-server-encrypted")
}
Xuanwo
approved these changes
Apr 25, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix #14