Skip to content

Commit

Permalink
blob/s3blob: Unexport S3 specific constants
Browse files Browse the repository at this point in the history
  • Loading branch information
tristan-newmann committed Dec 1, 2023
1 parent b4dae37 commit a7a2899
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions blob/s3blob/s3blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ type URLOpener struct {
}

const (
SSETypeParamKey = "ssetype"
KMSKeyIdParamKey = "kmskeyid"
sseTypeParamKey = "ssetype"
kmsKeyIdParamKey = "kmskeyid"
)

func IsValidServerSideEncryptionType(value string) bool {
Expand All @@ -162,8 +162,8 @@ func IsValidServerSideEncryptionType(value string) bool {
func (o *URLOpener) OpenBucketURL(ctx context.Context, u *url.URL) (*blob.Bucket, error) {
q := u.Query()

if sseType := q.Get(SSETypeParamKey); sseType != "" {
q.Del(SSETypeParamKey)
if sseType := q.Get(sseTypeParamKey); sseType != "" {
q.Del(sseTypeParamKey)

if !IsValidServerSideEncryptionType(sseType) {
return nil, fmt.Errorf("ssetype invalid %v", sseType)
Expand All @@ -172,8 +172,8 @@ func (o *URLOpener) OpenBucketURL(ctx context.Context, u *url.URL) (*blob.Bucket
o.Options.EncryptionType = typesv2.ServerSideEncryption(sseType)
}

if kmsKeyID := u.Query().Get(KMSKeyIdParamKey); kmsKeyID != "" {
q.Del(KMSKeyIdParamKey)
if kmsKeyID := u.Query().Get(kmsKeyIdParamKey); kmsKeyID != "" {
q.Del(kmsKeyIdParamKey)
o.Options.KMSEncryptionID = kmsKeyID
}

Expand Down

0 comments on commit a7a2899

Please sign in to comment.