Skip to content

Commit 84d729e

Browse files
authored
Merge pull request #803 from timofurrer/doc/auth
Improve documentation around authentication with GitLab. Closes #557
2 parents a9edc4a + 41e188c commit 84d729e

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
@@ -124,7 +124,7 @@ var descriptions map[string]string
124124

125125
func init() {
126126
descriptions = map[string]string{
127-
"token": "The OAuth2 token or project/personal access token used to connect to GitLab.",
127+
"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",
128128

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

@@ -136,7 +136,7 @@ func init() {
136136

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

139-
"early_auth_check": "Try to authenticate with the `CurrentUser` endpoint during the provider initialization. (experimental, see docs)",
139+
"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)",
140140
}
141141
}
142142

0 commit comments

Comments
 (0)