Skip to content

Commit 746c25f

Browse files
committed
Clarified CI Job Token auth. caveats
See issue #1620
1 parent 7753fa2 commit 746c25f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/api-usage.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,16 @@ 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 job token authentication).
4042
gl.auth()
4143
4244
You can also use configuration files to create ``gitlab.Gitlab`` objects:

0 commit comments

Comments
 (0)