Skip to content

Commit

Permalink
Changing naming in auth options for bearer token to snake case
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Ihle <[email protected]>
  • Loading branch information
blurpy committed Jan 11, 2023
1 parent 960b2e0 commit e2bd366
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion git/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func NewAuthOptions(u url.URL, data map[string][]byte) (*AuthOptions, error) {
if len(data) > 0 {
opts.Username = string(data["username"])
opts.Password = string(data["password"])
opts.BearerToken = string(data["bearerToken"])
opts.BearerToken = string(data["bearer_token"])
opts.CAFile = data["caFile"]
opts.Identity = data["identity"]
opts.KnownHosts = data["known_hosts"]
Expand Down
12 changes: 6 additions & 6 deletions git/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ func TestAuthOptionsFromData(t *testing.T) {
name: "Sets values from Secret",
URL: "https://[email protected]",
data: map[string][]byte{
"username": []byte("example"), // This takes precedence over the one from the URL
"password": []byte("secret"),
"bearerToken": []byte("token"),
"identity": []byte(privateKeyFixture),
"known_hosts": []byte(knownHostsFixture),
"caFile": []byte("mock"),
"username": []byte("example"), // This takes precedence over the one from the URL
"password": []byte("secret"),
"bearer_token": []byte("token"),
"identity": []byte(privateKeyFixture),
"known_hosts": []byte(knownHostsFixture),
"caFile": []byte("mock"),
},

wantFunc: func(g *WithT, opts *AuthOptions) {
Expand Down

0 comments on commit e2bd366

Please sign in to comment.