Skip to content

Commit

Permalink
Ensure all string slice args get whitespace cleaned
Browse files Browse the repository at this point in the history
  • Loading branch information
moskyb committed Oct 3, 2024
1 parent ee70db6 commit fe814e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 0 additions & 5 deletions clicommand/oidc_request_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"net/http"
"strings"
"time"

"github.com/buildkite/agent/v3/api"
Expand Down Expand Up @@ -111,10 +110,6 @@ var OIDCRequestTokenCommand = cli.Command{
return fmt.Errorf("lifetime %d must be a non-negative integer.", cfg.Lifetime)
}

for i, claim := range cfg.Claims {
cfg.Claims[i] = strings.TrimSpace(claim)
}

// Create the API client
client := api.NewClient(l, loadAPIClientConfig(cfg, "AgentAccessToken"))

Expand Down
2 changes: 2 additions & 0 deletions cliconfig/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@ func (l Loader) normalizeField(fieldName string, normalization string) error {
continue
}

normalized = strings.TrimSpace(normalized)

normalizedSlice = append(normalizedSlice, normalized)
}
}
Expand Down

0 comments on commit fe814e2

Please sign in to comment.