summaryrefslogtreecommitdiff
path: root/doc/user/project/deploy_tokens
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2018-03-31 18:11:28 -0600
committerMayra Cabrera <mcabrera@gitlab.com>2018-04-06 21:20:16 -0500
commit560ed9223596b6587889efe0d996b8788543ec85 (patch)
tree86d2031c0469b0a4560afb1722c49234300089ee /doc/user/project/deploy_tokens
parentaaa6d80870d5215390a7cd919d91309e5a8795b7 (diff)
downloadgitlab-ce-560ed9223596b6587889efe0d996b8788543ec85.tar.gz
Add documentation for DeployToken
Diffstat (limited to 'doc/user/project/deploy_tokens')
-rw-r--r--doc/user/project/deploy_tokens/img/deploy_tokens.pngbin0 -> 73260 bytes
-rw-r--r--doc/user/project/deploy_tokens/index.md72
2 files changed, 72 insertions, 0 deletions
diff --git a/doc/user/project/deploy_tokens/img/deploy_tokens.png b/doc/user/project/deploy_tokens/img/deploy_tokens.png
new file mode 100644
index 00000000000..4cf2e5ca612
--- /dev/null
+++ b/doc/user/project/deploy_tokens/img/deploy_tokens.png
Binary files differ
diff --git a/doc/user/project/deploy_tokens/index.md b/doc/user/project/deploy_tokens/index.md
new file mode 100644
index 00000000000..c82d490ef81
--- /dev/null
+++ b/doc/user/project/deploy_tokens/index.md
@@ -0,0 +1,72 @@
+# Deploy Tokens
+
+> [Introduced][ce-17894] in GitLab 10.7.
+
+Deploy tokens allow to download (through `git clone`), or read the container registry images of a project without the need of having a user and a password.
+
+Please note, that the expiration of deploy tokens happens on the date you define,
+at midnight UTC and that they can be only managed by [masters](https://docs.gitlab.com/ee/user/permissions.html).
+
+## Creating a personal access token
+
+You can create as many deploy tokens as you like from the settings of your project:
+
+1. Log in to your GitLab account.
+1. Go to the project you want to create Deploy Tokens for.
+1. Go to **Settings** > **Repository**
+1. Click on "Expand" on **Deploy Tokens** section
+1. Choose a name and optionally an expiry date for the token.
+1. Choose the [desired scopes](#limiting-scopes-of-a-deploy-token).
+1. Click on **Create deploy token**.
+1. Save the deploy token somewhere safe. Once you leave or refresh
+ the page, **you won't be able to access it again**.
+
+![Personal access tokens page](img/deploy_tokens.png)
+
+## Revoking a personal access token
+
+At any time, you can revoke any deploy token by just clicking the
+respective **Revoke** button under the 'Active deploy tokens' area.
+
+## Limiting scopes of a deploy token
+
+Deploy tokens can be created with two different scopes that allow various
+actions that a given token can perform. The available scopes are depicted in
+the following table.
+
+| Scope | Description |
+| ----- | ----------- |
+|`read_repo` | Allows read-access to the repository through `git clone` |
+| `read_registry` | Allows read-access to[container registry] images if a project is private and authorization is required. |
+
+## Usage
+
+### Git clone a repository
+
+To download a repository using a Deploy Token, you just need to:
+
+1. Create a Deploy Token with `read_repo` as a scope.
+2. `git clone` the project using the Deploy Token:
+
+
+```bash
+git clone http://oauth2:<deploy_token>@gitlab.example.com/tanuki/awesome_project.git
+```
+
+Just replace `<deploy_token>` with your real token.
+
+### Read container registry images
+
+To read the container registry images, you'll need to:
+
+1. Create a Deploy Token with `read_registry` as a scope.
+2. Log in to GitLab’s Container Registry using the deploy token:
+
+```
+docker login registry.example.com -u <username> -p <deploy_token>
+```
+Just replace `<username>` and `<deploy_token>` with the proper values.
+
+[ce-17894]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17894
+[ce-11845]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11845
+[container registry]: ../project/container_registry.md