-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbase.yaml
More file actions
189 lines (161 loc) · 11.7 KB
/
Copy pathbase.yaml
File metadata and controls
189 lines (161 loc) · 11.7 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
openapi: 3.1.0
info:
title: npm Registry API
version: 1.0.0
license:
name: MIT
url: https://opensource.org/licenses/MIT
description: |
Welcome to the npm registry API documentation!
x-logo:
url: |
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAACyCAYAAAC0oD1PAAAAAXNSR0IArs4c6QAAAJZlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgExAAIAAAARAAAAWodpAAQAAAABAAAAbAAAAAAAAABIAAAAAQAAAEgAAAABQWRvYmUgSW1hZ2VSZWFkeQAAAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAfSgAwAEAAAAAQAAALIAAAAA7l/aDAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAi1pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDYuMC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwO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BAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECByYwP8ABJX2MCfo+K4AAAAASUVORK5CYII=
altText: npm logo
servers:
- url: https://registry.npmjs.org
tags:
- name: Introduction
x-displayName: Introduction
description: |
This is the API documentation for the npm registry. For information about the npm registry, website, and command-line interface (CLI), please refer to [https://docs.npmjs.com](https://docs.npmjs.com).
- name: Authentication
x-displayName: Authentication & Authorization
description: |
The npm registry API supports multiple types of bearer tokens for authentication:
**Token Types:**
**1. npm Session Token (`npmSessionToken`)**
Traditional npm session tokens created via `npm login`. These tokens:
- Are tied to a user account
- Inherit the user's permissions
- Have limited expiration
- **Required for:** User account management, token creation/management
**2. npm Access Token (`npmAccessToken`)**
Fine-grained tokens with specific permissions:
- Can be scoped to specific packages and organizations
- Can be scoped to specific operations (read, write, publish)
- Have configurable expiration
- **Supported for:** Most package operations where explicitly documented
**3. OIDC id_token (`oidcIdToken`)**
Tokens from supported Identity Providers (CI/CD systems):
- From GitHub Actions, GitLab CI, CircleCI, etc.
- Must have `aud` claim set to `npm:registry.npmjs.org`
- Short-lived tokens
- **Required for:** OIDC token exchange only
**4. OIDC Exchange Token (`oidcExchangeToken`)**
Short-lived tokens obtained from OIDC token exchange:
- Package-scoped permissions
- Limited lifetime (typically 1 hour)
- **Supported for:** Package publishing and management operations
**Endpoint Authorization:**
Each endpoint specifies which token types are accepted via security schemes.
Some endpoints may accept multiple token types, others are restricted to specific types.
**Example:**
- `/tokens` endpoint: Only accepts `npmSessionToken`
- `/oidc/token/exchange` endpoint: Only accepts `oidcIdToken`
- Package publishing: May accept `npmSessionToken`, `npmAccessToken`, or `oidcExchangeToken`
**Granular Access Tokens with `bypass_2fa`:**
Granular Access Tokens (GATs) created with `bypass_2fa: true` are
allowed to perform automation flows such as direct publish, but they
are **not** permitted to perform account-identity or governance write
operations. Requests to those endpoints authenticated with a
bypass-2FA GAT are rejected with `403 Forbidden` and must instead be
performed via an interactive 2FA challenge (npm website, or an npm
session token / non-bypass GAT with a valid `npm-otp`).
Operations rejected for bypass-2FA GATs include (non-exhaustive):
- Token management — `POST /-/npm/v1/tokens`, `DELETE /-/npm/v1/tokens/token/{token}`
- Account settings — change password, change email, change 2FA
configuration, generate recovery codes, update profile
- Package governance — `POST /-/package/{escapedPackageName}/access`,
`POST /-/package/{package}/trust`,
`DELETE /-/package/{package}/trust/{config-uuid}`,
maintainer edits, and package/binary deletion (unpublish)
- Org and team governance —
`PUT`/`DELETE /-/org/{orgName}/user`,
`PUT /-/org/{orgName}/team`,
`DELETE /-/org/{orgName}/{teamName}`,
`PUT`/`DELETE /-/org/{orgName}/{teamName}/user`,
`PUT`/`DELETE /-/team/{orgName}/{teamName}/package`
Direct publish (`PUT /{escapedPackageName}`) remains functional for
bypass-2FA GATs.
- name: Tokens
x-displayName: Tokens
description: |
Token management endpoints for creating, listing, and deleting npm access tokens.
- name: OIDC
x-displayName: OIDC
description: |
OpenID Connect (OIDC) token exchange endpoints for CI/CD integrations.
- name: Trust
x-displayName: Trust
description: |
Trust-related endpoints for managing package trust and security settings.
x-tagGroups:
- name: Introduction
tags:
- Introduction
- name: Authentication & Authorization
tags:
- Authentication
- name: Sections
tags:
- Access
- Audit
- OIDC
- Org
- Publish
- Search
- Stage
- Team
- Tokens
- Trust
components:
securitySchemes:
# OIDC id_token from supported Identity Providers (GitHub Actions, GitLab CI, etc.)
oidcIdToken:
type: http
scheme: bearer
bearerFormat: JWT
description: |
OIDC id_token from a supported Identity Provider (IdP) such as GitHub Actions, GitLab CI, or CircleCI.
The `aud` (audience) claim must be set to `npm:registry.npmjs.org`.
**Supported Identity Providers:**
- GitHub Actions
- GitLab CI
- CircleCI
# Traditional npm user access tokens
npmSessionToken:
type: http
scheme: bearer
description: |
Traditional npm session token created via `npm login`.
These tokens are tied to a user account and inherit the user's permissions.
# Granular Access Tokens (GAT) - fine-grained tokens with specific permissions
npmAccessToken:
type: http
scheme: bearer
description: |
Granular Access Token (GAT) with fine-grained permissions.
These tokens can be scoped to specific packages and operations.
GATs created with `bypass_2fa: true` cannot perform account,
token, or org/team/package governance write operations — those
requests are rejected with `403 Forbidden`. See the Authentication
section above for the full list.
# Alias for npmAccessToken - for backward compatibility
granularAccessToken:
type: http
scheme: bearer
description: |
Granular Access Token (GAT) with fine-grained permissions.
These tokens can be scoped to specific packages and operations.
(Alias for npmAccessToken)
GATs created with `bypass_2fa: true` cannot perform account,
token, or org/team/package governance write operations — those
requests are rejected with `403 Forbidden`.
# Short-lived tokens obtained from OIDC token exchange
oidcExchangeToken:
type: http
scheme: bearer
description: |
Short-lived npm registry token obtained by exchanging an OIDC id_token
via the `/oidc/token/exchange` endpoint. These tokens are package-scoped
and have limited lifetime (typically 1 hour).