@atproto/oauth-provider 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/account/account.d.ts +6 -2
  3. package/dist/account/account.d.ts.map +1 -1
  4. package/dist/assets/app/bundle-manifest.json +3 -3
  5. package/dist/assets/app/main.css +1 -1
  6. package/dist/assets/app/main.js +3 -3
  7. package/dist/assets/app/main.js.map +1 -1
  8. package/dist/assets/assets-middleware.d.ts +2 -1
  9. package/dist/assets/assets-middleware.d.ts.map +1 -1
  10. package/dist/assets/assets-middleware.js +7 -0
  11. package/dist/assets/assets-middleware.js.map +1 -1
  12. package/dist/client/client-manager.d.ts +4 -3
  13. package/dist/client/client-manager.d.ts.map +1 -1
  14. package/dist/client/client-manager.js +91 -77
  15. package/dist/client/client-manager.js.map +1 -1
  16. package/dist/client/client.d.ts +2 -3
  17. package/dist/client/client.d.ts.map +1 -1
  18. package/dist/client/client.js +6 -12
  19. package/dist/client/client.js.map +1 -1
  20. package/dist/constants.d.ts +2 -0
  21. package/dist/constants.d.ts.map +1 -1
  22. package/dist/constants.js +3 -1
  23. package/dist/constants.js.map +1 -1
  24. package/dist/device/device-manager.d.ts +1 -1
  25. package/dist/device/device-manager.d.ts.map +1 -1
  26. package/dist/device/device-manager.js +2 -2
  27. package/dist/device/device-manager.js.map +1 -1
  28. package/dist/dpop/dpop-manager.d.ts +0 -1
  29. package/dist/dpop/dpop-manager.d.ts.map +1 -1
  30. package/dist/dpop/dpop-manager.js +1 -4
  31. package/dist/dpop/dpop-manager.js.map +1 -1
  32. package/dist/errors/invalid-authorization-details-error.d.ts +4 -3
  33. package/dist/errors/invalid-authorization-details-error.d.ts.map +1 -1
  34. package/dist/errors/invalid-authorization-details-error.js +4 -4
  35. package/dist/errors/invalid-authorization-details-error.js.map +1 -1
  36. package/dist/lib/http/parser.d.ts +13 -7
  37. package/dist/lib/http/parser.d.ts.map +1 -1
  38. package/dist/lib/http/parser.js +29 -9
  39. package/dist/lib/http/parser.js.map +1 -1
  40. package/dist/lib/http/request.d.ts +8 -5
  41. package/dist/lib/http/request.d.ts.map +1 -1
  42. package/dist/lib/http/request.js +24 -12
  43. package/dist/lib/http/request.js.map +1 -1
  44. package/dist/lib/http/stream.d.ts.map +1 -1
  45. package/dist/lib/http/stream.js +3 -2
  46. package/dist/lib/http/stream.js.map +1 -1
  47. package/dist/metadata/build-metadata.d.ts +0 -1
  48. package/dist/metadata/build-metadata.d.ts.map +1 -1
  49. package/dist/metadata/build-metadata.js +9 -49
  50. package/dist/metadata/build-metadata.js.map +1 -1
  51. package/dist/oauth-hooks.d.ts +3 -10
  52. package/dist/oauth-hooks.d.ts.map +1 -1
  53. package/dist/oauth-provider.d.ts +10 -15
  54. package/dist/oauth-provider.d.ts.map +1 -1
  55. package/dist/oauth-provider.js +176 -114
  56. package/dist/oauth-provider.js.map +1 -1
  57. package/dist/oauth-verifier.d.ts +1 -2
  58. package/dist/oauth-verifier.d.ts.map +1 -1
  59. package/dist/oauth-verifier.js.map +1 -1
  60. package/dist/output/build-authorize-data.d.ts +6 -0
  61. package/dist/output/build-authorize-data.d.ts.map +1 -1
  62. package/dist/output/build-authorize-data.js +1 -0
  63. package/dist/output/build-authorize-data.js.map +1 -1
  64. package/dist/replay/replay-manager.d.ts +1 -0
  65. package/dist/replay/replay-manager.d.ts.map +1 -1
  66. package/dist/replay/replay-manager.js +3 -0
  67. package/dist/replay/replay-manager.js.map +1 -1
  68. package/dist/replay/replay-store.d.ts +1 -1
  69. package/dist/request/request-info.d.ts +2 -0
  70. package/dist/request/request-info.d.ts.map +1 -1
  71. package/dist/request/request-manager.d.ts +3 -9
  72. package/dist/request/request-manager.d.ts.map +1 -1
  73. package/dist/request/request-manager.js +52 -77
  74. package/dist/request/request-manager.js.map +1 -1
  75. package/dist/request/types.d.ts +10 -10
  76. package/dist/signer/signed-token-payload.d.ts +88 -88
  77. package/dist/signer/signer.d.ts +24 -31
  78. package/dist/signer/signer.d.ts.map +1 -1
  79. package/dist/signer/signer.js +0 -40
  80. package/dist/signer/signer.js.map +1 -1
  81. package/dist/token/token-claims.d.ts +84 -84
  82. package/dist/token/token-manager.d.ts +1 -2
  83. package/dist/token/token-manager.d.ts.map +1 -1
  84. package/dist/token/token-manager.js +10 -37
  85. package/dist/token/token-manager.js.map +1 -1
  86. package/dist/token/types.d.ts +10 -10
  87. package/package.json +3 -3
  88. package/src/account/account.ts +11 -7
  89. package/src/assets/app/backend-data.ts +9 -2
  90. package/src/assets/app/components/accept-form.tsx +65 -51
  91. package/src/assets/app/components/client-name.tsx +24 -16
  92. package/src/assets/app/components/url-viewer.tsx +3 -3
  93. package/src/assets/app/views/accept-view.tsx +7 -4
  94. package/src/assets/app/views/authorize-view.tsx +2 -1
  95. package/src/assets/assets-middleware.ts +14 -2
  96. package/src/client/client-manager.ts +124 -120
  97. package/src/client/client.ts +5 -17
  98. package/src/constants.ts +3 -0
  99. package/src/device/device-manager.ts +7 -1
  100. package/src/dpop/dpop-manager.ts +1 -6
  101. package/src/errors/invalid-authorization-details-error.ts +9 -4
  102. package/src/lib/http/parser.ts +37 -13
  103. package/src/lib/http/request.ts +61 -15
  104. package/src/lib/http/stream.ts +5 -2
  105. package/src/metadata/build-metadata.ts +9 -56
  106. package/src/oauth-hooks.ts +3 -13
  107. package/src/oauth-provider.ts +187 -177
  108. package/src/oauth-verifier.ts +1 -2
  109. package/src/output/build-authorize-data.ts +8 -0
  110. package/src/replay/replay-manager.ts +9 -0
  111. package/src/replay/replay-store.ts +1 -1
  112. package/src/request/request-info.ts +2 -0
  113. package/src/request/request-manager.ts +81 -107
  114. package/src/signer/signer.ts +0 -63
  115. package/src/token/token-manager.ts +8 -41
  116. package/dist/oidc/claims.d.ts +0 -16
  117. package/dist/oidc/claims.d.ts.map +0 -1
  118. package/dist/oidc/claims.js +0 -29
  119. package/dist/oidc/claims.js.map +0 -1
  120. package/dist/oidc/userinfo.d.ts +0 -7
  121. package/dist/oidc/userinfo.d.ts.map +0 -1
  122. package/dist/oidc/userinfo.js +0 -3
  123. package/dist/oidc/userinfo.js.map +0 -1
  124. package/dist/parameters/claims-requested.d.ts +0 -3
  125. package/dist/parameters/claims-requested.d.ts.map +0 -1
  126. package/dist/parameters/claims-requested.js +0 -77
  127. package/dist/parameters/claims-requested.js.map +0 -1
  128. package/dist/parameters/oidc-payload.d.ts +0 -31
  129. package/dist/parameters/oidc-payload.d.ts.map +0 -1
  130. package/dist/parameters/oidc-payload.js +0 -25
  131. package/dist/parameters/oidc-payload.js.map +0 -1
  132. package/src/assets/app/components/client-identifier.tsx +0 -31
  133. package/src/oidc/claims.ts +0 -35
  134. package/src/oidc/userinfo.ts +0 -11
  135. package/src/parameters/claims-requested.ts +0 -106
  136. package/src/parameters/oidc-payload.ts +0 -28
