Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1ead684a
Commit
1ead684a
authored
May 06, 2021
by
Jim Cser
Committed by
Max Woolf
May 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documentation: Adds access token endpoints to OpenAPI
parent
c4ef6fee
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
187 additions
and
2 deletions
+187
-2
changelogs/unreleased/jimcser-add-access-token.yml
changelogs/unreleased/jimcser-add-access-token.yml
+5
-0
doc/api/openapi/openapi.yaml
doc/api/openapi/openapi.yaml
+11
-2
doc/api/openapi/v4/access_tokens.yaml
doc/api/openapi/v4/access_tokens.yaml
+170
-0
doc/api/resource_access_tokens.md
doc/api/resource_access_tokens.md
+1
-0
No files found.
changelogs/unreleased/jimcser-add-access-token.yml
0 → 100644
View file @
1ead684a
---
title
:
Adds access token endpoints to OpenAPI
merge_request
:
58620
author
:
jimcser
type
:
added
doc/api/openapi/openapi.yaml
View file @
1ead684a
...
@@ -4,6 +4,8 @@ tags:
...
@@ -4,6 +4,8 @@ tags:
description
:
Version
description
:
Version
-
name
:
access_requests
-
name
:
access_requests
description
:
Access requests for projects and groups
description
:
Access requests for projects and groups
-
name
:
access_tokens
description
:
Access tokens for projects
info
:
info
:
description
:
|
description
:
|
An OpenAPI definition for the GitLab REST API.
An OpenAPI definition for the GitLab REST API.
...
@@ -16,7 +18,8 @@ info:
...
@@ -16,7 +18,8 @@ info:
The feature uses the current [GitLab session cookie](https://docs.gitlab.com/ee/api/README.html#session-cookie),
The feature uses the current [GitLab session cookie](https://docs.gitlab.com/ee/api/README.html#session-cookie),
so each request is made using your account.
so each request is made using your account.
Read more at <https://docs.gitlab.com/ee/development/documentation/restful_api_styleguide.html>.
Instructions for using this tool can be found in [Interactive API Documentation](openapi_interactive.md).
version
:
v4
version
:
v4
title
:
GitLab API
title
:
GitLab API
termsOfService
:
'
https://about.gitlab.com/terms/'
termsOfService
:
'
https://about.gitlab.com/terms/'
...
@@ -57,6 +60,12 @@ paths:
...
@@ -57,6 +60,12 @@ paths:
/v4/groups/{id}/access_requests/{user_id}/approve
:
/v4/groups/{id}/access_requests/{user_id}/approve
:
$ref
:
'
v4/access_requests.yaml#/accessRequestsGroupsApprove'
$ref
:
'
v4/access_requests.yaml#/accessRequestsGroupsApprove'
/v4/groups
s
/{id}/access_requests/{user_id}
:
/v4/groups/{id}/access_requests/{user_id}
:
$ref
:
'
v4/access_requests.yaml#/accessRequestsGroupsDeny'
$ref
:
'
v4/access_requests.yaml#/accessRequestsGroupsDeny'
# ACCESS REQUESTS (PROJECTS)
/v4/projects/{id}/access_tokens
:
$ref
:
'
v4/access_tokens.yaml#/accessTokens'
/v4/projects/{id}/access_tokens/{token_id}
:
$ref
:
'
v4/access_tokens.yaml#/accessTokensRevoke'
\ No newline at end of file
doc/api/openapi/v4/access_tokens.yaml
0 → 100644
View file @
1ead684a
# Markdown documentation: https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/api/resource_access_tokens.md
#/v4/projects/{id}/access_tokens
accessTokens
:
get
:
description
:
Lists access tokens for a project
summary
:
List access tokens for a project
operationId
:
accessTokens_get
tags
:
-
access_tokens
parameters
:
-
name
:
id
in
:
path
description
:
The ID or URL-encoded path of the project
required
:
true
schema
:
oneOf
:
-
type
:
integer
-
type
:
string
responses
:
'
404'
:
description
:
Not Found
'
401'
:
description
:
Unauthorized operation
'
200'
:
description
:
Successful operation
content
:
application/json
:
schema
:
title
:
AccessTokenList
type
:
object
properties
:
user_id
:
type
:
integer
scopes
:
type
:
array
name
:
type
:
string
expires_at
:
type
:
date
id
:
type
:
integer
active
:
type
:
boolean
created_at
:
type
:
date
revoked
:
type
:
boolean
example
:
"
user_id"
:
141
"
scopes"
:
[
"
api"
]
"
name"
:
"
token"
"
expires_at"
:
"
2022-01-31"
"
id"
:
42
"
active"
:
true
"
created_at"
:
"
2021-01-20T14:13:35Z"
"
revoked"
:
false
post
:
description
:
Creates an access token for a project
summary
:
Creates an access token for a project
operationId
:
accessTokens_post
tags
:
-
access_tokens
parameters
:
-
name
:
id
in
:
path
description
:
The ID or URL-encoded path of the project
required
:
true
schema
:
oneOf
:
-
type
:
integer
-
type
:
string
-
name
:
name
in
:
query
description
:
The name of the project access token
required
:
true
schema
:
type
:
string
-
name
:
scopes
in
:
query
description
:
Defines read and write permissions for the token
required
:
true
schema
:
type
:
array
items
:
type
:
string
enum
:
[
"
api"
,
"
read_api"
,
"
read_registry"
,
"
write_registry"
,
"
read_repository"
,
"
write_repository"
]
-
name
:
expires_at
in
:
query
description
:
Date when the token expires. Time of day is Midnight UTC of that date.
required
:
false
schema
:
type
:
date
responses
:
'
404'
:
description
:
Not Found
'
401'
:
description
:
Unauthorized operation
'
200'
:
description
:
Successful operation
content
:
application/json
:
schema
:
title
:
AccessTokenList
type
:
object
properties
:
user_id
:
type
:
integer
scopes
:
type
:
array
name
:
type
:
string
expires_at
:
type
:
date
id
:
type
:
integer
active
:
type
:
boolean
created_at
:
type
:
date
revoked
:
type
:
boolean
token
:
type
:
string
example
:
"
user_id"
:
166
"
scopes"
:
[
"
api"
,
"
read_repository"
]
"
name"
:
"
test"
"
expires_at"
:
"
2022-01-31"
"
id"
:
58
"
active"
:
true
"
created_at"
:
"
2021-01-20T14:13:35Z"
"
revoked"
:
false
"
token"
:
"
D4y...Wzr"
#/v4/projects/{id}/access_tokens/{token_id}
accessTokensRevoke
:
delete
:
description
:
Revokes an access token
summary
:
Revokes an access token
operationId
:
accessTokens_delete
tags
:
-
access_tokens
parameters
:
-
name
:
id
in
:
path
description
:
The ID or URL-encoded path of the project
required
:
true
schema
:
oneOf
:
-
type
:
integer
-
type
:
string
-
name
:
token_id
in
:
path
description
:
The ID of the project access token
required
:
true
schema
:
oneOf
:
-
type
:
integer
-
type
:
string
responses
:
'
400'
:
description
:
Bad Request
'
404'
:
description
:
Not Found
'
204'
:
description
:
No content if successfully revoked
doc/api/resource_access_tokens.md
View file @
1ead684a
...
@@ -55,6 +55,7 @@ POST projects/:id/access_tokens
...
@@ -55,6 +55,7 @@ POST projects/:id/access_tokens
| Attribute | Type | required | Description |
| Attribute | Type | required | Description |
|-----------|---------|----------|---------------------|
|-----------|---------|----------|---------------------|
|
`id`
| integer/string | yes | The ID of the project |
|
`name`
| String | yes | The name of the project access token |
|
`name`
| String | yes | The name of the project access token |
|
`scopes`
| Array
\[
String] | yes |
[
List of scopes
](
../user/project/settings/project_access_tokens.md#limiting-scopes-of-a-project-access-token
)
|
|
`scopes`
| Array
\[
String] | yes |
[
List of scopes
](
../user/project/settings/project_access_tokens.md#limiting-scopes-of-a-project-access-token
)
|
|
`expires_at`
| Date | no | The token expires at midnight UTC on that date |
|
`expires_at`
| Date | no | The token expires at midnight UTC on that date |
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment