blob: 9a1a6960eea2b30f1e77365623c584a647c75233 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
|
# 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
|