@dokebi/oauth 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AI.md +469 -0
- package/LICENSE +21 -0
- package/README.md +41 -2
- package/dist/bounded.d.ts +9 -0
- package/dist/bounded.js +36 -0
- package/dist/cimd.d.ts +97 -0
- package/dist/cimd.js +384 -0
- package/dist/clients.d.ts +85 -0
- package/dist/clients.js +303 -0
- package/dist/dependency.d.ts +4 -0
- package/dist/dependency.js +14 -0
- package/dist/errors.d.ts +87 -0
- package/dist/errors.js +34 -0
- package/dist/extension.d.ts +161 -0
- package/dist/extension.js +108 -0
- package/dist/grants.d.ts +126 -0
- package/dist/grants.js +280 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.js +28 -0
- package/dist/install.d.ts +33 -0
- package/dist/install.js +112 -0
- package/dist/live.d.ts +47 -0
- package/dist/live.js +105 -0
- package/dist/options.d.ts +173 -0
- package/dist/options.js +521 -0
- package/dist/plugin.d.ts +113 -0
- package/dist/plugin.js +766 -0
- package/dist/protocol.d.ts +81 -0
- package/dist/protocol.js +249 -0
- package/dist/server.d.ts +148 -0
- package/dist/server.js +1516 -0
- package/dist/signin.d.ts +40 -0
- package/dist/signin.js +86 -0
- package/dist/store-redis.d.ts +38 -0
- package/dist/store-redis.js +173 -0
- package/dist/store-sql.d.ts +46 -0
- package/dist/store-sql.js +363 -0
- package/dist/store.d.ts +126 -0
- package/dist/store.js +266 -0
- package/options.schema.json +633 -0
- package/package.json +143 -4
- package/templates/extension.ts +45 -0
- package/templates/migrations/dokebi_oauth.ts +117 -0
|
@@ -0,0 +1,633 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"additionalProperties": false,
|
|
5
|
+
"properties": {
|
|
6
|
+
"issuer": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"pattern": "^https?:\\/\\/[a-z0-9.-]{1,253}(?::[0-9]{1,5})?$",
|
|
9
|
+
"description": "The authorization server identifier: an origin without a path (https://example.com). http only on localhost and *.localhost"
|
|
10
|
+
},
|
|
11
|
+
"realm": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"pattern": "^[a-z][a-z0-9-]{0,31}$",
|
|
14
|
+
"default": "default",
|
|
15
|
+
"description": "The dokebi-auth realm whose users grant access"
|
|
16
|
+
},
|
|
17
|
+
"app": {
|
|
18
|
+
"anyOf": [
|
|
19
|
+
{
|
|
20
|
+
"type": "string",
|
|
21
|
+
"pattern": "^[a-z][a-z0-9-]{0,31}$"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"pattern": "^[a-z][a-z0-9-]{0,31}$"
|
|
28
|
+
},
|
|
29
|
+
"minItems": 1,
|
|
30
|
+
"maxItems": 64,
|
|
31
|
+
"uniqueItems": true
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"description": "The app or apps of @dokebi/app whose hosts answer the authorization server (D-0132): its metadata, authorize (the consent page), token, revoke and register, at the issuer origin, for example studio. Other hosts get the 404 of an unknown route. Unset: every host"
|
|
35
|
+
},
|
|
36
|
+
"resources": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"propertyNames": {
|
|
39
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$"
|
|
40
|
+
},
|
|
41
|
+
"minProperties": 1,
|
|
42
|
+
"maxProperties": 32,
|
|
43
|
+
"additionalProperties": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"properties": {
|
|
47
|
+
"uri": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"minLength": 8,
|
|
50
|
+
"maxLength": 2048,
|
|
51
|
+
"description": "The resource URI (RFC 8707), exactly as clients send it and as the protected resource metadata says it: https://example.com/mcp. Compared with one function (scheme and host case, default port, empty path = /)"
|
|
52
|
+
},
|
|
53
|
+
"name": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"minLength": 1,
|
|
56
|
+
"maxLength": 200,
|
|
57
|
+
"description": "Human name of the resource (resource_name in its metadata, the consent data)"
|
|
58
|
+
},
|
|
59
|
+
"scopes": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"propertyNames": {
|
|
62
|
+
"pattern": "^(?=.{1,128}$)[A-Za-z0-9_:-]+(?:\\.[A-Za-z0-9_:-]+)*$"
|
|
63
|
+
},
|
|
64
|
+
"maxProperties": 64,
|
|
65
|
+
"additionalProperties": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"minLength": 1,
|
|
68
|
+
"maxLength": 200
|
|
69
|
+
},
|
|
70
|
+
"default": {},
|
|
71
|
+
"description": "Scopes of this resource and their labels: { \"tools:read\": \"Read your projects\" }. Requests may ask only for these"
|
|
72
|
+
},
|
|
73
|
+
"defaultScopes": {
|
|
74
|
+
"type": "array",
|
|
75
|
+
"items": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"pattern": "^(?=.{1,128}$)[A-Za-z0-9_:-]+(?:\\.[A-Za-z0-9_:-]+)*$"
|
|
78
|
+
},
|
|
79
|
+
"maxItems": 64,
|
|
80
|
+
"uniqueItems": true,
|
|
81
|
+
"default": [],
|
|
82
|
+
"description": "Scopes a request without scope gets (also the scope of the 401 challenge); each one must be in scopes"
|
|
83
|
+
},
|
|
84
|
+
"app": {
|
|
85
|
+
"anyOf": [
|
|
86
|
+
{
|
|
87
|
+
"type": "string",
|
|
88
|
+
"pattern": "^[a-z][a-z0-9-]{0,31}$"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"type": "array",
|
|
92
|
+
"items": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"pattern": "^[a-z][a-z0-9-]{0,31}$"
|
|
95
|
+
},
|
|
96
|
+
"minItems": 1,
|
|
97
|
+
"maxItems": 64,
|
|
98
|
+
"uniqueItems": true
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"description": "The app or apps of @dokebi/app whose hosts serve this resource metadata (RFC 9728, at the origin of uri; D-0132): the app of the uri host, for example mcp. Default dokebi-oauth.app; neither set: every host"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"required": [
|
|
105
|
+
"uri"
|
|
106
|
+
],
|
|
107
|
+
"description": "One protected resource of this application"
|
|
108
|
+
},
|
|
109
|
+
"description": "Protected resources by id (the id is the audience of their tokens and the resource of config.oauth): { mcp: { uri, name?, scopes, defaultScopes } }"
|
|
110
|
+
},
|
|
111
|
+
"clients": {
|
|
112
|
+
"type": "object",
|
|
113
|
+
"propertyNames": {
|
|
114
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
|
|
115
|
+
},
|
|
116
|
+
"maxProperties": 256,
|
|
117
|
+
"additionalProperties": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"additionalProperties": false,
|
|
120
|
+
"properties": {
|
|
121
|
+
"name": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"minLength": 1,
|
|
124
|
+
"maxLength": 200,
|
|
125
|
+
"description": "The name the consent data shows (after the client id)"
|
|
126
|
+
},
|
|
127
|
+
"redirectUris": {
|
|
128
|
+
"type": "array",
|
|
129
|
+
"items": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"minLength": 10,
|
|
132
|
+
"maxLength": 2048
|
|
133
|
+
},
|
|
134
|
+
"minItems": 1,
|
|
135
|
+
"maxItems": 16,
|
|
136
|
+
"uniqueItems": true,
|
|
137
|
+
"description": "Exact redirect URIs (https, or http on 127.0.0.1, [::1] or localhost where only the port may differ)"
|
|
138
|
+
},
|
|
139
|
+
"secretSha256": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"pattern": "^[0-9a-f]{64}$",
|
|
142
|
+
"writeOnly": true,
|
|
143
|
+
"description": "sha256 of the client secret in lower-case hex (the secret itself is never stored): a confidential client authenticating with client_secret_basic or client_secret_post. Absent: a public client (none)"
|
|
144
|
+
},
|
|
145
|
+
"grant": {
|
|
146
|
+
"type": "object",
|
|
147
|
+
"additionalProperties": false,
|
|
148
|
+
"properties": {
|
|
149
|
+
"maxDays": {
|
|
150
|
+
"type": "integer",
|
|
151
|
+
"minimum": 1,
|
|
152
|
+
"maximum": 3650,
|
|
153
|
+
"description": "Absolute lifetime of this client's grants in days, instead of grant.maxDays (at most grant.clientMaxDays; D-0122)"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"required": [
|
|
157
|
+
"maxDays"
|
|
158
|
+
],
|
|
159
|
+
"description": "This client's own grant lifetime (absent: grant.maxDays)"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"required": [
|
|
163
|
+
"name",
|
|
164
|
+
"redirectUris"
|
|
165
|
+
],
|
|
166
|
+
"description": "A pre-registered client"
|
|
167
|
+
},
|
|
168
|
+
"default": {},
|
|
169
|
+
"description": "Pre-registered clients by client_id"
|
|
170
|
+
},
|
|
171
|
+
"cimd": {
|
|
172
|
+
"type": "object",
|
|
173
|
+
"additionalProperties": false,
|
|
174
|
+
"properties": {
|
|
175
|
+
"enabled": {
|
|
176
|
+
"type": "boolean",
|
|
177
|
+
"default": true,
|
|
178
|
+
"description": "Accept client ID metadata documents: an https client_id URL whose JSON document this server fetches"
|
|
179
|
+
},
|
|
180
|
+
"allowHosts": {
|
|
181
|
+
"type": "array",
|
|
182
|
+
"items": {
|
|
183
|
+
"type": "string",
|
|
184
|
+
"pattern": "^[a-z0-9.-]{1,253}$"
|
|
185
|
+
},
|
|
186
|
+
"maxItems": 64,
|
|
187
|
+
"uniqueItems": true,
|
|
188
|
+
"default": [],
|
|
189
|
+
"description": "Hosts whose documents are accepted (lower case); empty: every public https host"
|
|
190
|
+
},
|
|
191
|
+
"timeoutMs": {
|
|
192
|
+
"type": "integer",
|
|
193
|
+
"minimum": 500,
|
|
194
|
+
"maximum": 10000,
|
|
195
|
+
"default": 3000,
|
|
196
|
+
"description": "The whole fetch of one document (headers and body)"
|
|
197
|
+
},
|
|
198
|
+
"maxFetches": {
|
|
199
|
+
"type": "integer",
|
|
200
|
+
"minimum": 1,
|
|
201
|
+
"maximum": 1024,
|
|
202
|
+
"default": 16,
|
|
203
|
+
"description": "Document fetches running at once per process (each an outbound request to a host the client named); beyond it the authorize request answers busy"
|
|
204
|
+
},
|
|
205
|
+
"maxFetchesPerAddress": {
|
|
206
|
+
"type": "integer",
|
|
207
|
+
"minimum": 1,
|
|
208
|
+
"maximum": 1024,
|
|
209
|
+
"default": 2,
|
|
210
|
+
"description": "Document fetches one client address (IPv6 by /64) may start at once"
|
|
211
|
+
},
|
|
212
|
+
"refusalCacheMs": {
|
|
213
|
+
"type": "integer",
|
|
214
|
+
"minimum": 0,
|
|
215
|
+
"maximum": 86400000,
|
|
216
|
+
"default": 300000,
|
|
217
|
+
"description": "A refused document URL is not fetched again for this long (0: every request fetches again)"
|
|
218
|
+
},
|
|
219
|
+
"maxRefused": {
|
|
220
|
+
"type": "integer",
|
|
221
|
+
"minimum": 1,
|
|
222
|
+
"maximum": 1000000,
|
|
223
|
+
"default": 1000,
|
|
224
|
+
"description": "Refused document URLs remembered at once; beyond it the oldest go"
|
|
225
|
+
},
|
|
226
|
+
"maxBytes": {
|
|
227
|
+
"type": "integer",
|
|
228
|
+
"minimum": 1024,
|
|
229
|
+
"maximum": 1048576,
|
|
230
|
+
"default": 16384,
|
|
231
|
+
"description": "Largest document body in bytes; a larger one is refused"
|
|
232
|
+
},
|
|
233
|
+
"maxHeaderBytes": {
|
|
234
|
+
"type": "integer",
|
|
235
|
+
"minimum": 1024,
|
|
236
|
+
"maximum": 65536,
|
|
237
|
+
"default": 8192,
|
|
238
|
+
"description": "Largest response head of a document fetch in bytes"
|
|
239
|
+
},
|
|
240
|
+
"minCacheMs": {
|
|
241
|
+
"type": "integer",
|
|
242
|
+
"minimum": 0,
|
|
243
|
+
"maximum": 604800000,
|
|
244
|
+
"default": 300000,
|
|
245
|
+
"description": "A fetched document is kept at least this long, also with no-store or a shorter max-age"
|
|
246
|
+
},
|
|
247
|
+
"maxCacheMs": {
|
|
248
|
+
"type": "integer",
|
|
249
|
+
"minimum": 60000,
|
|
250
|
+
"maximum": 604800000,
|
|
251
|
+
"default": 86400000,
|
|
252
|
+
"description": "A fetched document is kept at most this long, whatever its max-age says"
|
|
253
|
+
},
|
|
254
|
+
"defaultCacheMs": {
|
|
255
|
+
"type": "integer",
|
|
256
|
+
"minimum": 0,
|
|
257
|
+
"maximum": 604800000,
|
|
258
|
+
"default": 3600000,
|
|
259
|
+
"description": "How long a document without Cache-Control max-age is kept"
|
|
260
|
+
},
|
|
261
|
+
"maxCached": {
|
|
262
|
+
"type": "integer",
|
|
263
|
+
"minimum": 1,
|
|
264
|
+
"maximum": 1000000,
|
|
265
|
+
"default": 1000,
|
|
266
|
+
"description": "Fetched documents kept at once; beyond it the oldest go"
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
"description": "Client ID metadata documents (CIMD)"
|
|
270
|
+
},
|
|
271
|
+
"registration": {
|
|
272
|
+
"type": "string",
|
|
273
|
+
"enum": [
|
|
274
|
+
"closed",
|
|
275
|
+
"open"
|
|
276
|
+
],
|
|
277
|
+
"default": "closed",
|
|
278
|
+
"description": "Dynamic client registration (RFC 7591): closed (POST /oauth/register answers 404) or open (public clients only, registrationLimit per address and registrationWindowMs, removed after clientUnusedMs unused)"
|
|
279
|
+
},
|
|
280
|
+
"registrationLimit": {
|
|
281
|
+
"type": "integer",
|
|
282
|
+
"minimum": 1,
|
|
283
|
+
"maximum": 1000000,
|
|
284
|
+
"default": 20,
|
|
285
|
+
"description": "Registrations one client address (IPv6 by /64) may make per registrationWindowMs; beyond it 429 with Retry-After (D-0113)"
|
|
286
|
+
},
|
|
287
|
+
"registrationWindowMs": {
|
|
288
|
+
"type": "integer",
|
|
289
|
+
"minimum": 1000,
|
|
290
|
+
"maximum": 86400000,
|
|
291
|
+
"default": 3600000,
|
|
292
|
+
"description": "The window of registrationLimit (default one hour)"
|
|
293
|
+
},
|
|
294
|
+
"clientUnusedMs": {
|
|
295
|
+
"type": "integer",
|
|
296
|
+
"minimum": 86400000,
|
|
297
|
+
"maximum": 315360000000,
|
|
298
|
+
"default": 2592000000,
|
|
299
|
+
"description": "A registered client unused this long is removed by purge (sql, memory) or expires (redis); default 30 days. Never less than refreshMs: a client stays while a refresh token it was given may still run"
|
|
300
|
+
},
|
|
301
|
+
"maxTrackedAddresses": {
|
|
302
|
+
"type": "integer",
|
|
303
|
+
"minimum": 1,
|
|
304
|
+
"maximum": 10000000,
|
|
305
|
+
"default": 10000,
|
|
306
|
+
"description": "Client addresses whose registrations and document fetches this process counts; beyond it the least recently seen are forgotten"
|
|
307
|
+
},
|
|
308
|
+
"accessMs": {
|
|
309
|
+
"type": "integer",
|
|
310
|
+
"minimum": 360000,
|
|
311
|
+
"maximum": 86400000,
|
|
312
|
+
"default": 900000,
|
|
313
|
+
"description": "Access token lifetime (default 15 minutes; more than 5 minutes, or Claude Code refreshes before every call)"
|
|
314
|
+
},
|
|
315
|
+
"refreshMs": {
|
|
316
|
+
"type": "integer",
|
|
317
|
+
"minimum": 3600000,
|
|
318
|
+
"maximum": 31536000000,
|
|
319
|
+
"default": 2592000000,
|
|
320
|
+
"description": "Refresh token lifetime (default 30 days; one use each). A registered client is kept at least this long after its last use (clientUnusedMs)"
|
|
321
|
+
},
|
|
322
|
+
"grant": {
|
|
323
|
+
"type": "object",
|
|
324
|
+
"additionalProperties": false,
|
|
325
|
+
"properties": {
|
|
326
|
+
"maxDays": {
|
|
327
|
+
"type": "integer",
|
|
328
|
+
"minimum": 1,
|
|
329
|
+
"maximum": 3650,
|
|
330
|
+
"default": 90,
|
|
331
|
+
"description": "Absolute lifetime of a grant from the consent; refreshes never extend it (consent again after it for a new grant)"
|
|
332
|
+
},
|
|
333
|
+
"clientMaxDays": {
|
|
334
|
+
"type": "integer",
|
|
335
|
+
"minimum": 1,
|
|
336
|
+
"maximum": 3650,
|
|
337
|
+
"default": 365,
|
|
338
|
+
"description": "The longest clients.<id>.grant.maxDays a pre-registered client may set (default 365); a longer one is refused at start (D-0122)"
|
|
339
|
+
},
|
|
340
|
+
"maxPerClient": {
|
|
341
|
+
"type": "integer",
|
|
342
|
+
"minimum": 1,
|
|
343
|
+
"maximum": 1000,
|
|
344
|
+
"default": 20,
|
|
345
|
+
"description": "Live grants (connected devices) one user may hold for one client (D-0124). A new authorization beyond it revokes the least recently used one, those without a live token first, and logs warn OAUTH_GRANT_EVICTED; it never refuses the new device. With the memory store at most store.maxGrantsPerUser"
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
"description": "Grants (one per authorization: every device that connects gets its own)"
|
|
349
|
+
},
|
|
350
|
+
"live": {
|
|
351
|
+
"type": "object",
|
|
352
|
+
"additionalProperties": false,
|
|
353
|
+
"properties": {
|
|
354
|
+
"maxAgeMs": {
|
|
355
|
+
"type": "integer",
|
|
356
|
+
"minimum": 100,
|
|
357
|
+
"maximum": 60000,
|
|
358
|
+
"default": 5000,
|
|
359
|
+
"description": "api.live(): an SSE or WebSocket connection opened with an access token ends at most this long after the token or its grant was revoked elsewhere (D-0122); its expiry ends it at once. Each open connection rereads its token, grant and user about every maxAgeMs - renewBeforeMs"
|
|
360
|
+
},
|
|
361
|
+
"renewBeforeMs": {
|
|
362
|
+
"type": "integer",
|
|
363
|
+
"minimum": 10,
|
|
364
|
+
"maximum": 30000,
|
|
365
|
+
"default": 1000,
|
|
366
|
+
"description": "How long before its deadline a live connection checks its token again (at most half of maxAgeMs); keep it above the slowest token, grant and user read"
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
"description": "Live authorization of Bearer SSE and WebSocket connections (api.live)"
|
|
370
|
+
},
|
|
371
|
+
"codeMs": {
|
|
372
|
+
"type": "integer",
|
|
373
|
+
"minimum": 10000,
|
|
374
|
+
"maximum": 600000,
|
|
375
|
+
"default": 60000,
|
|
376
|
+
"description": "Authorization code lifetime (default 60 seconds; one use)"
|
|
377
|
+
},
|
|
378
|
+
"grantCacheMs": {
|
|
379
|
+
"type": "integer",
|
|
380
|
+
"minimum": 0,
|
|
381
|
+
"maximum": 60000,
|
|
382
|
+
"default": 5000,
|
|
383
|
+
"description": "Protected routes keep a looked-up grant this long in process memory (a revocation through this process applies at once, elsewhere within it)"
|
|
384
|
+
},
|
|
385
|
+
"maxCachedGrants": {
|
|
386
|
+
"type": "integer",
|
|
387
|
+
"minimum": 1,
|
|
388
|
+
"maximum": 10000000,
|
|
389
|
+
"default": 10000,
|
|
390
|
+
"description": "Grants the grantCacheMs cache, the delegation check and the last-use memo keep at once; beyond it the oldest go"
|
|
391
|
+
},
|
|
392
|
+
"grantTouchMs": {
|
|
393
|
+
"type": "integer",
|
|
394
|
+
"minimum": 1000,
|
|
395
|
+
"maximum": 86400000,
|
|
396
|
+
"default": 60000,
|
|
397
|
+
"description": "The lastUsedAt of a grant is written at most this often (default one minute)"
|
|
398
|
+
},
|
|
399
|
+
"codeGraceMs": {
|
|
400
|
+
"type": "integer",
|
|
401
|
+
"minimum": 0,
|
|
402
|
+
"maximum": 86400000,
|
|
403
|
+
"default": 600000,
|
|
404
|
+
"description": "An expired code is kept this long before purge removes it, so a replay is still recognized and revokes its grant"
|
|
405
|
+
},
|
|
406
|
+
"pendingMs": {
|
|
407
|
+
"type": "integer",
|
|
408
|
+
"minimum": 10000,
|
|
409
|
+
"maximum": 3600000,
|
|
410
|
+
"default": 600000,
|
|
411
|
+
"description": "How long an authorization request waits in the session for login and consent (default 10 minutes)"
|
|
412
|
+
},
|
|
413
|
+
"maxPending": {
|
|
414
|
+
"type": "integer",
|
|
415
|
+
"minimum": 1,
|
|
416
|
+
"maximum": 100,
|
|
417
|
+
"default": 5,
|
|
418
|
+
"description": "Authorization requests one session keeps waiting at once (tabs); beyond it the oldest is dropped"
|
|
419
|
+
},
|
|
420
|
+
"maxBodyBytes": {
|
|
421
|
+
"type": "integer",
|
|
422
|
+
"minimum": 1024,
|
|
423
|
+
"maximum": 1048576,
|
|
424
|
+
"default": 65536,
|
|
425
|
+
"description": "Largest body of POST /oauth/token, /oauth/revoke and /oauth/register in bytes"
|
|
426
|
+
},
|
|
427
|
+
"storeRetryAfterMs": {
|
|
428
|
+
"type": "integer",
|
|
429
|
+
"minimum": 1,
|
|
430
|
+
"maximum": 60000,
|
|
431
|
+
"default": 1000,
|
|
432
|
+
"description": "data.retryAfterMs (Retry-After) of 503 STORE_FAILED: a store that did not answer"
|
|
433
|
+
},
|
|
434
|
+
"storeFullRetryAfterMs": {
|
|
435
|
+
"type": "integer",
|
|
436
|
+
"minimum": 1,
|
|
437
|
+
"maximum": 600000,
|
|
438
|
+
"default": 5000,
|
|
439
|
+
"description": "data.retryAfterMs (Retry-After) of 503 STORE_FULL: a full memory store"
|
|
440
|
+
},
|
|
441
|
+
"logRepeatWindowMs": {
|
|
442
|
+
"type": "integer",
|
|
443
|
+
"minimum": 1000,
|
|
444
|
+
"maximum": 3600000,
|
|
445
|
+
"default": 10000,
|
|
446
|
+
"description": "Window of the repeated OAuth logs (OAUTH_STORE_FAILED, OAUTH_STORE_FULL, OAUTH_TOUCH_FAILED, OAUTH_HOOK_FAILED): the first of each in full, the rest of the window counted into one summary with repeated (D-0113)"
|
|
447
|
+
},
|
|
448
|
+
"store": {
|
|
449
|
+
"anyOf": [
|
|
450
|
+
{
|
|
451
|
+
"type": "object",
|
|
452
|
+
"additionalProperties": false,
|
|
453
|
+
"properties": {
|
|
454
|
+
"driver": {
|
|
455
|
+
"const": "memory",
|
|
456
|
+
"default": "memory",
|
|
457
|
+
"description": "One process, in memory (the default); lost on restart"
|
|
458
|
+
},
|
|
459
|
+
"maxGrants": {
|
|
460
|
+
"type": "integer",
|
|
461
|
+
"minimum": 1,
|
|
462
|
+
"maximum": 10000000,
|
|
463
|
+
"default": 100000,
|
|
464
|
+
"description": "Grants kept at once; expired and revoked ones make room, live ones are never dropped (a new grant is refused when full)"
|
|
465
|
+
},
|
|
466
|
+
"maxGrantsPerUser": {
|
|
467
|
+
"type": "integer",
|
|
468
|
+
"minimum": 1,
|
|
469
|
+
"maximum": 100000,
|
|
470
|
+
"default": 100,
|
|
471
|
+
"description": "Live grants one user may hold; beyond it a new grant is refused"
|
|
472
|
+
},
|
|
473
|
+
"maxCodes": {
|
|
474
|
+
"type": "integer",
|
|
475
|
+
"minimum": 1,
|
|
476
|
+
"maximum": 10000000,
|
|
477
|
+
"default": 100000,
|
|
478
|
+
"description": "Authorization codes kept at once (each lives codeMs); beyond it the oldest go first (D-0113)"
|
|
479
|
+
},
|
|
480
|
+
"maxClients": {
|
|
481
|
+
"type": "integer",
|
|
482
|
+
"minimum": 1,
|
|
483
|
+
"maximum": 10000000,
|
|
484
|
+
"default": 100000,
|
|
485
|
+
"description": "Dynamically registered clients kept at once; beyond it a registration is refused with 503 STORE_FULL (D-0113)"
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"type": "object",
|
|
491
|
+
"additionalProperties": false,
|
|
492
|
+
"properties": {
|
|
493
|
+
"driver": {
|
|
494
|
+
"const": "sql"
|
|
495
|
+
},
|
|
496
|
+
"connection": {
|
|
497
|
+
"type": "string",
|
|
498
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$",
|
|
499
|
+
"description": "Connection name in dokebi-db.connections (a pg, mysql2 or mariadb pool); the tables come from a migration"
|
|
500
|
+
},
|
|
501
|
+
"tablePrefix": {
|
|
502
|
+
"type": "string",
|
|
503
|
+
"pattern": "^[a-z_][a-z0-9_]{0,40}(?:\\.[a-z_][a-z0-9_]{0,40})?$",
|
|
504
|
+
"default": "dokebi_oauth",
|
|
505
|
+
"description": "Prefix of the three tables <prefix>_grants, <prefix>_codes and <prefix>_clients"
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
"required": [
|
|
509
|
+
"driver",
|
|
510
|
+
"connection"
|
|
511
|
+
]
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"type": "object",
|
|
515
|
+
"additionalProperties": false,
|
|
516
|
+
"properties": {
|
|
517
|
+
"driver": {
|
|
518
|
+
"const": "redis"
|
|
519
|
+
},
|
|
520
|
+
"connection": {
|
|
521
|
+
"type": "string",
|
|
522
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$",
|
|
523
|
+
"description": "Connection name in dokebi-redis.connections"
|
|
524
|
+
},
|
|
525
|
+
"namespace": {
|
|
526
|
+
"type": "string",
|
|
527
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9:._-]{0,127}$",
|
|
528
|
+
"default": "dokebi"
|
|
529
|
+
}
|
|
530
|
+
},
|
|
531
|
+
"required": [
|
|
532
|
+
"driver",
|
|
533
|
+
"connection"
|
|
534
|
+
]
|
|
535
|
+
}
|
|
536
|
+
],
|
|
537
|
+
"description": "Grants, codes and registered clients: memory (default), sql (a @dokebi/db connection) or redis (a @dokebi/redis connection)"
|
|
538
|
+
},
|
|
539
|
+
"paths": {
|
|
540
|
+
"type": "object",
|
|
541
|
+
"additionalProperties": false,
|
|
542
|
+
"properties": {
|
|
543
|
+
"authorize": {
|
|
544
|
+
"type": "string",
|
|
545
|
+
"pattern": "^\\/(?![/\\\\])[A-Za-z0-9._~!$&'()*+,;=:@%/-]{0,255}$",
|
|
546
|
+
"default": "/oauth/authorize",
|
|
547
|
+
"x-dokebi-secret": false
|
|
548
|
+
},
|
|
549
|
+
"token": {
|
|
550
|
+
"type": "string",
|
|
551
|
+
"pattern": "^\\/(?![/\\\\])[A-Za-z0-9._~!$&'()*+,;=:@%/-]{0,255}$",
|
|
552
|
+
"default": "/oauth/token",
|
|
553
|
+
"x-dokebi-secret": false
|
|
554
|
+
},
|
|
555
|
+
"revoke": {
|
|
556
|
+
"type": "string",
|
|
557
|
+
"pattern": "^\\/(?![/\\\\])[A-Za-z0-9._~!$&'()*+,;=:@%/-]{0,255}$",
|
|
558
|
+
"default": "/oauth/revoke",
|
|
559
|
+
"x-dokebi-secret": false
|
|
560
|
+
},
|
|
561
|
+
"register": {
|
|
562
|
+
"type": "string",
|
|
563
|
+
"pattern": "^\\/(?![/\\\\])[A-Za-z0-9._~!$&'()*+,;=:@%/-]{0,255}$",
|
|
564
|
+
"default": "/oauth/register",
|
|
565
|
+
"x-dokebi-secret": false
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
"description": "Endpoint paths (the metadata follows them)"
|
|
569
|
+
},
|
|
570
|
+
"routeIds": {
|
|
571
|
+
"type": "object",
|
|
572
|
+
"additionalProperties": false,
|
|
573
|
+
"properties": {
|
|
574
|
+
"serverMetadata": {
|
|
575
|
+
"type": "string",
|
|
576
|
+
"pattern": "^[A-Za-z][A-Za-z0-9._-]{0,63}$",
|
|
577
|
+
"x-dokebi-secret": false,
|
|
578
|
+
"description": "Id of GET /.well-known/oauth-authorization-server; default oauth.serverMetadata"
|
|
579
|
+
},
|
|
580
|
+
"resourceMetadata": {
|
|
581
|
+
"type": "string",
|
|
582
|
+
"pattern": "^[A-Za-z][A-Za-z0-9._-]{0,63}$",
|
|
583
|
+
"x-dokebi-secret": false,
|
|
584
|
+
"description": "Id of GET /.well-known/oauth-protected-resource and /.well-known/oauth-protected-resource/* (one pair per app); default oauth.resourceMetadata"
|
|
585
|
+
},
|
|
586
|
+
"authorize": {
|
|
587
|
+
"type": "string",
|
|
588
|
+
"pattern": "^[A-Za-z][A-Za-z0-9._-]{0,63}$",
|
|
589
|
+
"x-dokebi-secret": false,
|
|
590
|
+
"description": "Id of GET and POST paths.authorize (the consent page and its decision); default oauth.authorize"
|
|
591
|
+
},
|
|
592
|
+
"token": {
|
|
593
|
+
"type": "string",
|
|
594
|
+
"pattern": "^[A-Za-z][A-Za-z0-9._-]{0,63}$",
|
|
595
|
+
"x-dokebi-secret": false,
|
|
596
|
+
"description": "Id of POST paths.token; default oauth.token"
|
|
597
|
+
},
|
|
598
|
+
"revoke": {
|
|
599
|
+
"type": "string",
|
|
600
|
+
"pattern": "^[A-Za-z][A-Za-z0-9._-]{0,63}$",
|
|
601
|
+
"x-dokebi-secret": false,
|
|
602
|
+
"description": "Id of POST paths.revoke; default oauth.revoke"
|
|
603
|
+
},
|
|
604
|
+
"register": {
|
|
605
|
+
"type": "string",
|
|
606
|
+
"pattern": "^[A-Za-z][A-Za-z0-9._-]{0,63}$",
|
|
607
|
+
"x-dokebi-secret": false,
|
|
608
|
+
"description": "Id of POST paths.register; default oauth.register"
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
"description": "Ids of the routes dokebi-oauth adds (D-0142), by route key: serverMetadata (default oauth.serverMetadata), resourceMetadata (default oauth.resourceMetadata), authorize (default oauth.authorize), token (default oauth.token), revoke (default oauth.revoke), register (default oauth.register). An id is 1-64 letters, digits, '.', '_' or '-' starting with a letter; an id another route of the same app has fails the start (DUPLICATE_ROUTE_ID)"
|
|
612
|
+
},
|
|
613
|
+
"rateLimit": {
|
|
614
|
+
"type": "object",
|
|
615
|
+
"additionalProperties": false,
|
|
616
|
+
"properties": {
|
|
617
|
+
"policy": {
|
|
618
|
+
"type": "string",
|
|
619
|
+
"pattern": "^[a-z][a-z0-9-]{0,31}$",
|
|
620
|
+
"description": "A @dokebi/rate-limit policy applied to POST /oauth/token, keyed by client and credential"
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
"required": [
|
|
624
|
+
"policy"
|
|
625
|
+
],
|
|
626
|
+
"description": "Limit the token endpoint with @dokebi/rate-limit (absent: no limit)"
|
|
627
|
+
}
|
|
628
|
+
},
|
|
629
|
+
"required": [
|
|
630
|
+
"issuer",
|
|
631
|
+
"resources"
|
|
632
|
+
]
|
|
633
|
+
}
|