Skip to content
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

fix: correct wiring of disable s3express auth toggle #2394

Merged
merged 2 commits into from
Nov 28, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: correct wiring of disable s3express auth toggle
lucix-aws committed Nov 28, 2023
commit 4a57952fd75ae6534f12329483e14a574433ff6a
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
@@ -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) {
@@ -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 WithS3DisableS3ExpressAuth(v bool) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.S3DisableS3Beta2022aAuth = &v
o.S3DisableExpressAuth = &v
return nil
}
}