Skip to content

Commit 5659e07

Browse files
committed
tests and UI clarifications
Signed-off-by: reggie-k <[email protected]>
1 parent d725f5d commit 5659e07

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

ui/src/app/settings/components/repo-details/repo-details.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const RepoDetails = (props: {repo: models.Repository; save?: (params: New
3939

4040
if (repository.type === 'git') {
4141
items.push({
42-
title: 'Bearer token (optional)',
42+
title: 'Bearer token (optional, for BitBucket only)',
4343
view: repository.bearerToken ? '******' : '',
4444
edit: (formApi: FormApi) => <FormField formApi={formApi} field='bearerToken' component={Text} componentProps={{type: 'password'}} />
4545
});

ui/src/app/settings/components/repos-list/repos-list.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export class ReposList extends React.Component<
218218
password: !httpsValues.password && httpsValues.username && 'Password is required if username is given.',
219219
bearerToken:
220220
(httpsValues.password && httpsValues.bearerToken && 'Either the password or the bearer token must be set, but not both.') ||
221-
(httpsValues.type != 'git' && 'Bearer token is only supported for Git repositories'),
221+
(httpsValues.type != 'git' && 'Bearer token is only supported for Git BitBucket repositories'),
222222
tlsClientCertKey: !httpsValues.tlsClientCertKey && httpsValues.tlsClientCertData && 'TLS client cert key is required if TLS client cert is given.'
223223
};
224224
case ConnectionMethod.GITHUBAPP:
@@ -690,7 +690,7 @@ export class ReposList extends React.Component<
690690
<div className='argo-form-row'>
691691
<FormField
692692
formApi={formApi}
693-
label='Bearer token (optional)'
693+
label='Bearer token (optional, for BitBucket only)'
694694
field='bearerToken'
695695
component={Text}
696696
componentProps={{type: 'password'}}

util/git/creds_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,7 @@ func TestHTTPSCreds_Environ_bearerTokenAuth(t *testing.T) {
183183
break
184184
}
185185
}
186-
b64enc := base64.StdEncoding.EncodeToString([]byte("token"))
187-
assert.Equal(t, "Authorization: Bearer "+b64enc, header)
186+
assert.Equal(t, "Authorization: Bearer token", header)
188187
})
189188
}
190189

0 commit comments

Comments
 (0)