File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,8 @@ resource "gitlab_project" "sample_group_project" {
57
57
58
58
The following arguments are supported in the ` provider ` block:
59
59
60
- * ` token ` - (Optional) This is the GitLab personal access token. It must be provided, but
61
- it can also be sourced from the ` GITLAB_TOKEN ` environment variable.
60
+ * ` token ` - (Required) The OAuth2 token or project/ personal access token used to connect to GitLab.
61
+ It must be provided, but it can also be sourced from the ` GITLAB_TOKEN ` environment variable.
62
62
63
63
* ` base_url ` - (Optional) This is the target GitLab base API endpoint. Providing a value is a
64
64
requirement when working with GitLab CE or GitLab Enterprise e.g. ` https://my.gitlab.server/api/v4/ ` .
Original file line number Diff line number Diff line change @@ -67,7 +67,9 @@ func (c *Config) Client() (*gitlab.Client, error) {
67
67
opts = append (opts , gitlab .WithBaseURL (c .BaseURL ))
68
68
}
69
69
70
- client , err := gitlab .NewClient (c .Token , opts ... )
70
+ // The OAuth method is also compatible with project/personal access tokens because they are all usable as Bearer tokens.
71
+ // https://docs.gitlab.com/ee/api
72
+ client , err := gitlab .NewOAuthClient (c .Token , opts ... )
71
73
if err != nil {
72
74
return nil , err
73
75
}
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ var descriptions map[string]string
112
112
113
113
func init () {
114
114
descriptions = map [string ]string {
115
- "token" : "The OAuth token used to connect to GitLab." ,
115
+ "token" : "The OAuth2 token or project/personal access token used to connect to GitLab." ,
116
116
117
117
"base_url" : "The GitLab Base API URL" ,
118
118
You can’t perform that action at this time.
0 commit comments