@djangocfg/api 2.1.54 → 2.1.56
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/dist/auth.cjs +28 -15
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +6 -6
- package/dist/auth.d.ts +6 -6
- package/dist/auth.mjs +28 -15
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +56 -17
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +17 -17
- package/dist/clients.d.ts +17 -17
- package/dist/clients.mjs +56 -17
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +763 -12
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +11 -11
- package/dist/hooks.d.ts +11 -11
- package/dist/hooks.mjs +763 -12
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +893 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -41
- package/dist/index.d.ts +59 -41
- package/dist/index.mjs +893 -69
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/generated/cfg_accounts/_utils/schemas/CentrifugoToken.schema.ts +1 -1
- package/src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts +2 -2
- package/src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts +1 -1
- package/src/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts +1 -1
- package/src/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts +1 -1
- package/src/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts +1 -1
- package/src/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts +1 -1
- package/src/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts +1 -1
- package/src/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts +1 -1
- package/src/generated/cfg_accounts/_utils/schemas/User.schema.ts +1 -1
- package/src/generated/cfg_accounts/api-instance.ts +61 -13
- package/src/generated/cfg_centrifugo/api-instance.ts +61 -13
- package/src/generated/cfg_totp/CLAUDE.md +90 -0
- package/src/generated/cfg_totp/_utils/fetchers/index.ts +33 -0
- package/src/generated/cfg_totp/_utils/fetchers/totp.ts +49 -0
- package/src/generated/cfg_totp/_utils/fetchers/totp__2fa_management.ts +108 -0
- package/src/generated/cfg_totp/_utils/fetchers/totp__2fa_setup.ts +153 -0
- package/src/generated/cfg_totp/_utils/fetchers/totp__2fa_verification.ts +152 -0
- package/src/generated/cfg_totp/_utils/fetchers/totp__backup_codes.ts +152 -0
- package/src/generated/cfg_totp/_utils/hooks/index.ts +33 -0
- package/src/generated/cfg_totp/_utils/hooks/totp.ts +42 -0
- package/src/generated/cfg_totp/_utils/hooks/totp__2fa_management.ts +58 -0
- package/src/generated/cfg_totp/_utils/hooks/totp__2fa_setup.ts +63 -0
- package/src/generated/cfg_totp/_utils/hooks/totp__2fa_verification.ts +62 -0
- package/src/generated/cfg_totp/_utils/hooks/totp__backup_codes.ts +59 -0
- package/src/generated/cfg_totp/_utils/schemas/BackupCodesRegenerateRequest.schema.ts +19 -0
- package/src/generated/cfg_totp/_utils/schemas/BackupCodesRegenerateResponse.schema.ts +20 -0
- package/src/generated/cfg_totp/_utils/schemas/BackupCodesStatus.schema.ts +21 -0
- package/src/generated/cfg_totp/_utils/schemas/ConfirmSetupRequest.schema.ts +20 -0
- package/src/generated/cfg_totp/_utils/schemas/ConfirmSetupResponse.schema.ts +21 -0
- package/src/generated/cfg_totp/_utils/schemas/DeviceList.schema.ts +26 -0
- package/src/generated/cfg_totp/_utils/schemas/DisableRequest.schema.ts +19 -0
- package/src/generated/cfg_totp/_utils/schemas/PaginatedDeviceListList.schema.ts +24 -0
- package/src/generated/cfg_totp/_utils/schemas/SetupRequest.schema.ts +19 -0
- package/src/generated/cfg_totp/_utils/schemas/SetupResponse.schema.ts +23 -0
- package/src/generated/cfg_totp/_utils/schemas/VerifyBackupRequest.schema.ts +20 -0
- package/src/generated/cfg_totp/_utils/schemas/VerifyRequest.schema.ts +20 -0
- package/src/generated/cfg_totp/_utils/schemas/VerifyResponse.schema.ts +24 -0
- package/src/generated/cfg_totp/_utils/schemas/index.ts +32 -0
- package/src/generated/cfg_totp/api-instance.ts +180 -0
- package/src/generated/cfg_totp/client.ts +313 -0
- package/src/generated/cfg_totp/enums.ts +12 -0
- package/src/generated/cfg_totp/errors.ts +117 -0
- package/src/generated/cfg_totp/http.ts +104 -0
- package/src/generated/cfg_totp/index.ts +302 -0
- package/src/generated/cfg_totp/logger.ts +260 -0
- package/src/generated/cfg_totp/retry.ts +176 -0
- package/src/generated/cfg_totp/schema.json +859 -0
- package/src/generated/cfg_totp/storage.ts +162 -0
- package/src/generated/cfg_totp/totp/client.ts +23 -0
- package/src/generated/cfg_totp/totp/index.ts +3 -0
- package/src/generated/cfg_totp/totp/models.ts +1 -0
- package/src/generated/cfg_totp/totp__2fa_management/client.ts +41 -0
- package/src/generated/cfg_totp/totp__2fa_management/index.ts +3 -0
- package/src/generated/cfg_totp/totp__2fa_management/models.ts +60 -0
- package/src/generated/cfg_totp/totp__2fa_setup/client.ts +32 -0
- package/src/generated/cfg_totp/totp__2fa_setup/index.ts +3 -0
- package/src/generated/cfg_totp/totp__2fa_setup/models.ts +54 -0
- package/src/generated/cfg_totp/totp__2fa_verification/client.ts +32 -0
- package/src/generated/cfg_totp/totp__2fa_verification/index.ts +3 -0
- package/src/generated/cfg_totp/totp__2fa_verification/models.ts +44 -0
- package/src/generated/cfg_totp/totp__backup_codes/client.ts +31 -0
- package/src/generated/cfg_totp/totp__backup_codes/index.ts +3 -0
- package/src/generated/cfg_totp/totp__backup_codes/models.ts +37 -0
- package/src/generated/cfg_totp/validation-events.ts +134 -0
- package/src/generated/cfg_webpush/_utils/schemas/SendPushRequestRequest.schema.ts +2 -2
- package/src/generated/cfg_webpush/_utils/schemas/SubscribeRequestRequest.schema.ts +1 -1
- package/src/generated/cfg_webpush/api-instance.ts +61 -13
|
@@ -0,0 +1,859 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.0.3",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "Django CFG API",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "Complete API documentation for Django CFG Demo Project",
|
|
7
|
+
"x-django-metadata": {
|
|
8
|
+
"group": "cfg_totp",
|
|
9
|
+
"apps": [
|
|
10
|
+
"django_cfg_totp"
|
|
11
|
+
],
|
|
12
|
+
"generator": "django-client",
|
|
13
|
+
"generator_version": "1.0.0"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"paths": {
|
|
17
|
+
"/cfg/totp/backup-codes/": {
|
|
18
|
+
"get": {
|
|
19
|
+
"operationId": "cfg_totp_backup_codes_retrieve",
|
|
20
|
+
"description": "Get backup codes status for user.",
|
|
21
|
+
"tags": [
|
|
22
|
+
"Backup Codes"
|
|
23
|
+
],
|
|
24
|
+
"security": [
|
|
25
|
+
{
|
|
26
|
+
"jwtAuthWithLastLogin": []
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"responses": {
|
|
30
|
+
"200": {
|
|
31
|
+
"content": {
|
|
32
|
+
"application/json": {
|
|
33
|
+
"schema": {
|
|
34
|
+
"$ref": "#/components/schemas/BackupCodesStatus"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"description": ""
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"x-async-capable": false
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"/cfg/totp/backup-codes/regenerate/": {
|
|
45
|
+
"post": {
|
|
46
|
+
"operationId": "cfg_totp_backup_codes_regenerate_create",
|
|
47
|
+
"description": "Regenerate backup codes.\n\nRequires TOTP code for verification.\nInvalidates all existing codes.",
|
|
48
|
+
"tags": [
|
|
49
|
+
"Backup Codes"
|
|
50
|
+
],
|
|
51
|
+
"requestBody": {
|
|
52
|
+
"content": {
|
|
53
|
+
"application/json": {
|
|
54
|
+
"schema": {
|
|
55
|
+
"$ref": "#/components/schemas/BackupCodesRegenerateRequest"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"application/x-www-form-urlencoded": {
|
|
59
|
+
"schema": {
|
|
60
|
+
"$ref": "#/components/schemas/BackupCodesRegenerateRequest"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"multipart/form-data": {
|
|
64
|
+
"schema": {
|
|
65
|
+
"$ref": "#/components/schemas/BackupCodesRegenerateRequest"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"required": true
|
|
70
|
+
},
|
|
71
|
+
"security": [
|
|
72
|
+
{
|
|
73
|
+
"jwtAuthWithLastLogin": []
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"responses": {
|
|
77
|
+
"200": {
|
|
78
|
+
"content": {
|
|
79
|
+
"application/json": {
|
|
80
|
+
"schema": {
|
|
81
|
+
"$ref": "#/components/schemas/BackupCodesRegenerateResponse"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"description": ""
|
|
86
|
+
},
|
|
87
|
+
"400": {
|
|
88
|
+
"content": {
|
|
89
|
+
"application/json": {
|
|
90
|
+
"schema": {
|
|
91
|
+
"description": "Invalid code or 2FA not enabled"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"description": ""
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"x-async-capable": false
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"/cfg/totp/devices/": {
|
|
102
|
+
"get": {
|
|
103
|
+
"operationId": "cfg_totp_devices_list",
|
|
104
|
+
"description": "List all TOTP devices for user.",
|
|
105
|
+
"parameters": [
|
|
106
|
+
{
|
|
107
|
+
"name": "page",
|
|
108
|
+
"required": false,
|
|
109
|
+
"in": "query",
|
|
110
|
+
"description": "A page number within the paginated result set.",
|
|
111
|
+
"schema": {
|
|
112
|
+
"type": "integer"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "page_size",
|
|
117
|
+
"required": false,
|
|
118
|
+
"in": "query",
|
|
119
|
+
"description": "Number of results to return per page.",
|
|
120
|
+
"schema": {
|
|
121
|
+
"type": "integer"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"tags": [
|
|
126
|
+
"2FA Management"
|
|
127
|
+
],
|
|
128
|
+
"security": [
|
|
129
|
+
{
|
|
130
|
+
"jwtAuthWithLastLogin": []
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"responses": {
|
|
134
|
+
"200": {
|
|
135
|
+
"content": {
|
|
136
|
+
"application/json": {
|
|
137
|
+
"schema": {
|
|
138
|
+
"$ref": "#/components/schemas/PaginatedDeviceListList"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"description": ""
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"x-async-capable": false
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"/cfg/totp/devices/{id}/": {
|
|
149
|
+
"delete": {
|
|
150
|
+
"operationId": "cfg_totp_devices_destroy",
|
|
151
|
+
"description": "Delete a TOTP device.\n\nRequires verification code if removing the last/primary device.",
|
|
152
|
+
"parameters": [
|
|
153
|
+
{
|
|
154
|
+
"in": "path",
|
|
155
|
+
"name": "id",
|
|
156
|
+
"schema": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"format": "uuid"
|
|
159
|
+
},
|
|
160
|
+
"required": true
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"tags": [
|
|
164
|
+
"totp"
|
|
165
|
+
],
|
|
166
|
+
"security": [
|
|
167
|
+
{
|
|
168
|
+
"jwtAuthWithLastLogin": []
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"responses": {
|
|
172
|
+
"204": {
|
|
173
|
+
"description": "No response body"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"x-async-capable": false
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"/cfg/totp/disable/": {
|
|
180
|
+
"post": {
|
|
181
|
+
"operationId": "cfg_totp_disable_create",
|
|
182
|
+
"description": "Completely disable 2FA for account.\n\nRequires verification code.",
|
|
183
|
+
"tags": [
|
|
184
|
+
"2FA Management"
|
|
185
|
+
],
|
|
186
|
+
"requestBody": {
|
|
187
|
+
"content": {
|
|
188
|
+
"application/json": {
|
|
189
|
+
"schema": {
|
|
190
|
+
"$ref": "#/components/schemas/DisableRequest"
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"application/x-www-form-urlencoded": {
|
|
194
|
+
"schema": {
|
|
195
|
+
"$ref": "#/components/schemas/DisableRequest"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"multipart/form-data": {
|
|
199
|
+
"schema": {
|
|
200
|
+
"$ref": "#/components/schemas/DisableRequest"
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"required": true
|
|
205
|
+
},
|
|
206
|
+
"security": [
|
|
207
|
+
{
|
|
208
|
+
"jwtAuthWithLastLogin": []
|
|
209
|
+
}
|
|
210
|
+
],
|
|
211
|
+
"responses": {
|
|
212
|
+
"200": {
|
|
213
|
+
"content": {
|
|
214
|
+
"application/json": {
|
|
215
|
+
"schema": {
|
|
216
|
+
"description": "2FA disabled successfully"
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"description": ""
|
|
221
|
+
},
|
|
222
|
+
"400": {
|
|
223
|
+
"content": {
|
|
224
|
+
"application/json": {
|
|
225
|
+
"schema": {
|
|
226
|
+
"description": "Invalid code"
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"description": ""
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
"x-async-capable": false
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
"/cfg/totp/setup/": {
|
|
237
|
+
"post": {
|
|
238
|
+
"operationId": "cfg_totp_setup_create",
|
|
239
|
+
"description": "Start 2FA setup process.\n\nCreates a new TOTP device and returns QR code for scanning.",
|
|
240
|
+
"tags": [
|
|
241
|
+
"2FA Setup"
|
|
242
|
+
],
|
|
243
|
+
"requestBody": {
|
|
244
|
+
"content": {
|
|
245
|
+
"application/json": {
|
|
246
|
+
"schema": {
|
|
247
|
+
"$ref": "#/components/schemas/SetupRequest"
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
"application/x-www-form-urlencoded": {
|
|
251
|
+
"schema": {
|
|
252
|
+
"$ref": "#/components/schemas/SetupRequest"
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"multipart/form-data": {
|
|
256
|
+
"schema": {
|
|
257
|
+
"$ref": "#/components/schemas/SetupRequest"
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
"security": [
|
|
263
|
+
{
|
|
264
|
+
"jwtAuthWithLastLogin": []
|
|
265
|
+
}
|
|
266
|
+
],
|
|
267
|
+
"responses": {
|
|
268
|
+
"200": {
|
|
269
|
+
"content": {
|
|
270
|
+
"application/json": {
|
|
271
|
+
"schema": {
|
|
272
|
+
"$ref": "#/components/schemas/SetupResponse"
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
"description": ""
|
|
277
|
+
},
|
|
278
|
+
"400": {
|
|
279
|
+
"content": {
|
|
280
|
+
"application/json": {
|
|
281
|
+
"schema": {
|
|
282
|
+
"description": "2FA already enabled or invalid request"
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
"description": ""
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"x-async-capable": false
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
"/cfg/totp/setup/confirm/": {
|
|
293
|
+
"post": {
|
|
294
|
+
"operationId": "cfg_totp_setup_confirm_create",
|
|
295
|
+
"description": "Confirm 2FA setup with first valid code.\n\nActivates the device and generates backup codes.",
|
|
296
|
+
"tags": [
|
|
297
|
+
"2FA Setup"
|
|
298
|
+
],
|
|
299
|
+
"requestBody": {
|
|
300
|
+
"content": {
|
|
301
|
+
"application/json": {
|
|
302
|
+
"schema": {
|
|
303
|
+
"$ref": "#/components/schemas/ConfirmSetupRequest"
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
"application/x-www-form-urlencoded": {
|
|
307
|
+
"schema": {
|
|
308
|
+
"$ref": "#/components/schemas/ConfirmSetupRequest"
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"multipart/form-data": {
|
|
312
|
+
"schema": {
|
|
313
|
+
"$ref": "#/components/schemas/ConfirmSetupRequest"
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
"required": true
|
|
318
|
+
},
|
|
319
|
+
"security": [
|
|
320
|
+
{
|
|
321
|
+
"jwtAuthWithLastLogin": []
|
|
322
|
+
}
|
|
323
|
+
],
|
|
324
|
+
"responses": {
|
|
325
|
+
"200": {
|
|
326
|
+
"content": {
|
|
327
|
+
"application/json": {
|
|
328
|
+
"schema": {
|
|
329
|
+
"$ref": "#/components/schemas/ConfirmSetupResponse"
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
"description": ""
|
|
334
|
+
},
|
|
335
|
+
"400": {
|
|
336
|
+
"content": {
|
|
337
|
+
"application/json": {
|
|
338
|
+
"schema": {
|
|
339
|
+
"description": "Invalid code or setup expired"
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
"description": ""
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
"x-async-capable": false
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
"/cfg/totp/verify/": {
|
|
350
|
+
"post": {
|
|
351
|
+
"operationId": "cfg_totp_verify_create",
|
|
352
|
+
"description": "Verify TOTP code for 2FA session.\n\nCompletes authentication and returns JWT tokens on success.",
|
|
353
|
+
"tags": [
|
|
354
|
+
"2FA Verification"
|
|
355
|
+
],
|
|
356
|
+
"requestBody": {
|
|
357
|
+
"content": {
|
|
358
|
+
"application/json": {
|
|
359
|
+
"schema": {
|
|
360
|
+
"$ref": "#/components/schemas/VerifyRequest"
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
"application/x-www-form-urlencoded": {
|
|
364
|
+
"schema": {
|
|
365
|
+
"$ref": "#/components/schemas/VerifyRequest"
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
"multipart/form-data": {
|
|
369
|
+
"schema": {
|
|
370
|
+
"$ref": "#/components/schemas/VerifyRequest"
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
"required": true
|
|
375
|
+
},
|
|
376
|
+
"security": [
|
|
377
|
+
{
|
|
378
|
+
"jwtAuthWithLastLogin": []
|
|
379
|
+
},
|
|
380
|
+
{}
|
|
381
|
+
],
|
|
382
|
+
"responses": {
|
|
383
|
+
"200": {
|
|
384
|
+
"content": {
|
|
385
|
+
"application/json": {
|
|
386
|
+
"schema": {
|
|
387
|
+
"$ref": "#/components/schemas/VerifyResponse"
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
"description": ""
|
|
392
|
+
},
|
|
393
|
+
"400": {
|
|
394
|
+
"content": {
|
|
395
|
+
"application/json": {
|
|
396
|
+
"schema": {
|
|
397
|
+
"description": "Invalid code or session"
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
"description": ""
|
|
402
|
+
},
|
|
403
|
+
"403": {
|
|
404
|
+
"content": {
|
|
405
|
+
"application/json": {
|
|
406
|
+
"schema": {
|
|
407
|
+
"description": "Too many attempts"
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
"description": ""
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
"x-async-capable": false
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
"/cfg/totp/verify/backup/": {
|
|
418
|
+
"post": {
|
|
419
|
+
"operationId": "cfg_totp_verify_backup_create",
|
|
420
|
+
"description": "Verify backup recovery code for 2FA session.\n\nAlternative verification method when TOTP device unavailable.",
|
|
421
|
+
"tags": [
|
|
422
|
+
"2FA Verification"
|
|
423
|
+
],
|
|
424
|
+
"requestBody": {
|
|
425
|
+
"content": {
|
|
426
|
+
"application/json": {
|
|
427
|
+
"schema": {
|
|
428
|
+
"$ref": "#/components/schemas/VerifyBackupRequest"
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
"application/x-www-form-urlencoded": {
|
|
432
|
+
"schema": {
|
|
433
|
+
"$ref": "#/components/schemas/VerifyBackupRequest"
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
"multipart/form-data": {
|
|
437
|
+
"schema": {
|
|
438
|
+
"$ref": "#/components/schemas/VerifyBackupRequest"
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
"required": true
|
|
443
|
+
},
|
|
444
|
+
"security": [
|
|
445
|
+
{
|
|
446
|
+
"jwtAuthWithLastLogin": []
|
|
447
|
+
},
|
|
448
|
+
{}
|
|
449
|
+
],
|
|
450
|
+
"responses": {
|
|
451
|
+
"200": {
|
|
452
|
+
"content": {
|
|
453
|
+
"application/json": {
|
|
454
|
+
"schema": {
|
|
455
|
+
"$ref": "#/components/schemas/VerifyResponse"
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
"description": ""
|
|
460
|
+
},
|
|
461
|
+
"400": {
|
|
462
|
+
"content": {
|
|
463
|
+
"application/json": {
|
|
464
|
+
"schema": {
|
|
465
|
+
"description": "Invalid backup code or session"
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
"description": ""
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
"x-async-capable": false
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
"components": {
|
|
477
|
+
"schemas": {
|
|
478
|
+
"BackupCodesRegenerateRequest": {
|
|
479
|
+
"type": "object",
|
|
480
|
+
"description": "Serializer for regenerating backup codes.",
|
|
481
|
+
"properties": {
|
|
482
|
+
"code": {
|
|
483
|
+
"type": "string",
|
|
484
|
+
"minLength": 6,
|
|
485
|
+
"description": "TOTP code for verification",
|
|
486
|
+
"maxLength": 6
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
"required": [
|
|
490
|
+
"code"
|
|
491
|
+
]
|
|
492
|
+
},
|
|
493
|
+
"BackupCodesRegenerateResponse": {
|
|
494
|
+
"type": "object",
|
|
495
|
+
"description": "Response serializer for backup codes regeneration.",
|
|
496
|
+
"properties": {
|
|
497
|
+
"backup_codes": {
|
|
498
|
+
"type": "array",
|
|
499
|
+
"items": {
|
|
500
|
+
"type": "string"
|
|
501
|
+
},
|
|
502
|
+
"description": "List of new backup codes (save these!)"
|
|
503
|
+
},
|
|
504
|
+
"warning": {
|
|
505
|
+
"type": "string",
|
|
506
|
+
"description": "Warning about previous codes being invalidated"
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
"required": [
|
|
510
|
+
"backup_codes",
|
|
511
|
+
"warning"
|
|
512
|
+
]
|
|
513
|
+
},
|
|
514
|
+
"BackupCodesStatus": {
|
|
515
|
+
"type": "object",
|
|
516
|
+
"description": "Serializer for backup codes status.",
|
|
517
|
+
"properties": {
|
|
518
|
+
"remaining_count": {
|
|
519
|
+
"type": "integer",
|
|
520
|
+
"description": "Number of unused backup codes"
|
|
521
|
+
},
|
|
522
|
+
"total_generated": {
|
|
523
|
+
"type": "integer",
|
|
524
|
+
"description": "Total number of codes generated"
|
|
525
|
+
},
|
|
526
|
+
"warning": {
|
|
527
|
+
"type": "string",
|
|
528
|
+
"nullable": true,
|
|
529
|
+
"description": "Warning if running low on codes"
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
"required": [
|
|
533
|
+
"remaining_count",
|
|
534
|
+
"total_generated"
|
|
535
|
+
]
|
|
536
|
+
},
|
|
537
|
+
"ConfirmSetupRequest": {
|
|
538
|
+
"type": "object",
|
|
539
|
+
"description": "Serializer for confirming 2FA setup with first code.",
|
|
540
|
+
"properties": {
|
|
541
|
+
"device_id": {
|
|
542
|
+
"type": "string",
|
|
543
|
+
"format": "uuid",
|
|
544
|
+
"description": "Device ID from setup response"
|
|
545
|
+
},
|
|
546
|
+
"code": {
|
|
547
|
+
"type": "string",
|
|
548
|
+
"minLength": 6,
|
|
549
|
+
"description": "6-digit TOTP code from authenticator app",
|
|
550
|
+
"maxLength": 6
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
"required": [
|
|
554
|
+
"code",
|
|
555
|
+
"device_id"
|
|
556
|
+
]
|
|
557
|
+
},
|
|
558
|
+
"ConfirmSetupResponse": {
|
|
559
|
+
"type": "object",
|
|
560
|
+
"description": "Response serializer for setup confirmation.",
|
|
561
|
+
"properties": {
|
|
562
|
+
"message": {
|
|
563
|
+
"type": "string"
|
|
564
|
+
},
|
|
565
|
+
"backup_codes": {
|
|
566
|
+
"type": "array",
|
|
567
|
+
"items": {
|
|
568
|
+
"type": "string"
|
|
569
|
+
},
|
|
570
|
+
"description": "List of backup recovery codes (save these!)"
|
|
571
|
+
},
|
|
572
|
+
"backup_codes_warning": {
|
|
573
|
+
"type": "string",
|
|
574
|
+
"description": "Warning message about backup codes"
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
"required": [
|
|
578
|
+
"backup_codes",
|
|
579
|
+
"backup_codes_warning",
|
|
580
|
+
"message"
|
|
581
|
+
]
|
|
582
|
+
},
|
|
583
|
+
"DeviceList": {
|
|
584
|
+
"type": "object",
|
|
585
|
+
"description": "Serializer for listing TOTP devices.",
|
|
586
|
+
"properties": {
|
|
587
|
+
"id": {
|
|
588
|
+
"type": "integer",
|
|
589
|
+
"readOnly": true
|
|
590
|
+
},
|
|
591
|
+
"name": {
|
|
592
|
+
"type": "string",
|
|
593
|
+
"readOnly": true,
|
|
594
|
+
"description": "Device name for identification"
|
|
595
|
+
},
|
|
596
|
+
"is_primary": {
|
|
597
|
+
"type": "boolean",
|
|
598
|
+
"readOnly": true,
|
|
599
|
+
"description": "Primary device used for verification"
|
|
600
|
+
},
|
|
601
|
+
"status": {
|
|
602
|
+
"enum": [
|
|
603
|
+
"pending",
|
|
604
|
+
"active",
|
|
605
|
+
"disabled"
|
|
606
|
+
],
|
|
607
|
+
"type": "string",
|
|
608
|
+
"description": "* `pending` - Pending Confirmation\n* `active` - Active\n* `disabled` - Disabled",
|
|
609
|
+
"x-spec-enum-id": "c058383a5a3854d4",
|
|
610
|
+
"readOnly": true
|
|
611
|
+
},
|
|
612
|
+
"created_at": {
|
|
613
|
+
"type": "string",
|
|
614
|
+
"format": "date-time",
|
|
615
|
+
"readOnly": true
|
|
616
|
+
},
|
|
617
|
+
"confirmed_at": {
|
|
618
|
+
"type": "string",
|
|
619
|
+
"format": "date-time",
|
|
620
|
+
"readOnly": true,
|
|
621
|
+
"nullable": true,
|
|
622
|
+
"description": "When device setup was confirmed"
|
|
623
|
+
},
|
|
624
|
+
"last_used_at": {
|
|
625
|
+
"type": "string",
|
|
626
|
+
"format": "date-time",
|
|
627
|
+
"readOnly": true,
|
|
628
|
+
"nullable": true,
|
|
629
|
+
"description": "Last successful verification"
|
|
630
|
+
}
|
|
631
|
+
},
|
|
632
|
+
"required": [
|
|
633
|
+
"confirmed_at",
|
|
634
|
+
"created_at",
|
|
635
|
+
"id",
|
|
636
|
+
"is_primary",
|
|
637
|
+
"last_used_at",
|
|
638
|
+
"name",
|
|
639
|
+
"status"
|
|
640
|
+
]
|
|
641
|
+
},
|
|
642
|
+
"DisableRequest": {
|
|
643
|
+
"type": "object",
|
|
644
|
+
"description": "Serializer for completely disabling 2FA.",
|
|
645
|
+
"properties": {
|
|
646
|
+
"code": {
|
|
647
|
+
"type": "string",
|
|
648
|
+
"minLength": 6,
|
|
649
|
+
"description": "TOTP code for verification",
|
|
650
|
+
"maxLength": 6
|
|
651
|
+
}
|
|
652
|
+
},
|
|
653
|
+
"required": [
|
|
654
|
+
"code"
|
|
655
|
+
]
|
|
656
|
+
},
|
|
657
|
+
"PaginatedDeviceListList": {
|
|
658
|
+
"type": "object",
|
|
659
|
+
"required": [
|
|
660
|
+
"count",
|
|
661
|
+
"page",
|
|
662
|
+
"pages",
|
|
663
|
+
"page_size",
|
|
664
|
+
"has_next",
|
|
665
|
+
"has_previous",
|
|
666
|
+
"results"
|
|
667
|
+
],
|
|
668
|
+
"properties": {
|
|
669
|
+
"count": {
|
|
670
|
+
"type": "integer",
|
|
671
|
+
"description": "Total number of items across all pages",
|
|
672
|
+
"example": 150
|
|
673
|
+
},
|
|
674
|
+
"page": {
|
|
675
|
+
"type": "integer",
|
|
676
|
+
"description": "Current page number (1-based)",
|
|
677
|
+
"example": 2
|
|
678
|
+
},
|
|
679
|
+
"pages": {
|
|
680
|
+
"type": "integer",
|
|
681
|
+
"description": "Total number of pages",
|
|
682
|
+
"example": 15
|
|
683
|
+
},
|
|
684
|
+
"page_size": {
|
|
685
|
+
"type": "integer",
|
|
686
|
+
"description": "Number of items per page",
|
|
687
|
+
"example": 10
|
|
688
|
+
},
|
|
689
|
+
"has_next": {
|
|
690
|
+
"type": "boolean",
|
|
691
|
+
"description": "Whether there is a next page",
|
|
692
|
+
"example": true
|
|
693
|
+
},
|
|
694
|
+
"has_previous": {
|
|
695
|
+
"type": "boolean",
|
|
696
|
+
"description": "Whether there is a previous page",
|
|
697
|
+
"example": true
|
|
698
|
+
},
|
|
699
|
+
"next_page": {
|
|
700
|
+
"type": "integer",
|
|
701
|
+
"nullable": true,
|
|
702
|
+
"description": "Next page number (null if no next page)",
|
|
703
|
+
"example": 3
|
|
704
|
+
},
|
|
705
|
+
"previous_page": {
|
|
706
|
+
"type": "integer",
|
|
707
|
+
"nullable": true,
|
|
708
|
+
"description": "Previous page number (null if no previous page)",
|
|
709
|
+
"example": 1
|
|
710
|
+
},
|
|
711
|
+
"results": {
|
|
712
|
+
"type": "array",
|
|
713
|
+
"items": {
|
|
714
|
+
"$ref": "#/components/schemas/DeviceList"
|
|
715
|
+
},
|
|
716
|
+
"description": "Array of items for current page"
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
},
|
|
720
|
+
"SetupRequest": {
|
|
721
|
+
"type": "object",
|
|
722
|
+
"description": "Serializer for starting 2FA setup.",
|
|
723
|
+
"properties": {
|
|
724
|
+
"device_name": {
|
|
725
|
+
"type": "string",
|
|
726
|
+
"minLength": 1,
|
|
727
|
+
"default": "Authenticator",
|
|
728
|
+
"description": "Device name for identification (e.g., 'My iPhone')",
|
|
729
|
+
"maxLength": 100
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
},
|
|
733
|
+
"SetupResponse": {
|
|
734
|
+
"type": "object",
|
|
735
|
+
"description": "Response serializer for setup initiation.",
|
|
736
|
+
"properties": {
|
|
737
|
+
"device_id": {
|
|
738
|
+
"type": "string",
|
|
739
|
+
"format": "uuid",
|
|
740
|
+
"description": "Device ID to use for confirmation"
|
|
741
|
+
},
|
|
742
|
+
"secret": {
|
|
743
|
+
"type": "string",
|
|
744
|
+
"description": "Base32-encoded TOTP secret (for manual entry)"
|
|
745
|
+
},
|
|
746
|
+
"provisioning_uri": {
|
|
747
|
+
"type": "string",
|
|
748
|
+
"description": "otpauth:// URI for QR code generation"
|
|
749
|
+
},
|
|
750
|
+
"qr_code_base64": {
|
|
751
|
+
"type": "string",
|
|
752
|
+
"description": "Base64-encoded QR code image (data URI)"
|
|
753
|
+
},
|
|
754
|
+
"expires_in": {
|
|
755
|
+
"type": "integer",
|
|
756
|
+
"description": "Seconds until setup expires (typically 600 = 10 minutes)"
|
|
757
|
+
}
|
|
758
|
+
},
|
|
759
|
+
"required": [
|
|
760
|
+
"device_id",
|
|
761
|
+
"expires_in",
|
|
762
|
+
"provisioning_uri",
|
|
763
|
+
"qr_code_base64",
|
|
764
|
+
"secret"
|
|
765
|
+
]
|
|
766
|
+
},
|
|
767
|
+
"VerifyBackupRequest": {
|
|
768
|
+
"type": "object",
|
|
769
|
+
"description": "Serializer for backup code verification during login.",
|
|
770
|
+
"properties": {
|
|
771
|
+
"session_id": {
|
|
772
|
+
"type": "string",
|
|
773
|
+
"format": "uuid",
|
|
774
|
+
"description": "2FA session ID from login response"
|
|
775
|
+
},
|
|
776
|
+
"backup_code": {
|
|
777
|
+
"type": "string",
|
|
778
|
+
"minLength": 8,
|
|
779
|
+
"description": "8-character backup recovery code",
|
|
780
|
+
"maxLength": 8
|
|
781
|
+
}
|
|
782
|
+
},
|
|
783
|
+
"required": [
|
|
784
|
+
"backup_code",
|
|
785
|
+
"session_id"
|
|
786
|
+
]
|
|
787
|
+
},
|
|
788
|
+
"VerifyRequest": {
|
|
789
|
+
"type": "object",
|
|
790
|
+
"description": "Serializer for TOTP code verification during login.",
|
|
791
|
+
"properties": {
|
|
792
|
+
"session_id": {
|
|
793
|
+
"type": "string",
|
|
794
|
+
"format": "uuid",
|
|
795
|
+
"description": "2FA session ID from login response"
|
|
796
|
+
},
|
|
797
|
+
"code": {
|
|
798
|
+
"type": "string",
|
|
799
|
+
"minLength": 6,
|
|
800
|
+
"description": "6-digit TOTP code from authenticator app",
|
|
801
|
+
"maxLength": 6
|
|
802
|
+
}
|
|
803
|
+
},
|
|
804
|
+
"required": [
|
|
805
|
+
"code",
|
|
806
|
+
"session_id"
|
|
807
|
+
]
|
|
808
|
+
},
|
|
809
|
+
"VerifyResponse": {
|
|
810
|
+
"type": "object",
|
|
811
|
+
"description": "Response serializer for successful 2FA verification.",
|
|
812
|
+
"properties": {
|
|
813
|
+
"message": {
|
|
814
|
+
"type": "string"
|
|
815
|
+
},
|
|
816
|
+
"access_token": {
|
|
817
|
+
"type": "string",
|
|
818
|
+
"description": "JWT access token"
|
|
819
|
+
},
|
|
820
|
+
"refresh_token": {
|
|
821
|
+
"type": "string",
|
|
822
|
+
"description": "JWT refresh token"
|
|
823
|
+
},
|
|
824
|
+
"user": {
|
|
825
|
+
"type": "object",
|
|
826
|
+
"additionalProperties": {},
|
|
827
|
+
"description": "User profile data"
|
|
828
|
+
},
|
|
829
|
+
"remaining_backup_codes": {
|
|
830
|
+
"type": "integer",
|
|
831
|
+
"description": "Number of remaining backup codes (if backup code was used)"
|
|
832
|
+
},
|
|
833
|
+
"warning": {
|
|
834
|
+
"type": "string",
|
|
835
|
+
"description": "Warning message (e.g., low backup codes)"
|
|
836
|
+
}
|
|
837
|
+
},
|
|
838
|
+
"required": [
|
|
839
|
+
"access_token",
|
|
840
|
+
"message",
|
|
841
|
+
"refresh_token",
|
|
842
|
+
"user"
|
|
843
|
+
]
|
|
844
|
+
}
|
|
845
|
+
},
|
|
846
|
+
"securitySchemes": {
|
|
847
|
+
"jwtAuthWithLastLogin": {
|
|
848
|
+
"type": "http",
|
|
849
|
+
"scheme": "bearer",
|
|
850
|
+
"bearerFormat": "JWT"
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
},
|
|
854
|
+
"servers": [
|
|
855
|
+
{
|
|
856
|
+
"url": "http://localhost:8000"
|
|
857
|
+
}
|
|
858
|
+
]
|
|
859
|
+
}
|