| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,14 +29,17 @@ To connect to GitLab.com or another GitLab instance, create a ``gitlab.Gitlab`` | |||
| 29 | 29 | gl = gitlab.Gitlab('https://gitlab.example.com', oauth_token='my_long_token_here') | |
| 30 | 30 | ||
| 31 | 31 | # 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 | ||
| 32 | 34 | import os | |
| 33 | 35 | gl = gitlab.Gitlab('https://gitlab.example.com', job_token=os.environ['CI_JOB_TOKEN']) | |
| 34 | 36 | ||
| 35 | 37 | # Define your own custom user agent for requests | |
| 36 | 38 | gl = gitlab.Gitlab('https://gitlab.example.com', user_agent='my-package/1.0.0') | |
| 37 | 39 | ||
| 38 | 40 | # 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. | ||
| 40 | 43 | gl.auth() | |
| 41 | 44 | ||
| 42 | 45 | You can also use configuration files to create ``gitlab.Gitlab`` objects: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments