@atproto/oauth-provider 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. package/CHANGELOG.md +29 -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 +1 -1
  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 +60 -37
  15. package/dist/client/client-manager.js.map +1 -1
  16. package/dist/client/client.d.ts.map +1 -1
  17. package/dist/client/client.js +1 -3
  18. package/dist/client/client.js.map +1 -1
  19. package/dist/constants.d.ts +2 -0
  20. package/dist/constants.d.ts.map +1 -1
  21. package/dist/constants.js +3 -1
  22. package/dist/constants.js.map +1 -1
  23. package/dist/device/device-manager.d.ts +1 -1
  24. package/dist/device/device-manager.d.ts.map +1 -1
  25. package/dist/device/device-manager.js +2 -2
  26. package/dist/device/device-manager.js.map +1 -1
  27. package/dist/errors/invalid-authorization-details-error.d.ts +4 -3
  28. package/dist/errors/invalid-authorization-details-error.d.ts.map +1 -1
  29. package/dist/errors/invalid-authorization-details-error.js +4 -4
  30. package/dist/errors/invalid-authorization-details-error.js.map +1 -1
  31. package/dist/lib/http/request.d.ts +3 -0
  32. package/dist/lib/http/request.d.ts.map +1 -1
  33. package/dist/lib/http/request.js +24 -12
  34. package/dist/lib/http/request.js.map +1 -1
  35. package/dist/metadata/build-metadata.d.ts +0 -1
  36. package/dist/metadata/build-metadata.d.ts.map +1 -1
  37. package/dist/metadata/build-metadata.js +9 -35
  38. package/dist/metadata/build-metadata.js.map +1 -1
  39. package/dist/oauth-hooks.d.ts +3 -10
  40. package/dist/oauth-hooks.d.ts.map +1 -1
  41. package/dist/oauth-provider.d.ts +8 -13
  42. package/dist/oauth-provider.d.ts.map +1 -1
  43. package/dist/oauth-provider.js +169 -109
  44. package/dist/oauth-provider.js.map +1 -1
  45. package/dist/oauth-verifier.d.ts +1 -2
  46. package/dist/oauth-verifier.d.ts.map +1 -1
  47. package/dist/oauth-verifier.js.map +1 -1
  48. package/dist/output/build-authorize-data.d.ts +6 -0
  49. package/dist/output/build-authorize-data.d.ts.map +1 -1
  50. package/dist/output/build-authorize-data.js +1 -0
  51. package/dist/output/build-authorize-data.js.map +1 -1
  52. package/dist/replay/replay-manager.d.ts +1 -0
  53. package/dist/replay/replay-manager.d.ts.map +1 -1
  54. package/dist/replay/replay-manager.js +3 -0
  55. package/dist/replay/replay-manager.js.map +1 -1
  56. package/dist/replay/replay-store.d.ts +1 -1
  57. package/dist/request/request-info.d.ts +2 -0
  58. package/dist/request/request-info.d.ts.map +1 -1
  59. package/dist/request/request-manager.d.ts +3 -9
  60. package/dist/request/request-manager.d.ts.map +1 -1
  61. package/dist/request/request-manager.js +52 -77
  62. package/dist/request/request-manager.js.map +1 -1
  63. package/dist/request/types.d.ts +10 -10
  64. package/dist/signer/signed-token-payload.d.ts +85 -85
  65. package/dist/signer/signer.d.ts +23 -30
  66. package/dist/signer/signer.d.ts.map +1 -1
  67. package/dist/signer/signer.js +0 -40
  68. package/dist/signer/signer.js.map +1 -1
  69. package/dist/token/token-claims.d.ts +81 -81
  70. package/dist/token/token-manager.d.ts +1 -2
  71. package/dist/token/token-manager.d.ts.map +1 -1
  72. package/dist/token/token-manager.js +10 -37
  73. package/dist/token/token-manager.js.map +1 -1
  74. package/dist/token/types.d.ts +10 -10
  75. package/package.json +2 -3
  76. package/src/account/account.ts +11 -7
  77. package/src/assets/app/backend-data.ts +9 -2
  78. package/src/assets/app/components/accept-form.tsx +65 -51
  79. package/src/assets/app/components/client-name.tsx +24 -16
  80. package/src/assets/app/components/url-viewer.tsx +3 -3
  81. package/src/assets/app/views/accept-view.tsx +7 -4
  82. package/src/assets/app/views/authorize-view.tsx +2 -1
  83. package/src/assets/assets-middleware.ts +14 -2
  84. package/src/client/client-manager.ts +78 -60
  85. package/src/client/client.ts +1 -4
  86. package/src/constants.ts +3 -0
  87. package/src/device/device-manager.ts +7 -1
  88. package/src/errors/invalid-authorization-details-error.ts +9 -4
  89. package/src/lib/http/request.ts +61 -15
  90. package/src/metadata/build-metadata.ts +9 -42
  91. package/src/oauth-hooks.ts +3 -13
  92. package/src/oauth-provider.ts +181 -159
  93. package/src/oauth-verifier.ts +1 -2
  94. package/src/output/build-authorize-data.ts +8 -0
  95. package/src/replay/replay-manager.ts +9 -0
  96. package/src/replay/replay-store.ts +1 -1
  97. package/src/request/request-info.ts +2 -0
  98. package/src/request/request-manager.ts +81 -107
  99. package/src/signer/signer.ts +0 -63
  100. package/src/token/token-manager.ts +8 -41
  101. package/dist/oidc/claims.d.ts +0 -16
  102. package/dist/oidc/claims.d.ts.map +0 -1
  103. package/dist/oidc/claims.js +0 -29
  104. package/dist/oidc/claims.js.map +0 -1
  105. package/dist/oidc/userinfo.d.ts +0 -7
  106. package/dist/oidc/userinfo.d.ts.map +0 -1
  107. package/dist/oidc/userinfo.js +0 -3
  108. package/dist/oidc/userinfo.js.map +0 -1
  109. package/dist/parameters/claims-requested.d.ts +0 -3
  110. package/dist/parameters/claims-requested.d.ts.map +0 -1
  111. package/dist/parameters/claims-requested.js +0 -77
  112. package/dist/parameters/claims-requested.js.map +0 -1
  113. package/dist/parameters/oidc-payload.d.ts +0 -31
  114. package/dist/parameters/oidc-payload.d.ts.map +0 -1
  115. package/dist/parameters/oidc-payload.js +0 -25
  116. package/dist/parameters/oidc-payload.js.map +0 -1
  117. package/src/assets/app/components/client-identifier.tsx +0 -31
  118. package/src/oidc/claims.ts +0 -35
  119. package/src/oidc/userinfo.ts +0 -11
  120. package/src/parameters/claims-requested.ts +0 -106
  121. package/src/parameters/oidc-payload.ts +0 -28
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.parseHttpCookies = exports.validateCsrfToken = exports.validateSameOrigin = exports.setupCsrfToken = exports.validateReferer = exports.validateFetchMode = exports.validateRequestPayload = exports.parseRequestPayload = void 0;
6
+ exports.parseHttpCookies = exports.validateCsrfToken = exports.validateSameOrigin = exports.setupCsrfToken = exports.validateReferer = exports.validateFetchSite = exports.validateFetchDest = exports.validateFetchMode = exports.validateHeaderValue = exports.validateRequestPayload = exports.parseRequestPayload = void 0;
7
7
  const cookie_1 = require("cookie");
8
8
  const crypto_1 = require("crypto");
9
9
  const http_errors_1 = __importDefault(require("http-errors"));
@@ -19,23 +19,35 @@ async function validateRequestPayload(req, schema, allow = ['json', 'urlencoded'
19
19
  return schema.parseAsync(payload, { path: ['body'] });
20
20
  }
21
21
  exports.validateRequestPayload = validateRequestPayload;
22
- function validateFetchMode(req, res, expectedMode) {
23
- const reqMode = req.headers['sec-fetch-mode'] ?? null;
24
- if (Array.isArray(reqMode)) {
25
- throw (0, http_errors_1.default)(400, `Invalid sec-fetch-mode header`);
22
+ function validateHeaderValue(req, name, allowedValues) {
23
+ const value = req.headers[name] ?? null;
24
+ if (Array.isArray(value)) {
25
+ throw (0, http_errors_1.default)(400, `Invalid ${name} header`);
26
26
  }
27
- if (!expectedMode.includes(reqMode)) {
28
- throw (0, http_errors_1.default)(403, reqMode
29
- ? `Forbidden sec-fetch-mode "${reqMode}" (expected ${expectedMode})`
30
- : `Missing sec-fetch-mode (expected ${expectedMode})`);
27
+ if (!allowedValues.includes(value)) {
28
+ throw (0, http_errors_1.default)(400, value
29
+ ? `Forbidden ${name} header "${value}" (expected ${allowedValues})`
30
+ : `Missing ${name} header`);
31
31
  }
32
32
  }
33
+ exports.validateHeaderValue = validateHeaderValue;
34
+ function validateFetchMode(req, res, expectedMode) {
35
+ validateHeaderValue(req, 'sec-fetch-mode', expectedMode);
36
+ }
33
37
  exports.validateFetchMode = validateFetchMode;
38
+ function validateFetchDest(req, res, expectedDest) {
39
+ validateHeaderValue(req, 'sec-fetch-dest', expectedDest);
40
+ }
41
+ exports.validateFetchDest = validateFetchDest;
42
+ function validateFetchSite(req, res, expectedSite) {
43
+ validateHeaderValue(req, 'sec-fetch-site', expectedSite);
44
+ }
45
+ exports.validateFetchSite = validateFetchSite;
34
46
  function validateReferer(req, res, reference, allowNull = false) {
35
47
  const referer = req.headers['referer'];
36
48
  const refererUrl = referer ? new URL(referer) : null;
37
49
  if (refererUrl ? !(0, url_js_1.urlMatch)(refererUrl, reference) : !allowNull) {
38
- throw (0, http_errors_1.default)(403, `Invalid referer ${referer}`);
50
+ throw (0, http_errors_1.default)(400, `Invalid referer ${referer}`);
39
51
  }
40
52
  }
41
53
  exports.validateReferer = validateReferer;
@@ -53,7 +65,7 @@ exports.setupCsrfToken = setupCsrfToken;
53
65
  function validateSameOrigin(req, res, origin, allowNull = true) {
54
66
  const reqOrigin = req.headers['origin'];
55
67
  if (reqOrigin ? reqOrigin !== origin : !allowNull) {
56
- throw (0, http_errors_1.default)(403, `Invalid origin ${reqOrigin}`);
68
+ throw (0, http_errors_1.default)(400, `Invalid origin ${reqOrigin}`);
57
69
  }
58
70
  }
59
71
  exports.validateSameOrigin = validateSameOrigin;
@@ -63,7 +75,7 @@ function validateCsrfToken(req, res, csrfToken, cookieName = 'csrf_token', clear
63
75
  !cookies ||
64
76
  !cookieName ||
65
77
  cookies[cookieName] !== csrfToken) {
66
- throw (0, http_errors_1.default)(403, `Invalid CSRF token`);
78
+ throw (0, http_errors_1.default)(400, `Invalid CSRF token`);
67
79
  }
68
80
  if (clearCookie) {
69
81
  (0, response_js_1.appendHeader)(res, 'Set-Cookie', (0, cookie_1.serialize)(cookieName, '', {
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/lib/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GAAG,CAAC,OAAe;QACtB,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC;YACrB,CAAC,CAAC,CAAE,GAAW,CAAC,OAAO,GAAG,IAAA,cAAW,EAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC7D,CAAC,CAAC,IAAI,CAAA;AACZ,CAAC;AARD,4CAQC"}
@@ -1,7 +1,6 @@
1
1
  import { Keyset } from '@atproto/jwk';
2
2
  import { OAuthAuthorizationServerMetadata } from '@atproto/oauth-types';
3
3
  export type CustomMetadata = {
4
- claims_supported?: string[];
5
4
  scopes_supported?: string[];
6
5
  authorization_details_types_supported?: string[];
7
6
  protected_resources?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"build-metadata.d.ts","sourceRoot":"","sources":["../../src/metadata/build-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAA;AAMvE,MAAM,MAAM,cAAc,GAAG;IAC3B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,qCAAqC,CAAC,EAAE,MAAM,EAAE,CAAA;IAChD,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC/B,CAAA;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,cAAc,CAAC,EAAE,cAAc,GAC9B,gCAAgC,CAmIlC"}
1
+ {"version":3,"file":"build-metadata.d.ts","sourceRoot":"","sources":["../../src/metadata/build-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAA;AAKvE,MAAM,MAAM,cAAc,GAAG;IAC3B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,qCAAqC,CAAC,EAAE,MAAM,EAAE,CAAA;IAChD,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC/B,CAAA;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,cAAc,CAAC,EAAE,cAAc,GAC9B,gCAAgC,CAoGlC"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildMetadata = void 0;
4
4
  const client_js_1 = require("../client/client.js");
5
- const claims_js_1 = require("../oidc/claims.js");
6
5
  const crypto_js_1 = require("../lib/util/crypto.js");
7
6
  /**
8
7
  * @see {@link https://datatracker.ietf.org/doc/html/rfc8414#section-2}
@@ -12,30 +11,10 @@ function buildMetadata(issuer, keyset, customMetadata) {
12
11
  return {
13
12
  issuer,
14
13
  scopes_supported: [
15
- 'offline_access',
16
- 'openid',
17
- 'email',
18
- 'phone',
19
- 'profile',
14
+ 'atproto',
15
+ //
20
16
  ...(customMetadata?.scopes_supported ?? []),
21
17
  ],
22
- claims_supported: [
23
- /* IESG (Always provided) */
24
- 'sub', // did
25
- 'iss', // Authorization Server Origin
26
- 'aud',
27
- 'exp',
28
- 'iat',
29
- 'jti',
30
- 'client_id',
31
- /* OpenID */
32
- // 'acr', // "0"
33
- // 'amr',
34
- // 'azp',
35
- 'auth_time', // number - seconds since epoch
36
- 'nonce', // always required in "id_token", why would it not be supported?
37
- ...(customMetadata?.claims_supported ?? claims_js_1.OIDC_STANDARD_CLAIMS),
38
- ],
39
18
  subject_types_supported: [
40
19
  //
41
20
  'public', // The same "sub" is returned for all clients
@@ -44,14 +23,14 @@ function buildMetadata(issuer, keyset, customMetadata) {
44
23
  response_types_supported: [
45
24
  // OAuth
46
25
  'code',
47
- 'token',
26
+ // 'token',
48
27
  // OpenID
49
- 'none',
50
- 'code id_token token',
51
- 'code id_token',
52
- 'code token',
53
- 'id_token token',
54
- 'id_token',
28
+ // 'none',
29
+ // 'code id_token token',
30
+ // 'code id_token',
31
+ // 'code token',
32
+ // 'id_token token',
33
+ // 'id_token',
55
34
  ],
56
35
  response_modes_supported: [
57
36
  // https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes
@@ -74,7 +53,6 @@ function buildMetadata(issuer, keyset, customMetadata) {
74
53
  //
75
54
  'en-US',
76
55
  ],
77
- id_token_signing_alg_values_supported: [...keyset.signAlgorithms],
78
56
  display_values_supported: [
79
57
  //
80
58
  'page',
@@ -88,9 +66,6 @@ function buildMetadata(issuer, keyset, customMetadata) {
88
66
  request_object_signing_alg_values_supported: [...crypto_js_1.VERIFY_ALGOS, 'none'],
89
67
  request_object_encryption_alg_values_supported: [], // None
90
68
  request_object_encryption_enc_values_supported: [], // None
91
- // No claim makes sense to be translated
92
- claims_locales_supported: [],
93
- claims_parameter_supported: true,
94
69
  request_parameter_supported: true,
95
70
  request_uri_parameter_supported: true,
96
71
  require_request_uri_registration: true,
@@ -101,7 +76,6 @@ function buildMetadata(issuer, keyset, customMetadata) {
101
76
  token_endpoint_auth_signing_alg_values_supported: [...crypto_js_1.VERIFY_ALGOS],
102
77
  revocation_endpoint: new URL('/oauth/revoke', issuer).href,
103
78
  introspection_endpoint: new URL('/oauth/introspect', issuer).href,
104
- userinfo_endpoint: new URL('/oauth/userinfo', issuer).href,
105
79
  // end_session_endpoint: new URL('/oauth/logout', issuer).href,
106
80
  // https://datatracker.ietf.org/doc/html/rfc9126#section-5
107
81
  pushed_authorization_request_endpoint: new URL('/oauth/par', issuer).href,
@@ -1 +1 @@
1
- {"version":3,"file":"build-metadata.js","sourceRoot":"","sources":["../../src/metadata/build-metadata.ts"],"names":[],"mappings":";;;AAGA,mDAA4C;AAC5C,iDAAwD;AACxD,qDAAoD;AASpD;;;GAGG;AACH,SAAgB,aAAa,CAC3B,MAAc,EACd,MAAc,EACd,cAA+B;IAE/B,OAAO;QACL,MAAM;QAEN,gBAA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AAC,cAAc,EAAE,MAAM,CAAC,CAAC,IAAI;QACpD,qCAAqC,EAAE,CAAC,GAAG,kBAAM,CAAC,sBAAsB,CAAC;QACzE,gDAAgD,EAAE,CAAC,GAAG,wBAAY,CAAC;QAEnE,mBAAmB,EAAE,IAAI,GAAG,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,IAAI;QAE1D,sBAAsB,EAAE,IAAI,GAAG,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC,IAAI;QAEjE,+DAA+D;QAE/D,0DAA0D;QAC1D,qCAAqC,EAAE,IAAI,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,IAAI;QAEzE,qCAAqC,EAAE,IAAI;QAE3C,4DAA4D;QAC5D,iCAAiC,EAAE,CAAC,GAAG,wBAAY,CAAC;QAEpD,6DAA6D;QAC7D,qCAAqC,EACnC,cAAc,EAAE,qCAAqC;QAEvD,wFAAwF;QACxF,mBAAmB,EAAE,cAAc,EAAE,mBAAmB;QAExD,kIAAkI;QAClI,qCAAqC,EAAE,IAAI;KAC5C,CAAA;AACH,CAAC;AAxGD,sCAwGC"}
@@ -5,8 +5,9 @@ import { ClientAuth } from './client/client-auth.js';
5
5
  import { ClientId } from './client/client-id.js';
6
6
  import { ClientInfo } from './client/client-info.js';
7
7
  import { Client } from './client/client.js';
8
+ import { InvalidAuthorizationDetailsError } from './errors/invalid-authorization-details-error.js';
8
9
  import { Awaitable } from './lib/util/type.js';
9
- export type { Account, Client, ClientAuth, ClientId, ClientInfo, Jwks, OAuthAuthenticationRequestParameters, OAuthAuthorizationDetails, OAuthClientMetadata, OAuthTokenResponse, };
10
+ export type { Account, Client, ClientAuth, ClientId, ClientInfo, InvalidAuthorizationDetailsError, Jwks, OAuthAuthenticationRequestParameters, OAuthAuthorizationDetails, OAuthClientMetadata, OAuthTokenResponse, };
10
11
  export type OAuthHooks = {
11
12
  /**
12
13
  * Use this to alter, override or validate the client metadata & jwks returned
@@ -21,7 +22,7 @@ export type OAuthHooks = {
21
22
  }) => Awaitable<void | undefined | Partial<ClientInfo>>;
22
23
  /**
23
24
  * Allows enriching the authorization details with additional information
24
- * before the tokens are issued.
25
+ * when the tokens are issued.
25
26
  *
26
27
  * @see {@link https://datatracker.ietf.org/doc/html/rfc9396 | RFC 9396}
27
28
  */
@@ -30,13 +31,5 @@ export type OAuthHooks = {
30
31
  parameters: OAuthAuthenticationRequestParameters;
31
32
  account: Account;
32
33
  }) => Awaitable<undefined | OAuthAuthorizationDetails>;
33
- /**
34
- * Allows altering the token response before it is sent to the client.
35
- */
36
- onTokenResponse?: (tokenResponse: OAuthTokenResponse, data: {
37
- client: Client;
38
- parameters: OAuthAuthenticationRequestParameters;
39
- account: Account;
40
- }) => Awaitable<void>;
41
34
  };
42
35
  //# sourceMappingURL=oauth-hooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-hooks.d.ts","sourceRoot":"","sources":["../src/oauth-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EACL,oCAAoC,EACpC,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAG9C,YAAY,EACV,OAAO,EACP,MAAM,EACN,UAAU,EACV,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,oCAAoC,EACpC,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,GACnB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IAC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EAAE,MAAM,oBAAoB,CAAA;AAG9C,YAAY,EACV,OAAO,EACP,MAAM,EACN,UAAU,EACV,QAAQ,EACR,UAAU,EACV,gCAAgC,EAChC,IAAI,EACJ,oCAAoC,EACpC,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,GACnB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,CACb,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE;QAAE,QAAQ,EAAE,mBAAmB,CAAC;QAAC,IAAI,CAAC,EAAE,IAAI,CAAA;KAAE,KACjD,SAAS,CAAC,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAA;IAEtD;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,CAAC,IAAI,EAAE;QAC9B,MAAM,EAAE,MAAM,CAAA;QACd,UAAU,EAAE,oCAAoC,CAAA;QAChD,OAAO,EAAE,OAAO,CAAA;KACjB,KAAK,SAAS,CAAC,SAAS,GAAG,yBAAyB,CAAC,CAAA;CACvD,CAAA"}
@@ -1,10 +1,10 @@
1
1
  /// <reference types="node" />
2
2
  import { SimpleStore } from '@atproto-labs/simple-store';
3
- import { Jwks, Keyset, SignedJwt } from '@atproto/jwk';
3
+ import { Jwks, Keyset } from '@atproto/jwk';
4
4
  import { AccessToken, OAuthAuthenticationRequestParameters, OAuthAuthorizationServerMetadata, OAuthClientIdentification, OAuthClientMetadata, OAuthTokenResponse, OAuthTokenType } from '@atproto/oauth-types';
5
5
  import { Redis, type RedisOptions } from 'ioredis';
6
6
  import { AccountManager } from './account/account-manager.js';
7
- import { AccountInfo, AccountStore, DeviceAccountInfo, SignInCredentials } from './account/account-store.js';
7
+ import { AccountStore, DeviceAccountInfo, SignInCredentials } from './account/account-store.js';
8
8
  import { Account } from './account/account.js';
9
9
  import { ClientAuth } from './client/client-auth.js';
10
10
  import { ClientId } from './client/client-id.js';
@@ -18,7 +18,6 @@ import { Override } from './lib/util/type.js';
18
18
  import { CustomMetadata } from './metadata/build-metadata.js';
19
19
  import { OAuthHooks } from './oauth-hooks.js';
20
20
  import { OAuthVerifier, OAuthVerifierOptions } from './oauth-verifier.js';
21
- import { Userinfo } from './oidc/userinfo.js';
22
21
  import { AuthorizationResultAuthorize } from './output/build-authorize-data.js';
23
22
  import { Customization } from './output/customization.js';
24
23
  import { AuthorizationResultRedirect } from './output/send-authorize-redirect.js';
@@ -28,7 +27,7 @@ import { RequestStore } from './request/request-store.js';
28
27
  import { RequestUri } from './request/request-uri.js';
29
28
  import { AuthorizationRequestJar, AuthorizationRequestQuery, PushedAuthorizationRequest } from './request/types.js';
30
29
  import { TokenManager } from './token/token-manager.js';
31
- import { TokenInfo, TokenStore } from './token/token-store.js';
30
+ import { TokenStore } from './token/token-store.js';
32
31
  import { CodeGrantRequest, Introspect, IntrospectionResponse, RefreshGrantRequest, Revoke, TokenRequest } from './token/types.js';
33
32
  import { VerifyTokenClaimsOptions } from './token/verify-token-claims.js';
34
33
  export type OAuthProviderStore = Partial<ClientStore & AccountStore & DeviceStore & TokenStore & RequestStore & ReplayStore>;
@@ -39,9 +38,7 @@ export type RouterOptions<Req extends IncomingMessage = IncomingMessage, Res ext
39
38
  export type OAuthProviderOptions = Override<OAuthVerifierOptions & OAuthHooks, {
40
39
  /**
41
40
  * Maximum age a device/account session can be before requiring
42
- * re-authentication. This can be overridden on a authorization request basis
43
- * using the `max_age` parameter and on a client basis using the
44
- * `default_max_age` client metadata.
41
+ * re-authentication.
45
42
  */
46
43
  authenticationMaxAge?: number;
47
44
  /**
@@ -246,7 +243,10 @@ export declare class OAuthProvider extends OAuthVerifier {
246
243
  consentRequired: boolean;
247
244
  matchesHint: boolean;
248
245
  }[]>;
249
- protected signIn(deviceId: DeviceId, credentials: SignInCredentials): Promise<AccountInfo>;
246
+ protected signIn(deviceId: DeviceId, uri: RequestUri, clientId: ClientId, credentials: SignInCredentials): Promise<{
247
+ account: Account;
248
+ consentRequired: boolean;
249
+ }>;
250
250
  protected acceptRequest(deviceId: DeviceId, uri: RequestUri, clientId: ClientId, sub: string): Promise<AuthorizationResultRedirect>;
251
251
  protected rejectRequest(deviceId: DeviceId, uri: RequestUri, clientId: ClientId): Promise<AuthorizationResultRedirect>;
252
252
  protected token(input: TokenRequest, dpopJkt: null | string): Promise<OAuthTokenResponse>;
@@ -260,11 +260,6 @@ export declare class OAuthProvider extends OAuthVerifier {
260
260
  * @see {@link https://datatracker.ietf.org/doc/html/rfc7662#section-2.1 rfc7662}
261
261
  */
262
262
  protected introspect(input: Introspect): Promise<IntrospectionResponse>;
263
- /**
264
- * @see {@link https://openid.net/specs/openid-connect-core-1_0.html#rfc.section.5.3.2 Successful UserInfo Response}
265
- */
266
- protected userinfo({ data, account }: TokenInfo): Promise<Userinfo>;
267
- protected signUserinfo(userinfo: Userinfo): Promise<SignedJwt>;
268
263
  protected authenticateToken(tokenType: OAuthTokenType, token: AccessToken, dpopJkt: string | null, verifyOptions?: VerifyTokenClaimsOptions): Promise<import("./token/verify-token-claims.js").VerifyTokenClaimsResult>;
269
264
  /**
270
265
  * @returns An http request handler that can be used with node's http server
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-provider.d.ts","sourceRoot":"","sources":["../src/oauth-provider.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAmB,MAAM,cAAc,CAAA;AACvE,OAAO,EACL,WAAW,EAEX,oCAAoC,EACpC,gCAAgC,EAChC,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EAGf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAIlD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EACL,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB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