Skip to content

Commit 41e188c

Browse files
committed
Improve documentation around authentication with GitLab. Closes #557
1 parent 8bc5606 commit 41e188c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

gitlab/config.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ func (c *Config) Client() (*gitlab.Client, error) {
6868
opts = append(opts, gitlab.WithBaseURL(c.BaseURL))
6969
}
7070

71-
// The OAuth method is also compatible with project/personal access tokens because they are all usable as Bearer tokens.
72-
// https://docs.gitlab.com/ee/api
71+
// The OAuth method is also compatible with project/group/personal access and job tokens because they are all usable as Bearer tokens.
72+
// Although the job token API access is very limited.
73+
// see https://docs.gitlab.com/ee/api#authentication
7374
client, err := gitlab.NewOAuthClient(c.Token, opts...)
7475
if err != nil {
7576
return nil, err

gitlab/provider.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ var descriptions map[string]string
123123

124124
func init() {
125125
descriptions = map[string]string{
126-
"token": "The OAuth2 token or project/personal access token used to connect to GitLab.",
126+
"token": "The OAuth2 Token, Project, Group, Personal Access Token or CI Job Token used to connect to GitLab. The OAuth method is used in this provider for authentication (using Bearer authorization token). See https://docs.gitlab.com/ee/api/#authentication for details",
127127

128128
"base_url": "The GitLab Base API URL",
129129

@@ -135,7 +135,7 @@ func init() {
135135

136136
"client_key": "File path to client key when GitLab instance is behind company proxy. File must contain PEM encoded data.",
137137

138-
"early_auth_check": "Try to authenticate with the `CurrentUser` endpoint during the provider initialization. (experimental, see docs)",
138+
"early_auth_check": "Try to authenticate with the `CurrentUser` endpoint during the provider initialization. Needs to be disabled for CI Job Tokens. (experimental, see docs)",
139139
}
140140
}
141141

0 commit comments

Comments
 (0)