Skip to content
This repository has been archived by the owner on Oct 18, 2021. It is now read-only.

storage: Add SSE part in formatFileObject #17

Merged
merged 5 commits into from
Apr 25, 2021
Merged

storage: Add SSE part in formatFileObject #17

merged 5 commits into from
Apr 25, 2021

Conversation

xxchan
Copy link
Contributor

@xxchan xxchan commented Apr 25, 2021

fix #14

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 != "" {
Copy link
Contributor

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 Xuanwo changed the title storage: add SSE part in formatFileObject storage: Add SSE part in formatFileObject 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
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should be err == nil……

Copy link
Contributor

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.

Copy link
Contributor Author

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 Xuanwo merged commit 4667f2c into master Apr 25, 2021
@Xuanwo Xuanwo deleted the sse branch April 25, 2021 07:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

storage: formatFileObject Should also have SSE support
2 participants