@@ -2,62 +2,27 @@ import z from 'zod';
2
2
  import { Simplify } from '../lib/util/type.js';
3
3
  export declare const tokenClaimsSchema: z.ZodIntersection<z.ZodObject<{
4
4
  iat: z.ZodNumber;
5
- exp: z.ZodNumber;
6
5
  aud: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "atleastone">]>;
6
+ exp: z.ZodNumber;
7
7
  }, "strip", z.ZodTypeAny, {
8
8
  iat: number;
9
- exp: number;
10
9
  aud: string | [string, ...string[]];
10
+ exp: number;
11
11
  }, {
12
12
  iat: number;
13
- exp: number;
14
13
  aud: string | [string, ...string[]];
14
+ exp: number;
15
15
  }>, z.ZodObject<z.objectUtil.extendShape<{
16
16
  nonce: z.ZodOptional<z.ZodOptional<z.ZodString>>;
17
17
  name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
18
18
  htm: z.ZodOptional<z.ZodOptional<z.ZodString>>;
19
19
  htu: z.ZodOptional<z.ZodOptional<z.ZodString>>;
20
20
  ath: z.ZodOptional<z.ZodOptional<z.ZodString>>;
21
+ sub: z.ZodOptional<z.ZodOptional<z.ZodString>>;
22
+ preferred_username: z.ZodOptional<z.ZodOptional<z.ZodString>>;
21
23
  email: z.ZodOptional<z.ZodOptional<z.ZodString>>;
22
24
  email_verified: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
23
- phone_number: z.ZodOptional<z.ZodOptional<z.ZodString>>;
24
- phone_number_verified: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
25
- address: z.ZodOptional<z.ZodOptional<z.ZodObject<{
26
- formatted: z.ZodOptional<z.ZodString>;
27
- street_address: z.ZodOptional<z.ZodString>;
28
- locality: z.ZodOptional<z.ZodString>;
29
- region: z.ZodOptional<z.ZodString>;
30
- postal_code: z.ZodOptional<z.ZodString>;
31
- country: z.ZodOptional<z.ZodString>;
32
- }, "strip", z.ZodTypeAny, {
33
- formatted?: string | undefined;
34
- street_address?: string | undefined;
35
- locality?: string | undefined;
36
- region?: string | undefined;
37
- postal_code?: string | undefined;
38
- country?: string | undefined;
39
- }, {
40
- formatted?: string | undefined;
41
- street_address?: string | undefined;
42
- locality?: string | undefined;
43
- region?: string | undefined;
44
- postal_code?: string | undefined;
45
- country?: string | undefined;
46
- }>>>;
47
- profile: z.ZodOptional<z.ZodOptional<z.ZodString>>;
48
- family_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
49
- given_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
50
- middle_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
51
- nickname: z.ZodOptional<z.ZodOptional<z.ZodString>>;
52
- preferred_username: z.ZodOptional<z.ZodOptional<z.ZodString>>;
53
- gender: z.ZodOptional<z.ZodOptional<z.ZodString>>;
54
25
  picture: z.ZodOptional<z.ZodOptional<z.ZodString>>;
55
- website: z.ZodOptional<z.ZodOptional<z.ZodString>>;
56
- birthdate: z.ZodOptional<z.ZodOptional<z.ZodString>>;
57
- zoneinfo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
58
- locale: z.ZodOptional<z.ZodOptional<z.ZodString>>;
59
- updated_at: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
60
- sub: z.ZodOptional<z.ZodOptional<z.ZodString>>;
61
26
  nbf: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
62
27
  acr: z.ZodOptional<z.ZodOptional<z.ZodString>>;
63
28
  azp: z.ZodOptional<z.ZodOptional<z.ZodString>>;
@@ -1349,6 +1314,41 @@ export declare const tokenClaimsSchema: z.ZodIntersection<z.ZodObject<{
1349
1314
  c_hash: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1350
1315
  s_hash: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1351
1316
  auth_time: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
1317
+ family_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1318
+ given_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1319
+ middle_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1320
+ nickname: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1321
+ gender: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1322
+ profile: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1323
+ website: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1324
+ birthdate: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1325
+ zoneinfo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1326
+ locale: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1327
+ updated_at: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
1328
+ phone_number: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1329
+ phone_number_verified: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1330
+ address: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1331
+ formatted: z.ZodOptional<z.ZodString>;
1332
+ street_address: z.ZodOptional<z.ZodString>;
1333
+ locality: z.ZodOptional<z.ZodString>;
1334
+ region: z.ZodOptional<z.ZodString>;
1335
+ postal_code: z.ZodOptional<z.ZodString>;
1336
+ country: z.ZodOptional<z.ZodString>;
1337
+ }, "strip", z.ZodTypeAny, {
1338
+ formatted?: string | undefined;
1339
+ street_address?: string | undefined;
1340
+ locality?: string | undefined;
1341
+ region?: string | undefined;
1342
+ postal_code?: string | undefined;
1343
+ country?: string | undefined;
1344
+ }, {
1345
+ formatted?: string | undefined;
1346
+ street_address?: string | undefined;
1347
+ locality?: string | undefined;
1348
+ region?: string | undefined;
1349
+ postal_code?: string | undefined;
1350
+ country?: string | undefined;
1351
+ }>>>;
1352
1352
  authorization_details: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
1353
1353
  type: z.ZodString;
1354
1354
  locations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -1382,31 +1382,10 @@ export declare const tokenClaimsSchema: z.ZodIntersection<z.ZodObject<{
1382
1382
  htm?: string | undefined;
1383
1383
  htu?: string | undefined;
1384
1384
  ath?: string | undefined;
1385
+ preferred_username?: string | undefined;
1385
1386
  email?: string | undefined;
1386
1387
  email_verified?: boolean | undefined;
1387
- phone_number?: string | undefined;
1388
- phone_number_verified?: boolean | undefined;
1389
- address?: {
1390
- formatted?: string | undefined;
1391
- street_address?: string | undefined;
1392
- locality?: string | undefined;
1393
- region?: string | undefined;
1394
- postal_code?: string | undefined;
1395
- country?: string | undefined;
1396
- } | undefined;
1397
- profile?: string | undefined;
1398
- family_name?: string | undefined;
1399
- given_name?: string | undefined;
1400
- middle_name?: string | undefined;
1401
- nickname?: string | undefined;
1402
- preferred_username?: string | undefined;
1403
- gender?: string | undefined;
1404
1388
  picture?: string | undefined;
1405
- website?: string | undefined;
1406
- birthdate?: string | undefined;
1407
- zoneinfo?: string | undefined;
1408
- locale?: string | undefined;
1409
- updated_at?: number | undefined;
1410
1389
  nbf?: number | undefined;
1411
1390
  acr?: string | undefined;
1412
1391
  azp?: string | undefined;
@@ -1520,6 +1499,27 @@ export declare const tokenClaimsSchema: z.ZodIntersection<z.ZodObject<{
1520
1499
  c_hash?: string | undefined;
1521
1500
  s_hash?: string | undefined;
1522
1501
  auth_time?: number | undefined;
1502
+ family_name?: string | undefined;
1503
+ given_name?: string | undefined;
1504
+ middle_name?: string | undefined;
1505
+ nickname?: string | undefined;
1506
+ gender?: string | undefined;
1507
+ profile?: string | undefined;
1508
+ website?: string | undefined;
1509
+ birthdate?: string | undefined;
1510
+ zoneinfo?: string | undefined;
1511
+ locale?: string | undefined;
1512
+ updated_at?: number | undefined;
1513
+ phone_number?: string | undefined;
1514
+ phone_number_verified?: boolean | undefined;
1515
+ address?: {
1516
+ formatted?: string | undefined;
1517
+ street_address?: string | undefined;
1518
+ locality?: string | undefined;
1519
+ region?: string | undefined;
1520
+ postal_code?: string | undefined;
1521
+ country?: string | undefined;
1522
+ } | undefined;
1523
1523
  authorization_details?: z.objectOutputType<{
1524
1524
  type: z.ZodString;
1525
1525
  locations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -1536,31 +1536,10 @@ export declare const tokenClaimsSchema: z.ZodIntersection<z.ZodObject<{
1536
1536
  htm?: string | undefined;
1537
1537
  htu?: string | undefined;
1538
1538
  ath?: string | undefined;
1539
+ preferred_username?: string | undefined;
1539
1540
  email?: string | undefined;
1540
1541
  email_verified?: boolean | undefined;
1541
- phone_number?: string | undefined;
1542
- phone_number_verified?: boolean | undefined;
1543
- address?: {
1544
- formatted?: string | undefined;
1545
- street_address?: string | undefined;
1546
- locality?: string | undefined;
1547
- region?: string | undefined;
1548
- postal_code?: string | undefined;
1549
- country?: string | undefined;
1550
- } | undefined;
1551
- profile?: string | undefined;
1552
- family_name?: string | undefined;
1553
- given_name?: string | undefined;
1554
- middle_name?: string | undefined;
1555
- nickname?: string | undefined;
1556
- preferred_username?: string | undefined;
1557
- gender?: string | undefined;
1558
1542
  picture?: string | undefined;
1559
- website?: string | undefined;
1560
- birthdate?: string | undefined;
1561
- zoneinfo?: string | undefined;
1562
- locale?: string | undefined;
1563
- updated_at?: number | undefined;
1564
1543
  nbf?: number | undefined;
1565
1544
  acr?: string | undefined;
1566
1545
  azp?: string | undefined;
@@ -1674,6 +1653,27 @@ export declare const tokenClaimsSchema: z.ZodIntersection<z.ZodObject<{
1674
1653
  c_hash?: string | undefined;
1675
1654
  s_hash?: string | undefined;
1676
1655
  auth_time?: number | undefined;
1656
+ family_name?: string | undefined;
1657
+ given_name?: string | undefined;
1658
+ middle_name?: string | undefined;
1659
+ nickname?: string | undefined;
1660
+ gender?: string | undefined;
1661
+ profile?: string | undefined;
1662
+ website?: string | undefined;
1663
+ birthdate?: string | undefined;
1664
+ zoneinfo?: string | undefined;
1665
+ locale?: string | undefined;
1666
+ updated_at?: number | undefined;
1667
+ phone_number?: string | undefined;
1668
+ phone_number_verified?: boolean | undefined;
1669
+ address?: {
1670
+ formatted?: string | undefined;
1671
+ street_address?: string | undefined;
1672
+ locality?: string | undefined;
1673
+ region?: string | undefined;
1674
+ postal_code?: string | undefined;
1675
+ country?: string | undefined;
1676
+ } | undefined;
1677
1677
  authorization_details?: z.objectInputType<{
1678
1678
  type: z.ZodString;
1679
1679
  locations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -1,4 +1,3 @@
1
- import { SignedJwt } from '@atproto/jwk';
2
1
  import { AccessToken, OAuthAuthenticationRequestParameters, OAuthTokenResponse, OAuthTokenType } from '@atproto/oauth-types';
3
2
  import { AccessTokenType } from '../access-token/access-token-type.js';
4
3
  import { DeviceAccountInfo } from '../account/account-store.js';
@@ -28,7 +27,7 @@ export declare class TokenManager {
28
27
  id: DeviceId;
29
28
  info: DeviceAccountInfo;
30
29
  }, parameters: OAuthAuthenticationRequestParameters, input: CodeGrantRequest, dpopJkt: null | string): Promise<OAuthTokenResponse>;
31
- protected buildTokenResponse(client: Client, accessToken: AccessToken, refreshToken: string | undefined, idToken: SignedJwt | undefined, expiresAt: Date, parameters: OAuthAuthenticationRequestParameters, account: Account, authorizationDetails: null | any): Promise<OAuthTokenResponse>;
30
+ protected buildTokenResponse(client: Client, accessToken: AccessToken, refreshToken: string | undefined, expiresAt: Date, parameters: OAuthAuthenticationRequestParameters, account: Account, authorizationDetails: null | any): Promise<OAuthTokenResponse>;
32
31
  protected validateAccess(client: Client, clientAuth: ClientAuth, tokenInfo: TokenInfo): Promise<void>;
33
32
  refresh(client: Client, clientAuth: ClientAuth, input: RefreshGrantRequest, dpopJkt: null | string): Promise<OAuthTokenResponse>;
34
33
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"token-manager.d.ts","sourceRoot":"","sources":["../../src/token/token-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EACL,WAAW,EAEX,oCAAoC,EACpC,kBAAkB,EAClB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAQ5C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAQjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAI5C,OAAO,EACL,OAAO,EAIR,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAClE,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EAExB,MAAM,0BAA0B,CAAA;AAEjC,MAAM,MAAM,yBAAyB,GAAG,uBAAuB,GAAG;IAChE,SAAS,EAAE,SAAS,CAAA;CACrB,CAAA;AAED,qBAAa,YAAY;IAErB,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,UAAU;IACpC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE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AAU,EACtB,SAAS,EAAE,SAAS;IAmBhB,OAAO,CACX,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,mBAAmB,EAC1B,OAAO,EAAE,IAAI,GAAG,MAAM,GACrB,OAAO,CAAC,kBAAkB,CAAC;IA+G9B;;OAEG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkC1C;;;;OAIG;IACG,eAAe,CACnB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,SAAS,CAAC;cAoBL,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IA0CjE,YAAY,CAAC,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO;IAcxD,mBAAmB,CACvB,SAAS,EAAE,cAAc,EACzB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,aAAa,CAAC,EAAE,wBAAwB,GACvC,OAAO,CAAC,yBAAyB,CAAC;CA0BtC"}
@@ -87,6 +87,10 @@ class TokenManager {
87
87
  if (!('code_verifier' in input) || !input.code_verifier) {
88
88
  throw new invalid_grant_error_js_1.InvalidGrantError('code_verifier is required');
89
89
  }
90
+ // Prevent client from generating too short code_verifiers
91
+ if (input.code_verifier.length < 43) {
92
+ throw new invalid_grant_error_js_1.InvalidGrantError('code_verifier too short');
93
+ }
90
94
  switch (parameters.code_challenge_method) {
91
95
  case undefined: // Default is "plain" (per spec)
92
96
  case 'plain': {
@@ -121,8 +125,7 @@ class TokenManager {
121
125
  }
122
126
  }
123
127
  const tokenId = await (0, token_id_js_1.generateTokenId)();
124
- const scopes = parameters.scope?.split(' ');
125
- const refreshToken = scopes?.includes('offline_access')
128
+ const refreshToken = client.metadata.grant_types.includes('refresh_token')
126
129
  ? await (0, refresh_token_js_1.generateRefreshToken)()
127
130
  : undefined;
128
131
  const now = new Date();
@@ -153,25 +156,14 @@ class TokenManager {
153
156
  cnf: parameters.dpop_jkt ? { jkt: parameters.dpop_jkt } : undefined,
154
157
  authorization_details: authorizationDetails,
155
158
  });
156
- const idToken = scopes?.includes('openid')
157
- ? await this.signer.idToken(client, parameters, account, {
158
- exp: expiresAt,
159
- iat: now,
160
- // If there is no deviceInfo, we are in a "password_grant" context
161
- auth_time: device?.info.authenticatedAt || new Date(),
162
- access_token: accessToken,
163
- code,
164
- })
165
- : undefined;
166
- return this.buildTokenResponse(client, accessToken, refreshToken, idToken, expiresAt, parameters, account, authorizationDetails);
159
+ return this.buildTokenResponse(client, accessToken, refreshToken, expiresAt, parameters, account, authorizationDetails);
167
160
  }
168
- async buildTokenResponse(client, accessToken, refreshToken, idToken, expiresAt, parameters, account, authorizationDetails) {
161
+ async buildTokenResponse(client, accessToken, refreshToken, expiresAt, parameters, account, authorizationDetails) {
169
162
  const tokenResponse = {
170
163
  access_token: accessToken,
171
164
  token_type: parameters.dpop_jkt ? 'DPoP' : 'Bearer',
172
165
  refresh_token: refreshToken,
173
- id_token: idToken,
174
- scope: parameters.scope ?? '',
166
+ scope: parameters.scope,
175
167
  authorization_details: authorizationDetails,
176
168
  get expires_in() {
177
169
  return (0, date_js_1.dateToRelativeSeconds)(expiresAt);
@@ -181,11 +173,6 @@ class TokenManager {
181
173
  // mechanism.
182
174
  sub: account.sub,
183
175
  };
184
- await this.hooks.onTokenResponse?.call(null, tokenResponse, {
185
- client,
186
- parameters,
187
- account,
188
- });
189
176
  return tokenResponse;
190
177
  }
191
178
  async validateAccess(client, clientAuth, tokenInfo) {
@@ -207,7 +194,7 @@ class TokenManager {
207
194
  if (!tokenInfo?.currentRefreshToken) {
208
195
  throw new invalid_grant_error_js_1.InvalidGrantError(`Invalid refresh token`);
209
196
  }
210
- const { account, info, data } = tokenInfo;
197
+ const { account, data } = tokenInfo;
211
198
  const { parameters } = data;
212
199
  try {
213
200
  if (tokenInfo.currentRefreshToken !== input.refresh_token) {
@@ -273,21 +260,7 @@ class TokenManager {
273
260
  cnf: parameters.dpop_jkt ? { jkt: parameters.dpop_jkt } : undefined,
274
261
  authorization_details,
275
262
  });
276
- // https://openid.net/specs/openid-connect-core-1_0.html#rfc.section.3.1.3.3
277
- //
278
- // > In addition to the response parameters specified by OAuth 2.0, the
279
- // > following parameters MUST be included in the response:
280
- // > - id_token: ID Token value associated with the authenticated session.
281
- const scopes = parameters.scope?.split(' ');
282
- const idToken = scopes?.includes('openid')
283
- ? await this.signer.idToken(client, parameters, account, {
284
- exp: expiresAt,
285
- iat: now,
286
- auth_time: info?.authenticatedAt,
287
- access_token: accessToken,
288
- })
289
- : undefined;
290
- return this.buildTokenResponse(client, accessToken, nextRefreshToken, idToken, expiresAt, parameters, account, authorization_details);
263
+ return this.buildTokenResponse(client, accessToken, nextRefreshToken, expiresAt, parameters, account, authorization_details);
291
264
  }
292
265
  catch (err) {
293
266
  if (err instanceof invalid_request_error_js_1.InvalidRequestError) {
@@ -1 +1 @@
1
- {"version":3,"file":"token-manager.js","sourceRoot":"","sources":["../../src/token/token-manager.ts"],"names":[],"mappings":";;;AAAA,sCAAqD;AACrD,sDAM6B;AAC7B,6CAAwC;AAExC,+EAAsE;AAKtE,kDAMwB;AAExB,mGAAwF;AACxF,uFAA6E;AAC7E,6EAAoE;AACpE,iFAAwE;AACxE,6EAAoE;AACpE,iDAAwE;AACxE,iEAAgE;AAEhE,gDAA2C;AAE3C,yDAAyE;AAGzE,+CAKsB;AAGtB,qEAIiC;AAMjC,MAAa,YAAY;IAEF;IACA;IACA;IACA;IACA;IALrB,YACqB,KAAiB,EACjB,MAAc,EACd,KAAiB,EACjB,eAAgC,EAChC,cAAc,4BAAa;QAJ3B,UAAK,GAAL,KAAK,CAAY;QACjB,WAAM,GAAN,MAAM,CAAQ;QACd,UAAK,GAAL,KAAK,CAAY;QACjB,oBAAe,GAAf,eAAe,CAAiB;QAChC,gBAAW,GAAX,WAAW,CAAgB;IAC7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O,EACP,MAAM,EACN,aAAa,CACd,CAAA;QAED,OAAO,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,CAAA;IACjC,CAAC;CACF;AAvfD,oCAufC"}
@@ -77,12 +77,12 @@ export declare const refreshGrantRequestSchema: z.ZodIntersection<z.ZodUnion<[z.
77
77
  refresh_token: z.ZodEffects<z.ZodString, `ref-${string}`, string>;
78
78
  client_id: z.ZodString;
79
79
  }, "strip", z.ZodTypeAny, {
80
- client_id: string;
81
80
  refresh_token: `ref-${string}`;
81
+ client_id: string;
82
82
  grant_type: "refresh_token";
83
83
  }, {
84
- client_id: string;
85
84
  refresh_token: string;
85
+ client_id: string;
86
86
  grant_type: "refresh_token";
87
87
  }>>;
88
88
  export type RefreshGrantRequest = z.infer<typeof refreshGrantRequestSchema>;
@@ -161,12 +161,12 @@ export declare const tokenRequestSchema: z.ZodUnion<[z.ZodIntersection<z.ZodUnio
161
161
  refresh_token: z.ZodEffects<z.ZodString, `ref-${string}`, string>;
162
162
  client_id: z.ZodString;
163
163
  }, "strip", z.ZodTypeAny, {
164
- client_id: string;
165
164
  refresh_token: `ref-${string}`;
165
+ client_id: string;
166
166
  grant_type: "refresh_token";
167
167
  }, {
168
- client_id: string;
169
168
  refresh_token: string;
169
+ client_id: string;
170
170
  grant_type: "refresh_token";
171
171
  }>>]>;
172
172
  export type TokenRequest = z.infer<typeof tokenRequestSchema>;
@@ -175,10 +175,10 @@ export declare const tokenIdentification: z.ZodObject<{
175
175
  token_type_hint: z.ZodOptional<z.ZodEnum<["access_token", "refresh_token"]>>;
176
176
  }, "strip", z.ZodTypeAny, {
177
177
  token: string;
178
- token_type_hint?: "access_token" | "refresh_token" | undefined;
178
+ token_type_hint?: "refresh_token" | "access_token" | undefined;
179
179
  }, {
180
180
  token: string;
181
- token_type_hint?: "access_token" | "refresh_token" | undefined;
181
+ token_type_hint?: "refresh_token" | "access_token" | undefined;
182
182
  }>;
183
183
  export type TokenIdentification = z.infer<typeof tokenIdentification>;
184
184
  export declare const revokeSchema: z.ZodObject<{
@@ -186,10 +186,10 @@ export declare const revokeSchema: z.ZodObject<{
186
186
  token_type_hint: z.ZodOptional<z.ZodEnum<["access_token", "refresh_token"]>>;
187
187
  }, "strip", z.ZodTypeAny, {
188
188
  token: string;
189
- token_type_hint?: "access_token" | "refresh_token" | undefined;
189
+ token_type_hint?: "refresh_token" | "access_token" | undefined;
190
190
  }, {
191
191
  token: string;
192
- token_type_hint?: "access_token" | "refresh_token" | undefined;
192
+ token_type_hint?: "refresh_token" | "access_token" | undefined;
193
193
  }>;
194
194
  export type Revoke = z.infer<typeof revokeSchema>;
195
195
  export declare const introspectSchema: z.ZodIntersection<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
@@ -224,10 +224,10 @@ export declare const introspectSchema: z.ZodIntersection<z.ZodUnion<[z.ZodUnion<
224
224
  token_type_hint: z.ZodOptional<z.ZodEnum<["access_token", "refresh_token"]>>;
225
225
  }, "strip", z.ZodTypeAny, {
226
226
  token: string;
227
- token_type_hint?: "access_token" | "refresh_token" | undefined;
227
+ token_type_hint?: "refresh_token" | "access_token" | undefined;
228
228
  }, {
229
229
  token: string;
230
- token_type_hint?: "access_token" | "refresh_token" | undefined;
230
+ token_type_hint?: "refresh_token" | "access_token" | undefined;
231
231
  }>>;
232
232
  export type Introspect = z.infer<typeof introspectSchema>;
233
233
  export type IntrospectionResponse = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/oauth-provider",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "license": "MIT",
5
5
  "description": "Generic OAuth2 and OpenID Connect provider for Node.js. Currently only supports features needed for Atproto.",
6
6
  "keywords": [
@@ -30,12 +30,12 @@
30
30
  "dependencies": {
31
31
  "@hapi/accept": "^6.0.3",
32
32
  "@hapi/bourne": "^3.0.0",
33
+ "@hapi/content": "^6.0.0",
33
34
  "cookie": "^0.6.0",
34
35
  "http-errors": "^2.0.0",
35
36
  "ioredis": "^5.3.2",
36
37
  "jose": "^5.2.0",
37
38
  "keygrip": "^1.1.0",
38
- "oidc-token-hash": "^5.0.3",
39
39
  "psl": "^1.9.0",
40
40
  "zod": "^3.23.8",
41
41
  "@atproto-labs/fetch": "0.1.0",
@@ -45,7 +45,7 @@
45
45
  "@atproto-labs/simple-store-memory": "0.1.1",
46
46
  "@atproto/jwk": "0.1.1",
47
47
  "@atproto/jwk-jose": "0.1.2",
48
- "@atproto/oauth-types": "0.1.2"
48
+ "@atproto/oauth-types": "0.1.4"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@rollup/plugin-commonjs": "^25.0.7",
@@ -1,10 +1,14 @@
1
- import { OIDCStandardPayload } from '../oidc/claims.js'
2
1
  import { Sub } from '../oidc/sub.js'
3
2
  import { Simplify } from '../lib/util/type.js'
4
3
 
5
- export type Account = Simplify<
6
- {
7
- sub: Sub // Account id
8
- aud: string | [string, ...string[]] // Resource server URL
9
- } & OIDCStandardPayload
10
- >
4
+ export type Account = Simplify<{
5
+ sub: Sub // Account id
6
+ aud: string | [string, ...string[]] // Resource server URL
7
+
8
+ // OIDC inspired
9
+ preferred_username?: string
10
+ email?: string
11
+ email_verified?: boolean
12
+ picture?: string
13
+ name?: string
14
+ }>
@@ -14,6 +14,7 @@ export type Account = {
14
14
 
15
15
  export type Session = {
16
16
  account: Account
17
+ info?: never // Prevent relying on this in the frontend
17
18
 
18
19
  selected: boolean
19
20
  loginRequired: boolean
@@ -37,15 +38,21 @@ export type ErrorData = {
37
38
  error_description: string
38
39
  }
39
40
 
41
+ export type ScopeDetail = {
42
+ scope: string
43
+ description?: string
44
+ }
45
+
40
46
  export type AuthorizeData = {
41
47
  clientId: string
42
48
  clientMetadata: OAuthClientMetadata
43
49
  clientTrusted: boolean
44
50
  requestUri: string
45
51
  csrfCookie: string
46
- sessions: Session[]
47
- newSessionsRequireConsent: boolean
48
52
  loginHint?: string
53
+ scopeDetails?: ScopeDetail[]
54
+ newSessionsRequireConsent: boolean
55
+ sessions: Session[]
49
56
  }
50
57
 
51
58
  // see "declareBackendData()" in the backend