From 5ba8716dda99a8c60af906f6e0a4540bec27395c Mon Sep 17 00:00:00 2001 From: Ben Bodenmiller Date: Sun, 18 Aug 2019 23:15:22 +0000 Subject: add GitLab CI job token API authentication section --- doc/api/README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'doc/api/README.md') diff --git a/doc/api/README.md b/doc/api/README.md index b7ee710b87a..9156d719e11 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -77,11 +77,12 @@ authentication is not provided. For those cases where it is not required, this will be mentioned in the documentation for each individual endpoint. For example, the [`/projects/:id` endpoint](projects.md). -There are three ways to authenticate with the GitLab API: +There are four ways to authenticate with the GitLab API: 1. [OAuth2 tokens](#oauth2-tokens) 1. [Personal access tokens](#personal-access-tokens) 1. [Session cookie](#session-cookie) +1. [GitLab CI job token](#gitlab-ci-job-token-premium) **(PREMIUM)** For admins who want to authenticate with the API as a specific user, or who want to build applications or scripts that do so, two options are available: @@ -151,6 +152,14 @@ The primary user of this authentication method is the web frontend of GitLab its which can use the API as the authenticated user to get a list of their projects, for example, without needing to explicitly pass an access token. +### GitLab CI job token **(PREMIUM)** + +With a few API endpoints you can use a [GitLab CI job token](../user/project/new_ci_build_permissions_model.md#job-token) +to authenticate with the API: + +* [Get job artifacts](jobs.md#get-job-artifacts) +* [Pipeline triggers](pipeline_triggers.md) + ### Impersonation tokens > [Introduced][ce-9099] in GitLab 9.0. Needs admin permissions. -- cgit v1.2.1 From d2cb8f785edb6fbc9ce00c39d485423d45c0c219 Mon Sep 17 00:00:00 2001 From: Marcel Amirault Date: Thu, 22 Aug 2019 08:50:31 +0000 Subject: Update docs to pass new markdownlint Deletes extra spaces and line, makes lists consistent, and fixes links. --- doc/api/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/api/README.md') diff --git a/doc/api/README.md b/doc/api/README.md index 9156d719e11..33394d46a2d 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -157,8 +157,8 @@ for example, without needing to explicitly pass an access token. With a few API endpoints you can use a [GitLab CI job token](../user/project/new_ci_build_permissions_model.md#job-token) to authenticate with the API: -* [Get job artifacts](jobs.md#get-job-artifacts) -* [Pipeline triggers](pipeline_triggers.md) +- [Get job artifacts](jobs.md#get-job-artifacts) +- [Pipeline triggers](pipeline_triggers.md) ### Impersonation tokens -- cgit v1.2.1 From 47dff5edd80a31c82d525a47ff12f81cb0d3f3bc Mon Sep 17 00:00:00 2001 From: Nourdin el Bacha Date: Fri, 23 Aug 2019 18:15:10 +0000 Subject: Improve grammar and correct syntax in curl example --- doc/api/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/api/README.md') diff --git a/doc/api/README.md b/doc/api/README.md index 33394d46a2d..036b46da6e5 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -396,7 +396,7 @@ GET /api/v4/projects/diaspora%2Fdiaspora NOTE: **Note:** A project's **path** is not necessarily the same as its **name**. A -project's path can found in the project's URL or in the project's settings +project's path can be found in the project's URL or in the project's settings under **General > Advanced > Change path**. ## Branches and tags name encoding @@ -422,7 +422,7 @@ We can call the API with `array` and `hash` types parameters as shown below: curl --request POST --header "PRIVATE-TOKEN: " \ -d "import_sources[]=github" \ -d "import_sources[]=bitbucket" \ -"https://gitlab.example.com/api/v4/some_endpoint +https://gitlab.example.com/api/v4/some_endpoint ``` ### `hash` -- cgit v1.2.1