Skip to content

Commit

Permalink
tests and UI clarifications
Browse files Browse the repository at this point in the history
Signed-off-by: reggie-k <[email protected]>
  • Loading branch information
reggie-k committed Feb 10, 2025
1 parent d725f5d commit 5659e07
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const RepoDetails = (props: {repo: models.Repository; save?: (params: New

if (repository.type === 'git') {
items.push({
title: 'Bearer token (optional)',
title: 'Bearer token (optional, for BitBucket only)',
view: repository.bearerToken ? '******' : '',
edit: (formApi: FormApi) => <FormField formApi={formApi} field='bearerToken' component={Text} componentProps={{type: 'password'}} />
});
Expand Down
4 changes: 2 additions & 2 deletions ui/src/app/settings/components/repos-list/repos-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export class ReposList extends React.Component<
password: !httpsValues.password && httpsValues.username && 'Password is required if username is given.',
bearerToken:
(httpsValues.password && httpsValues.bearerToken && 'Either the password or the bearer token must be set, but not both.') ||
(httpsValues.type != 'git' && 'Bearer token is only supported for Git repositories'),
(httpsValues.type != 'git' && 'Bearer token is only supported for Git BitBucket repositories'),
tlsClientCertKey: !httpsValues.tlsClientCertKey && httpsValues.tlsClientCertData && 'TLS client cert key is required if TLS client cert is given.'
};
case ConnectionMethod.GITHUBAPP:
Expand Down Expand Up @@ -690,7 +690,7 @@ export class ReposList extends React.Component<
<div className='argo-form-row'>
<FormField
formApi={formApi}
label='Bearer token (optional)'
label='Bearer token (optional, for BitBucket only)'
field='bearerToken'
component={Text}
componentProps={{type: 'password'}}
Expand Down
3 changes: 1 addition & 2 deletions util/git/creds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ func TestHTTPSCreds_Environ_bearerTokenAuth(t *testing.T) {
break
}
}
b64enc := base64.StdEncoding.EncodeToString([]byte("token"))
assert.Equal(t, "Authorization: Bearer "+b64enc, header)
assert.Equal(t, "Authorization: Bearer token", header)
})
}

Expand Down

0 comments on commit 5659e07

Please sign in to comment.