@djangocfg/api 2.1.599 → 2.1.600
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/README.md +2 -1
- package/dist/OAuthProvidersResponse-QZ566OYR.mjs +25 -0
- package/dist/OAuthProvidersResponse-QZ566OYR.mjs.map +1 -0
- package/dist/auth.cjs +526 -288
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +144 -31
- package/dist/auth.d.ts +144 -31
- package/dist/auth.mjs +409 -213
- package/dist/auth.mjs.map +1 -1
- package/dist/cfg_accounts_oauth_connections_response_200_AutoRef-N532BRPN.mjs +28 -0
- package/dist/cfg_accounts_oauth_connections_response_200_AutoRef-N532BRPN.mjs.map +1 -0
- package/dist/chunk-PCOSFQTH.mjs +10 -0
- package/dist/chunk-PCOSFQTH.mjs.map +1 -0
- package/dist/clients.cjs +34 -3
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +135 -14
- package/dist/clients.d.ts +135 -14
- package/dist/clients.mjs +34 -3
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +1 -0
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.mjs +1 -0
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +34 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +169 -17
- package/dist/index.d.ts +169 -17
- package/dist/index.mjs +34 -3
- package/dist/index.mjs.map +1 -1
- package/dist/storage.cjs +1 -0
- package/dist/storage.cjs.map +1 -1
- package/dist/storage.d.cts +1 -0
- package/dist/storage.d.ts +1 -0
- package/dist/storage.mjs +1 -0
- package/dist/storage.mjs.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/noStorageLiterals.test.ts +1 -1
- package/src/_api/generated/_cfg_accounts/hooks/index.ts +2 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthGoogleAuthorizeCreate.ts +68 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthGoogleCallbackCreate.ts +68 -0
- package/src/_api/generated/_cfg_accounts/openapi.json +263 -19
- package/src/_api/generated/_cfg_accounts/schemas/OAuthCallbackRequestRequest.ts +2 -2
- package/src/_api/generated/_cfg_accounts/schemas/OAuthError.ts +2 -1
- package/src/_api/generated/_cfg_accounts/schemas/OAuthErrorCodeEnum.ts +9 -0
- package/src/_api/generated/_cfg_accounts/schemas/OAuthProviderEnum.ts +1 -1
- package/src/_api/generated/_cfg_accounts/schemas/OAuthProviderInfo.ts +14 -0
- package/src/_api/generated/_cfg_accounts/schemas/OAuthProvidersResponse.ts +2 -1
- package/src/_api/generated/_cfg_accounts/schemas/index.ts +2 -0
- package/src/_api/generated/helpers/keys.ts +1 -0
- package/src/_api/generated/openapi.json +263 -19
- package/src/_api/generated/sdk.gen.ts +36 -4
- package/src/_api/generated/types.gen.ts +136 -11
- package/src/auth/__tests__/oauthErrors.test.ts +23 -0
- package/src/auth/__tests__/passwordLogin.test.tsx +1 -0
- package/src/auth/__tests__/useOAuthLogin.test.tsx +387 -0
- package/src/auth/hooks/index.ts +12 -1
- package/src/auth/hooks/useGithubAuth.ts +15 -225
- package/src/auth/hooks/useOAuthLogin.ts +237 -0
- package/src/auth/hooks/useOAuthProviders.ts +76 -0
- package/src/auth/utils/index.ts +8 -0
- package/src/auth/utils/oauthErrors.ts +45 -0
|
@@ -336,7 +336,7 @@
|
|
|
336
336
|
"/cfg/accounts/oauth/github/authorize/": {
|
|
337
337
|
"post": {
|
|
338
338
|
"operationId": "cfg_accounts_oauth_github_authorize_create",
|
|
339
|
-
"description": "Generate GitHub
|
|
339
|
+
"description": "Generate the GitHub authorization URL. Redirect the user to it to start authentication. The redirect URI is derived from the request Origin.",
|
|
340
340
|
"summary": "Start GitHub OAuth",
|
|
341
341
|
"tags": [
|
|
342
342
|
"cfg_accounts_oauth"
|
|
@@ -364,6 +364,16 @@
|
|
|
364
364
|
},
|
|
365
365
|
"description": ""
|
|
366
366
|
},
|
|
367
|
+
"400": {
|
|
368
|
+
"content": {
|
|
369
|
+
"application/json": {
|
|
370
|
+
"schema": {
|
|
371
|
+
"$ref": "#/components/schemas/OAuthError"
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
"description": ""
|
|
376
|
+
},
|
|
367
377
|
"503": {
|
|
368
378
|
"content": {
|
|
369
379
|
"application/json": {
|
|
@@ -381,7 +391,7 @@
|
|
|
381
391
|
"/cfg/accounts/oauth/github/callback/": {
|
|
382
392
|
"post": {
|
|
383
393
|
"operationId": "cfg_accounts_oauth_github_callback_create",
|
|
384
|
-
"description": "Exchange authorization code for JWT tokens. Call this after GitHub redirects back with code.",
|
|
394
|
+
"description": "Exchange the authorization code for JWT tokens. Call this after GitHub redirects back with a code. The state is single use.",
|
|
385
395
|
"summary": "Complete GitHub OAuth",
|
|
386
396
|
"tags": [
|
|
387
397
|
"cfg_accounts_oauth"
|
|
@@ -419,6 +429,187 @@
|
|
|
419
429
|
}
|
|
420
430
|
},
|
|
421
431
|
"description": ""
|
|
432
|
+
},
|
|
433
|
+
"403": {
|
|
434
|
+
"content": {
|
|
435
|
+
"application/json": {
|
|
436
|
+
"schema": {
|
|
437
|
+
"$ref": "#/components/schemas/OAuthError"
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
"description": ""
|
|
442
|
+
},
|
|
443
|
+
"429": {
|
|
444
|
+
"content": {
|
|
445
|
+
"application/json": {
|
|
446
|
+
"schema": {
|
|
447
|
+
"$ref": "#/components/schemas/OAuthError"
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
"description": ""
|
|
452
|
+
},
|
|
453
|
+
"502": {
|
|
454
|
+
"content": {
|
|
455
|
+
"application/json": {
|
|
456
|
+
"schema": {
|
|
457
|
+
"$ref": "#/components/schemas/OAuthError"
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
"description": ""
|
|
462
|
+
},
|
|
463
|
+
"503": {
|
|
464
|
+
"content": {
|
|
465
|
+
"application/json": {
|
|
466
|
+
"schema": {
|
|
467
|
+
"$ref": "#/components/schemas/OAuthError"
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
"description": ""
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
"x-async-capable": false
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
"/cfg/accounts/oauth/google/authorize/": {
|
|
478
|
+
"post": {
|
|
479
|
+
"operationId": "cfg_accounts_oauth_google_authorize_create",
|
|
480
|
+
"description": "Generate the Google authorization URL. Redirect the user to it to start authentication. The redirect URI is derived from the request Origin.",
|
|
481
|
+
"summary": "Start Google OAuth",
|
|
482
|
+
"tags": [
|
|
483
|
+
"cfg_accounts_oauth"
|
|
484
|
+
],
|
|
485
|
+
"requestBody": {
|
|
486
|
+
"content": {
|
|
487
|
+
"application/json": {
|
|
488
|
+
"schema": {
|
|
489
|
+
"$ref": "#/components/schemas/OAuthAuthorizeRequestRequest"
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
"security": [
|
|
495
|
+
{}
|
|
496
|
+
],
|
|
497
|
+
"responses": {
|
|
498
|
+
"200": {
|
|
499
|
+
"content": {
|
|
500
|
+
"application/json": {
|
|
501
|
+
"schema": {
|
|
502
|
+
"$ref": "#/components/schemas/OAuthAuthorizeResponse"
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
},
|
|
506
|
+
"description": ""
|
|
507
|
+
},
|
|
508
|
+
"400": {
|
|
509
|
+
"content": {
|
|
510
|
+
"application/json": {
|
|
511
|
+
"schema": {
|
|
512
|
+
"$ref": "#/components/schemas/OAuthError"
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
"description": ""
|
|
517
|
+
},
|
|
518
|
+
"503": {
|
|
519
|
+
"content": {
|
|
520
|
+
"application/json": {
|
|
521
|
+
"schema": {
|
|
522
|
+
"$ref": "#/components/schemas/OAuthError"
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
"description": ""
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
"x-async-capable": false
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
"/cfg/accounts/oauth/google/callback/": {
|
|
533
|
+
"post": {
|
|
534
|
+
"operationId": "cfg_accounts_oauth_google_callback_create",
|
|
535
|
+
"description": "Exchange the authorization code for JWT tokens. Call this after Google redirects back with a code. The state is single use.",
|
|
536
|
+
"summary": "Complete Google OAuth",
|
|
537
|
+
"tags": [
|
|
538
|
+
"cfg_accounts_oauth"
|
|
539
|
+
],
|
|
540
|
+
"requestBody": {
|
|
541
|
+
"content": {
|
|
542
|
+
"application/json": {
|
|
543
|
+
"schema": {
|
|
544
|
+
"$ref": "#/components/schemas/OAuthCallbackRequestRequest"
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
"required": true
|
|
549
|
+
},
|
|
550
|
+
"security": [
|
|
551
|
+
{}
|
|
552
|
+
],
|
|
553
|
+
"responses": {
|
|
554
|
+
"200": {
|
|
555
|
+
"content": {
|
|
556
|
+
"application/json": {
|
|
557
|
+
"schema": {
|
|
558
|
+
"$ref": "#/components/schemas/OAuthTokenResponse"
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
"description": ""
|
|
563
|
+
},
|
|
564
|
+
"400": {
|
|
565
|
+
"content": {
|
|
566
|
+
"application/json": {
|
|
567
|
+
"schema": {
|
|
568
|
+
"$ref": "#/components/schemas/OAuthError"
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
"description": ""
|
|
573
|
+
},
|
|
574
|
+
"403": {
|
|
575
|
+
"content": {
|
|
576
|
+
"application/json": {
|
|
577
|
+
"schema": {
|
|
578
|
+
"$ref": "#/components/schemas/OAuthError"
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
},
|
|
582
|
+
"description": ""
|
|
583
|
+
},
|
|
584
|
+
"429": {
|
|
585
|
+
"content": {
|
|
586
|
+
"application/json": {
|
|
587
|
+
"schema": {
|
|
588
|
+
"$ref": "#/components/schemas/OAuthError"
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
"description": ""
|
|
593
|
+
},
|
|
594
|
+
"502": {
|
|
595
|
+
"content": {
|
|
596
|
+
"application/json": {
|
|
597
|
+
"schema": {
|
|
598
|
+
"$ref": "#/components/schemas/OAuthError"
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
"description": ""
|
|
603
|
+
},
|
|
604
|
+
"503": {
|
|
605
|
+
"content": {
|
|
606
|
+
"application/json": {
|
|
607
|
+
"schema": {
|
|
608
|
+
"$ref": "#/components/schemas/OAuthError"
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
},
|
|
612
|
+
"description": ""
|
|
422
613
|
}
|
|
423
614
|
},
|
|
424
615
|
"x-async-capable": false
|
|
@@ -427,7 +618,7 @@
|
|
|
427
618
|
"/cfg/accounts/oauth/providers/": {
|
|
428
619
|
"get": {
|
|
429
620
|
"operationId": "cfg_accounts_oauth_providers_retrieve",
|
|
430
|
-
"description": "
|
|
621
|
+
"description": "Providers that are configured, in display order. The login screen shows exactly these buttons.",
|
|
431
622
|
"summary": "List OAuth providers",
|
|
432
623
|
"tags": [
|
|
433
624
|
"cfg_accounts_oauth"
|
|
@@ -1415,7 +1606,7 @@
|
|
|
1415
1606
|
"redirect_uri": {
|
|
1416
1607
|
"type": "string",
|
|
1417
1608
|
"format": "uri",
|
|
1418
|
-
"description": "
|
|
1609
|
+
"description": "Optional. Must be `<origin>/auth?provider=<id>` for an origin of the resolved site; anything else is rejected with `origin_not_allowed`. Omit it: the server derives it from the request Origin."
|
|
1419
1610
|
},
|
|
1420
1611
|
"source_url": {
|
|
1421
1612
|
"type": "string",
|
|
@@ -1449,20 +1640,20 @@
|
|
|
1449
1640
|
"properties": {
|
|
1450
1641
|
"code": {
|
|
1451
1642
|
"type": "string",
|
|
1452
|
-
"minLength":
|
|
1643
|
+
"minLength": 1,
|
|
1453
1644
|
"description": "Authorization code from OAuth provider callback",
|
|
1454
|
-
"maxLength":
|
|
1645
|
+
"maxLength": 2048
|
|
1455
1646
|
},
|
|
1456
1647
|
"state": {
|
|
1457
1648
|
"type": "string",
|
|
1458
|
-
"minLength":
|
|
1459
|
-
"description": "State token
|
|
1460
|
-
"maxLength":
|
|
1649
|
+
"minLength": 1,
|
|
1650
|
+
"description": "State token from the authorize response; single use",
|
|
1651
|
+
"maxLength": 64
|
|
1461
1652
|
},
|
|
1462
1653
|
"redirect_uri": {
|
|
1463
1654
|
"type": "string",
|
|
1464
1655
|
"format": "uri",
|
|
1465
|
-
"description": "
|
|
1656
|
+
"description": "Ignored. The server reuses the redirect URI stored with the state."
|
|
1466
1657
|
}
|
|
1467
1658
|
},
|
|
1468
1659
|
"required": [
|
|
@@ -1485,7 +1676,7 @@
|
|
|
1485
1676
|
}
|
|
1486
1677
|
],
|
|
1487
1678
|
"readOnly": true,
|
|
1488
|
-
"description": "OAuth provider name (github, google, etc.)\n\n* `github` - GitHub"
|
|
1679
|
+
"description": "OAuth provider name (github, google, etc.)\n\n* `github` - GitHub\n* `google` - Google"
|
|
1489
1680
|
},
|
|
1490
1681
|
"provider_display": {
|
|
1491
1682
|
"type": "string",
|
|
@@ -1542,7 +1733,7 @@
|
|
|
1542
1733
|
"$ref": "#/components/schemas/OAuthProviderEnum"
|
|
1543
1734
|
}
|
|
1544
1735
|
],
|
|
1545
|
-
"description": "OAuth provider to disconnect\n\n* `github` - GitHub"
|
|
1736
|
+
"description": "OAuth provider to disconnect\n\n* `github` - GitHub\n* `google` - Google"
|
|
1546
1737
|
}
|
|
1547
1738
|
},
|
|
1548
1739
|
"required": [
|
|
@@ -1554,8 +1745,12 @@
|
|
|
1554
1745
|
"description": "Error response for OAuth endpoints.",
|
|
1555
1746
|
"properties": {
|
|
1556
1747
|
"error": {
|
|
1557
|
-
"
|
|
1558
|
-
|
|
1748
|
+
"allOf": [
|
|
1749
|
+
{
|
|
1750
|
+
"$ref": "#/components/schemas/OAuthErrorCodeEnum"
|
|
1751
|
+
}
|
|
1752
|
+
],
|
|
1753
|
+
"description": "Error code (closed set)\n\n* `oauth_disabled` - oauth_disabled\n* `github_oauth_disabled` - github_oauth_disabled\n* `origin_not_allowed` - origin_not_allowed\n* `missing_redirect_uri` - missing_redirect_uri\n* `invalid_state` - invalid_state\n* `oauth_exchange_failed` - oauth_exchange_failed\n* `invalid_id_token` - invalid_id_token\n* `email_missing` - email_missing\n* `email_not_verified` - email_not_verified\n* `hosted_domain_not_allowed` - hosted_domain_not_allowed\n* `account_inactive` - account_inactive\n* `link_not_allowed` - link_not_allowed\n* `rate_limited` - rate_limited\n* `provider_unavailable` - provider_unavailable\n* `server_error` - server_error\n* `not_found` - not_found"
|
|
1559
1754
|
},
|
|
1560
1755
|
"error_description": {
|
|
1561
1756
|
"type": "string",
|
|
@@ -1566,12 +1761,62 @@
|
|
|
1566
1761
|
"error"
|
|
1567
1762
|
]
|
|
1568
1763
|
},
|
|
1764
|
+
"OAuthErrorCodeEnum": {
|
|
1765
|
+
"enum": [
|
|
1766
|
+
"oauth_disabled",
|
|
1767
|
+
"github_oauth_disabled",
|
|
1768
|
+
"origin_not_allowed",
|
|
1769
|
+
"missing_redirect_uri",
|
|
1770
|
+
"invalid_state",
|
|
1771
|
+
"oauth_exchange_failed",
|
|
1772
|
+
"invalid_id_token",
|
|
1773
|
+
"email_missing",
|
|
1774
|
+
"email_not_verified",
|
|
1775
|
+
"hosted_domain_not_allowed",
|
|
1776
|
+
"account_inactive",
|
|
1777
|
+
"link_not_allowed",
|
|
1778
|
+
"rate_limited",
|
|
1779
|
+
"provider_unavailable",
|
|
1780
|
+
"server_error",
|
|
1781
|
+
"not_found"
|
|
1782
|
+
],
|
|
1783
|
+
"type": "string",
|
|
1784
|
+
"description": "* `oauth_disabled` - oauth_disabled\n* `github_oauth_disabled` - github_oauth_disabled\n* `origin_not_allowed` - origin_not_allowed\n* `missing_redirect_uri` - missing_redirect_uri\n* `invalid_state` - invalid_state\n* `oauth_exchange_failed` - oauth_exchange_failed\n* `invalid_id_token` - invalid_id_token\n* `email_missing` - email_missing\n* `email_not_verified` - email_not_verified\n* `hosted_domain_not_allowed` - hosted_domain_not_allowed\n* `account_inactive` - account_inactive\n* `link_not_allowed` - link_not_allowed\n* `rate_limited` - rate_limited\n* `provider_unavailable` - provider_unavailable\n* `server_error` - server_error\n* `not_found` - not_found"
|
|
1785
|
+
},
|
|
1569
1786
|
"OAuthProviderEnum": {
|
|
1570
1787
|
"enum": [
|
|
1571
|
-
"github"
|
|
1788
|
+
"github",
|
|
1789
|
+
"google"
|
|
1572
1790
|
],
|
|
1573
1791
|
"type": "string",
|
|
1574
|
-
"description": "* `github` - GitHub"
|
|
1792
|
+
"description": "* `github` - GitHub\n* `google` - Google"
|
|
1793
|
+
},
|
|
1794
|
+
"OAuthProviderInfo": {
|
|
1795
|
+
"type": "object",
|
|
1796
|
+
"description": "One enabled sign-in provider.",
|
|
1797
|
+
"properties": {
|
|
1798
|
+
"id": {
|
|
1799
|
+
"allOf": [
|
|
1800
|
+
{
|
|
1801
|
+
"$ref": "#/components/schemas/OAuthProviderEnum"
|
|
1802
|
+
}
|
|
1803
|
+
],
|
|
1804
|
+
"description": "Provider id\n\n* `github` - GitHub\n* `google` - Google"
|
|
1805
|
+
},
|
|
1806
|
+
"name": {
|
|
1807
|
+
"type": "string",
|
|
1808
|
+
"description": "Display name"
|
|
1809
|
+
},
|
|
1810
|
+
"icon": {
|
|
1811
|
+
"type": "string",
|
|
1812
|
+
"description": "Icon key"
|
|
1813
|
+
}
|
|
1814
|
+
},
|
|
1815
|
+
"required": [
|
|
1816
|
+
"icon",
|
|
1817
|
+
"id",
|
|
1818
|
+
"name"
|
|
1819
|
+
]
|
|
1575
1820
|
},
|
|
1576
1821
|
"OAuthProvidersResponse": {
|
|
1577
1822
|
"type": "object",
|
|
@@ -1580,10 +1825,9 @@
|
|
|
1580
1825
|
"providers": {
|
|
1581
1826
|
"type": "array",
|
|
1582
1827
|
"items": {
|
|
1583
|
-
"
|
|
1584
|
-
"additionalProperties": {}
|
|
1828
|
+
"$ref": "#/components/schemas/OAuthProviderInfo"
|
|
1585
1829
|
},
|
|
1586
|
-
"description": "
|
|
1830
|
+
"description": "Providers that are configured, in display order. The login screen shows exactly these."
|
|
1587
1831
|
}
|
|
1588
1832
|
},
|
|
1589
1833
|
"required": [
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
export const OAuthCallbackRequestRequestSchema = z.object({
|
|
8
|
-
code: z.string().min(
|
|
9
|
-
state: z.string().min(
|
|
8
|
+
code: z.string().min(1).max(2048),
|
|
9
|
+
state: z.string().min(1).max(64),
|
|
10
10
|
redirect_uri: z.url().or(z.literal("")).optional(),
|
|
11
11
|
});
|
|
12
12
|
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
|
|
5
5
|
import { z } from "zod";
|
|
6
|
+
import { OAuthErrorCodeEnumSchema } from "./OAuthErrorCodeEnum";
|
|
6
7
|
|
|
7
8
|
export const OAuthErrorSchema = z.object({
|
|
8
|
-
error:
|
|
9
|
+
error: OAuthErrorCodeEnumSchema,
|
|
9
10
|
error_description: z.string().optional(),
|
|
10
11
|
});
|
|
11
12
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
export const OAuthErrorCodeEnumSchema = z.enum(["oauth_disabled", "github_oauth_disabled", "origin_not_allowed", "missing_redirect_uri", "invalid_state", "oauth_exchange_failed", "invalid_id_token", "email_missing", "email_not_verified", "hosted_domain_not_allowed", "account_inactive", "link_not_allowed", "rate_limited", "provider_unavailable", "server_error", "not_found"]);
|
|
8
|
+
|
|
9
|
+
export type OAuthErrorCodeEnum = z.infer<typeof OAuthErrorCodeEnumSchema>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { OAuthProviderEnumSchema } from "./OAuthProviderEnum";
|
|
7
|
+
|
|
8
|
+
export const OAuthProviderInfoSchema = z.object({
|
|
9
|
+
id: OAuthProviderEnumSchema,
|
|
10
|
+
name: z.string(),
|
|
11
|
+
icon: z.string(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type OAuthProviderInfo = z.infer<typeof OAuthProviderInfoSchema>;
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
|
|
5
5
|
import { z } from "zod";
|
|
6
|
+
import { OAuthProviderInfoSchema } from "./OAuthProviderInfo";
|
|
6
7
|
|
|
7
8
|
export const OAuthProvidersResponseSchema = z.object({
|
|
8
|
-
providers: z.array(
|
|
9
|
+
providers: z.array(OAuthProviderInfoSchema),
|
|
9
10
|
});
|
|
10
11
|
|
|
11
12
|
export type OAuthProvidersResponse = z.infer<typeof OAuthProvidersResponseSchema>;
|
|
@@ -17,7 +17,9 @@ export * from "./OAuthCallbackRequestRequest";
|
|
|
17
17
|
export * from "./OAuthConnection";
|
|
18
18
|
export * from "./OAuthDisconnectRequestRequest";
|
|
19
19
|
export * from "./OAuthError";
|
|
20
|
+
export * from "./OAuthErrorCodeEnum";
|
|
20
21
|
export * from "./OAuthProviderEnum";
|
|
22
|
+
export * from "./OAuthProviderInfo";
|
|
21
23
|
export * from "./OAuthProvidersResponse";
|
|
22
24
|
export * from "./OAuthTokenResponse";
|
|
23
25
|
export * from "./OTPErrorResponse";
|
|
@@ -49,6 +49,7 @@ export const CFG_KEYS = {
|
|
|
49
49
|
redirectUrlTs: k('cfg.auth.redirect_url_ts', 'session', true),
|
|
50
50
|
oauthState: k('cfg.auth.oauth_state', 'session', true),
|
|
51
51
|
oauthProvider: k('cfg.auth.oauth_provider', 'session', true),
|
|
52
|
+
oauthProviders: k('cfg.auth.oauth_providers', 'session', false),
|
|
52
53
|
profileCache: k('cfg.profile.cache', 'local', true),
|
|
53
54
|
monitorSessionId: k('cfg.monitor.session_id', 'local', false),
|
|
54
55
|
monitorSessionCookie: k('cfg.monitor.session_id', 'cookie', false),
|