diff options
author | Mathieu Parent <math.parent@gmail.com> | 2019-09-05 10:47:34 +0200 |
---|---|---|
committer | Mathieu Parent <math.parent@gmail.com> | 2019-09-06 13:41:36 +0200 |
commit | cef3aa51a6928338c6755c3e6de78605fae8e59e (patch) | |
tree | 8f28490690f673a6e4a2efea77221dd503a2b20d /docs | |
parent | b7f33429c75ed2f464ebd9b4d3c56d3479df3faa (diff) | |
download | gitlab-cef3aa51a6928338c6755c3e6de78605fae8e59e.tar.gz |
feat: add support for job token
See https://docs.gitlab.com/ee/api/jobs.html#get-job-artifacts for usage
Diffstat (limited to 'docs')
-rw-r--r-- | docs/api-usage.rst | 4 | ||||
-rw-r--r-- | docs/cli.rst | 13 |
2 files changed, 12 insertions, 5 deletions
diff --git a/docs/api-usage.rst b/docs/api-usage.rst index 2f75584..19b9593 100644 --- a/docs/api-usage.rst +++ b/docs/api-usage.rst @@ -19,6 +19,10 @@ To connect to a GitLab server, create a ``gitlab.Gitlab`` object: # oauth token authentication gl = gitlab.Gitlab('http://10.0.0.1', oauth_token='my_long_token_here') + # job token authentication (to be used in CI) + import os + gl = gitlab.Gitlab('http://10.0.0.1', job_token=os.environ['CI_JOB_TOKEN']) + # username/password authentication (for GitLab << 10.2) gl = gitlab.Gitlab('http://10.0.0.1', email='jdoe', password='s3cr3t') diff --git a/docs/cli.rst b/docs/cli.rst index 2051d03..defbf02 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -83,9 +83,9 @@ You must define the ``url`` in each GitLab server section. If the GitLab server you are using redirects requests from http to https, make sure to use the ``https://`` protocol in the ``url`` definition. -Only one of ``private_token`` or ``oauth_token`` should be defined. If neither -are defined an anonymous request will be sent to the Gitlab server, with very -limited permissions. +Only one of ``private_token``, ``oauth_token`` or ``job_token`` should be +defined. If neither are defined an anonymous request will be sent to the Gitlab +server, with very limited permissions. .. list-table:: GitLab server options :header-rows: 1 @@ -96,10 +96,12 @@ limited permissions. - URL for the GitLab server * - ``private_token`` - Your user token. Login/password is not supported. Refer to `the official - documentation`__ to learn how to obtain a token. + documentation`_pat to learn how to obtain a token. * - ``oauth_token`` - An Oauth token for authentication. The Gitlab server must be configured to support this authentication method. + * - ``job_token`` + - Your job token. See `the official documentation`_job-token to learn how to obtain a token. * - ``api_version`` - GitLab API version to use (``3`` or ``4``). Defaults to ``4`` since version 1.3.0. @@ -108,7 +110,8 @@ limited permissions. * - ``http_password`` - Password for optional HTTP authentication -__ https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html +.. _pat: https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html +.. _job-token: https://docs.gitlab.com/ce/api/jobs.html#get-job-artifacts CLI === |