Skip to content

Commit

Permalink
fix: correct wiring of disable s3express auth toggle (#2394)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucix-aws authored Nov 28, 2023
1 parent 4aeeb0d commit 94a3980
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
8 changes: 8 additions & 0 deletions .changelog/03de8b0c1add4877bcfd5472db61ee82.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "03de8b0c-1add-4877-bcfd-5472db61ee82",
"type": "bugfix",
"description": "Correct resolution of S3Express auth disable toggle.",
"modules": [
"config"
]
}
20 changes: 10 additions & 10 deletions config/load_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ type LoadOptions struct {
// The sdk app ID retrieved from env var or shared config to be added to request user agent header
AppID string

// Whether S3 S3Beta2022a auth is disabled.
S3DisableS3Beta2022aAuth *bool
// Whether S3 Express auth is disabled.
S3DisableExpressAuth *bool
}

func (o LoadOptions) getDefaultsMode(ctx context.Context) (aws.DefaultsMode, bool, error) {
Expand Down Expand Up @@ -1048,21 +1048,21 @@ func WithDefaultsMode(mode aws.DefaultsMode, optFns ...func(options *DefaultsMod
}
}

// GetS3DisableS3Beta2022aAuth returns the configured value for
// [EnvConfig.S3DisableS3Beta2022aAuth].
func (o LoadOptions) GetS3DisableS3Beta2022aAuth() (value, ok bool) {
if o.S3DisableS3Beta2022aAuth == nil {
// GetS3DisableExpressAuth returns the configured value for
// [EnvConfig.S3DisableExpressAuth].
func (o LoadOptions) GetS3DisableExpressAuth() (value, ok bool) {
if o.S3DisableExpressAuth == nil {
return false, false
}

return *o.S3DisableS3Beta2022aAuth, true
return *o.S3DisableExpressAuth, true
}

// WithS3DisableS3Beta2022aAuth sets [LoadOptions.S3DisableS3Beta2022aAuth]
// WithS3DisableExpressAuth sets [LoadOptions.S3DisableExpressAuth]
// to the value provided.
func WithS3DisableS3Beta2022aAuth(v bool) LoadOptionsFunc {
func WithS3DisableExpressAuth(v bool) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.S3DisableS3Beta2022aAuth = &v
o.S3DisableExpressAuth = &v
return nil
}
}

0 comments on commit 94a3980

Please sign in to comment.