-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrubygems-registry-openapi.yml
More file actions
566 lines (566 loc) · 17 KB
/
Copy pathrubygems-registry-openapi.yml
File metadata and controls
566 lines (566 loc) · 17 KB
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
openapi: 3.1.0
info:
title: RubyGems.org Registry API
description: >-
OpenAPI description of the public REST API for rubygems.org, the Ruby
community's gem hosting service. Covers the v1 surface documented at
https://guides.rubygems.org/rubygems-org-api/ and the v2 versions
endpoint documented at https://guides.rubygems.org/rubygems-org-api-v2/.
version: '1.0.0'
contact:
name: RubyGems.org Support
url: https://github.com/rubygems/rubygems.org
license:
name: MIT
url: https://github.com/rubygems/rubygems.org/blob/master/MIT-LICENSE
servers:
- url: https://rubygems.org
description: Production registry
tags:
- name: Gems
- name: Versions
- name: Downloads
- name: Owners
- name: Profiles
- name: Webhooks
- name: Activity
- name: API Keys
- name: OIDC
security:
- ApiKeyAuth: []
paths:
/api/v1/gems/{gem_name}.json:
get:
operationId: getGem
summary: Get Gem Info
description: Returns information about the named gem, including downloads, version, dependencies, and source URLs.
tags: [Gems]
parameters:
- $ref: '#/components/parameters/GemName'
responses:
'200':
description: Gem details
content:
application/json:
schema:
$ref: '#/components/schemas/Gem'
'404':
$ref: '#/components/responses/NotFound'
/api/v1/gems.json:
get:
operationId: listOwnedGems
summary: List Gems Owned By Authenticated User
description: Returns all gems owned by the authenticated user.
tags: [Gems]
security:
- ApiKeyAuth: []
responses:
'200':
description: Array of owned gems
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Gem'
post:
operationId: pushGem
summary: Push Gem
description: Submits a built .gem file for publication. Body is the binary gem file.
tags: [Gems]
security:
- ApiKeyAuth: []
requestBody:
required: true
content:
application/octet-stream:
schema:
type: string
format: binary
responses:
'200':
description: Gem accepted
content:
text/plain:
schema:
type: string
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
/api/v1/gems/yank:
delete:
operationId: yankVersion
summary: Yank A Version
description: Removes a specific gem version from the index so it can no longer be installed by default.
tags: [Gems]
security:
- ApiKeyAuth: []
parameters:
- name: gem_name
in: query
required: true
schema: { type: string }
- name: version
in: query
required: true
schema: { type: string }
- name: platform
in: query
required: false
schema: { type: string }
responses:
'200': { description: Yanked }
'404': { $ref: '#/components/responses/NotFound' }
/api/v1/search.json:
get:
operationId: searchGems
summary: Search Gems
description: Searches gems by name or description and returns matching gem summaries.
tags: [Gems]
parameters:
- name: query
in: query
required: true
schema: { type: string }
- name: page
in: query
required: false
schema: { type: integer, minimum: 1, default: 1 }
responses:
'200':
description: Search results
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Gem'
/api/v1/versions/{gem_name}.json:
get:
operationId: listVersions
summary: List All Versions Of A Gem
description: Returns every version of the named gem ordered most-recent first.
tags: [Versions]
parameters:
- $ref: '#/components/parameters/GemName'
responses:
'200':
description: Versions list
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Version'
/api/v1/versions/{gem_name}/latest.json:
get:
operationId: getLatestVersion
summary: Get Latest Version Of A Gem
description: Returns the latest stable version number for the named gem.
tags: [Versions]
parameters:
- $ref: '#/components/parameters/GemName'
responses:
'200':
description: Latest version
content:
application/json:
schema:
type: object
properties:
version: { type: string }
/api/v2/rubygems/{gem_name}/versions/{version}.json:
get:
operationId: getVersionDetails
summary: Get Gem Version Details
description: Returns full details for a specific gem version, optionally filtered by platform. This is the API v2 endpoint.
tags: [Versions]
parameters:
- $ref: '#/components/parameters/GemName'
- name: version
in: path
required: true
schema: { type: string }
- name: platform
in: query
required: false
schema: { type: string }
responses:
'200':
description: Version detail
content:
application/json:
schema:
$ref: '#/components/schemas/Version'
/api/v1/downloads/{gem_full_name}.json:
get:
operationId: getVersionDownloads
summary: Get Downloads For A Gem Version
description: Returns the total download count for a specific gem version (name plus version, e.g. "rails-7.1.3").
tags: [Downloads]
parameters:
- name: gem_full_name
in: path
required: true
schema: { type: string }
responses:
'200':
description: Download count
content:
application/json:
schema:
$ref: '#/components/schemas/DownloadCount'
/api/v1/downloads.json:
get:
operationId: getTotalDownloads
summary: Get Total Rubygems Download Count
description: Returns the total number of gem downloads ever counted across rubygems.org.
tags: [Downloads]
responses:
'200':
description: Total downloads
content:
application/json:
schema:
$ref: '#/components/schemas/TotalDownloads'
/api/v1/owners/{gem_name}.json:
get:
operationId: listOwners
summary: List Owners Of A Gem
description: Returns the owners (publishers) of the named gem.
tags: [Owners]
parameters:
- $ref: '#/components/parameters/GemName'
responses:
'200':
description: Owner list
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Owner'
post:
operationId: addOwner
summary: Add Owner To A Gem
description: Grants ownership of the gem to another rubygems.org user (by email).
tags: [Owners]
security:
- ApiKeyAuth: []
parameters:
- $ref: '#/components/parameters/GemName'
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
required: [email]
properties:
email: { type: string, format: email }
responses:
'200': { description: Owner added }
delete:
operationId: removeOwner
summary: Remove Owner From A Gem
description: Revokes ownership of the gem from the specified user.
tags: [Owners]
security:
- ApiKeyAuth: []
parameters:
- $ref: '#/components/parameters/GemName'
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
required: [email]
properties:
email: { type: string, format: email }
responses:
'200': { description: Owner removed }
/api/v1/profiles/me.json:
get:
operationId: getMyProfile
summary: Get Authenticated User Profile
description: Returns the profile of the authenticated user, including MFA level and handle.
tags: [Profiles]
security:
- ApiKeyAuth: []
responses:
'200':
description: Profile detail
content:
application/json:
schema:
$ref: '#/components/schemas/Profile'
/api/v1/web_hooks.json:
get:
operationId: listWebHooks
summary: List Web Hooks
description: Returns all webhooks registered for the authenticated user, grouped by gem.
tags: [Webhooks]
security:
- ApiKeyAuth: []
responses:
'200':
description: Webhook map
content:
application/json:
schema:
type: object
additionalProperties:
type: array
items:
$ref: '#/components/schemas/WebHook'
/api/v1/web_hooks:
post:
operationId: createWebHook
summary: Register A Web Hook
description: Registers a callback URL fired when a gem (or any gem) is published. Use "*" as the gem name to receive global events.
tags: [Webhooks]
security:
- ApiKeyAuth: []
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
required: [gem_name, url]
properties:
gem_name: { type: string }
url: { type: string, format: uri }
responses:
'200': { description: Webhook created }
/api/v1/web_hooks/remove:
delete:
operationId: removeWebHook
summary: Remove A Web Hook
description: Removes a previously registered webhook for the given gem and URL.
tags: [Webhooks]
security:
- ApiKeyAuth: []
parameters:
- name: gem_name
in: query
required: true
schema: { type: string }
- name: url
in: query
required: true
schema: { type: string, format: uri }
responses:
'200': { description: Webhook removed }
/api/v1/web_hooks/fire:
post:
operationId: fireWebHook
summary: Test Fire A Web Hook
description: Synchronously fires a registered webhook for testing purposes.
tags: [Webhooks]
security:
- ApiKeyAuth: []
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
required: [gem_name, url]
properties:
gem_name: { type: string }
url: { type: string, format: uri }
responses:
'200': { description: Webhook fired }
/api/v1/activity/latest.json:
get:
operationId: getLatestActivity
summary: Get Latest Gem Releases
description: Returns the most recently published gem versions.
tags: [Activity]
responses:
'200':
description: Latest activity feed
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Gem'
/api/v1/activity/just_updated.json:
get:
operationId: getJustUpdated
summary: Get Just Updated Gems
description: Returns gems that received a new version most recently.
tags: [Activity]
responses:
'200':
description: Just-updated feed
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Gem'
/api/v1/api_key.json:
get:
operationId: getApiKey
summary: Get An API Key
description: Exchanges HTTP Basic credentials for the authenticated user's API key.
tags: [API Keys]
security:
- BasicAuth: []
responses:
'200':
description: API key
content:
application/json:
schema:
type: object
properties:
rubygems_api_key: { type: string }
/api/v1/oidc/api_key_role/{token}/assume_role:
post:
operationId: assumeOidcRole
summary: Exchange OIDC Token For Trusted Publishing API Key
description: Exchanges a CI provider OIDC token (GitHub Actions, GitLab CI, etc.) for a short-lived RubyGems API key scoped by a configured trusted-publishing role.
tags: [OIDC]
parameters:
- name: token
in: path
required: true
schema: { type: string }
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [jwt]
properties:
jwt: { type: string }
responses:
'200':
description: Scoped, short-lived API key
content:
application/json:
schema:
type: object
properties:
rubygems_api_key: { type: string }
components:
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: Authorization
description: RubyGems API key issued in the user account settings.
BasicAuth:
type: http
scheme: basic
parameters:
GemName:
name: gem_name
in: path
required: true
description: Canonical gem name.
schema: { type: string }
responses:
NotFound:
description: Gem or resource not found.
Unauthorized:
description: Missing or invalid API key.
Forbidden:
description: Caller is not authorized for this gem.
schemas:
Gem:
type: object
properties:
name: { type: string }
downloads: { type: integer }
version: { type: string }
version_created_at: { type: string, format: date-time }
version_downloads: { type: integer }
platform: { type: string }
authors: { type: string }
info: { type: string }
licenses:
type: array
items: { type: string }
metadata:
type: object
additionalProperties: { type: string }
yanked: { type: boolean }
sha: { type: string }
project_uri: { type: string, format: uri }
gem_uri: { type: string, format: uri }
homepage_uri: { type: string, format: uri }
wiki_uri: { type: string, format: uri }
documentation_uri: { type: string, format: uri }
mailing_list_uri: { type: string, format: uri }
source_code_uri: { type: string, format: uri }
bug_tracker_uri: { type: string, format: uri }
changelog_uri: { type: string, format: uri }
funding_uri: { type: string, format: uri }
dependencies:
type: object
properties:
development:
type: array
items: { $ref: '#/components/schemas/Dependency' }
runtime:
type: array
items: { $ref: '#/components/schemas/Dependency' }
Version:
type: object
properties:
number: { type: string }
platform: { type: string }
created_at: { type: string, format: date-time }
downloads_count: { type: integer }
summary: { type: string }
description: { type: string }
authors: { type: string }
sha: { type: string }
prerelease: { type: boolean }
ruby_version: { type: string }
rubygems_version: { type: string }
licenses:
type: array
items: { type: string }
requirements:
type: array
items: { type: string }
Dependency:
type: object
properties:
name: { type: string }
requirements: { type: string }
DownloadCount:
type: object
properties:
total_downloads: { type: integer }
version_downloads: { type: integer }
TotalDownloads:
type: object
properties:
total: { type: integer }
Owner:
type: object
properties:
id: { type: integer }
handle: { type: string }
email: { type: string, format: email }
Profile:
type: object
properties:
handle: { type: string }
email: { type: string, format: email }
mfa: { type: string, enum: [disabled, ui_only, ui_and_api, ui_and_gem_signin] }
WebHook:
type: object
properties:
url: { type: string, format: uri }
failure_count: { type: integer }