Skip to content

Commit 49fae96

Browse files
authored
Merge pull request #1624 from axl89/docs-clarification
Clarified CI Job Token auth() caveats
2 parents 7753fa2 + 3f423ef commit 49fae96

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/api-usage.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ To connect to GitLab.com or another GitLab instance, create a ``gitlab.Gitlab``
2929
gl = gitlab.Gitlab('https://gitlab.example.com', oauth_token='my_long_token_here')
3030
3131
# job token authentication (to be used in CI)
32+
# bear in mind the limitations of the API endpoints it supports:
33+
# https://docs.gitlab.com/ee/ci/jobs/ci_job_token.html
3234
import os
3335
gl = gitlab.Gitlab('https://gitlab.example.com', job_token=os.environ['CI_JOB_TOKEN'])
3436
3537
# Define your own custom user agent for requests
3638
gl = gitlab.Gitlab('https://gitlab.example.com', user_agent='my-package/1.0.0')
3739
3840
# make an API request to create the gl.user object. This is mandatory if you
39-
# use the username/password authentication.
41+
# use the username/password authentication - not required for token authentication,
42+
# and will not work with job tokens.
4043
gl.auth()
4144
4245
You can also use configuration files to create ``gitlab.Gitlab`` objects:

0 commit comments

Comments
 (0)