-
Notifications
You must be signed in to change notification settings - Fork 302
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
Ensure all string slice args have whitespace cleaned off of each element #3021
Conversation
This allows users to use: buildkite-agent oidc request-token --claim 'this, that, the-other' where previously, even if `that` and `the-other` were allowed optional claims, they'd be rejected, as they'd be sent to buildkite with their preceeding whitespace
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.
Nice idea!
Want to do the same to AWSSessionTags
?
Can we add a test?
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.
✅
cliconfig/loader.go
Outdated
@@ -225,7 +225,11 @@ func (l Loader) setFieldValueFromCLI(fieldName string, cliName string) error { | |||
case reflect.String: | |||
value = configFileValue | |||
case reflect.Slice: | |||
value = strings.Split(configFileValue, ",") | |||
valueSlice := strings.Split(configFileValue, ",") |
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.
Good move, it seems very unlikely that any string list will be dependent on whitespace.
3338f3d
to
fe814e2
Compare
@DrJosh9000 i've updated this so that it's the i would love to have a couple of days free to unwind |
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.
Even better!
This allows users to use:
where previously, even if
that
andthe-other
were allowed optional claims, they'd be rejected, as they'd be sent to buildkite with their preceeding whitespaceTesting
go test ./...
). Buildkite employees may check this if the pipeline has run automatically.go fmt ./...
)