Skip to content

Commit

Permalink
Merge pull request #141 from wot-oss/fix/repo-set-auth-bearer
Browse files Browse the repository at this point in the history
fix: set bearer token value to a string when parameter is not keyed
  • Loading branch information
enricoschuetz authored Dec 13, 2024
2 parents ad7ba80 + a4105da commit b4c925d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/app/cli/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,12 @@ func RepoSetAuth(name, kind string, data []string) error {
confValues := parseNamedArgs(data)
err := assertNamedArgs(confValues, []string{"token"})
if err != nil {
var token string
if len(data) > 0 {
token = data[0]
}
rc[repos.KeyRepoAuth] = map[string]any{
repos.AuthMethodBearerToken: data,
repos.AuthMethodBearerToken: token,
}
} else {
rc[repos.KeyRepoAuth] = map[string]any{
Expand Down

0 comments on commit b4c925d

Please sign in to comment.