@atproto/oauth-provider 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"client-manager.d.ts","sourceRoot":"","sources":["../../src/client/client-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,EAMN,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,YAAY,EAEZ,WAAW,EACZ,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,IAAI,EAAc,MAAM,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,EAIL,gCAAgC,EAChC,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EAEzB,MAAM,sBAAsB,CAAA;AAW7B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAepC,MAAM,MAAM,sBAAsB,GAAG,CACnC,GAAG,EAAE,MAAM,KACR,SAAS,CAAC,wBAAwB,CAAC,CAAA;AAExC,qBAAa,aAAa;IAKtB,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,gCAAgC;IACnE,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACjC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,UAAU;IACpC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAC5C,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,IAAI;IARpE,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;IACnD,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,YAAY,CAAC,MAAM,E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AsB/D;;;OAGG;IACU,SAAS,CAAC,QAAQ,EAAE,MAAM;cAmCvB,iBAAiB,CAC/B,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,mBAAmB,CAAC;cAYf,yBAAyB,CACvC,QAAQ,EAAE,qBAAqB,GAC9B,OAAO,CAAC,mBAAmB,CAAC;cAaf,6BAA6B,CAC3C,QAAQ,EAAE,yBAAyB,GAClC,OAAO,CAAC,mBAAmB,CAAC;cAYf,uBAAuB,CACrC,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,mBAAmB,CAAC;IAS/B;;;;;OAKG;IACH,SAAS,CAAC,sBAAsB,CAC9B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,mBAAmB,GAC5B,mBAAmB;IAwbtB,8BAA8B,CAC5B,QAAQ,EAAE,qBAAqB,EAC/B,QAAQ,EAAE,mBAAmB,GAC5B,mBAAmB;IAuCtB,kCAAkC,CAChC,QAAQ,EAAE,yBAAyB,EACnC,QAAQ,EAAE,mBAAmB,GAC5B,mBAAmB;CAwGvB"}
@@ -6,10 +6,9 @@ const pipe_1 = require("@atproto-labs/pipe");
6
6
  const simple_store_1 = require("@atproto-labs/simple-store");
7
7
  const jwk_1 = require("@atproto/jwk");
8
8
  const oauth_types_1 = require("@atproto/oauth-types");
9
- const zod_1 = require("zod");
10
9
  const invalid_client_metadata_error_js_1 = require("../errors/invalid-client-metadata-error.js");
11
10
  const invalid_redirect_uri_error_js_1 = require("../errors/invalid-redirect-uri-error.js");
12
- const oauth_error_js_1 = require("../errors/oauth-error.js");
11
+ const function_js_1 = require("../lib/util/function.js");
13
12
  const hostname_js_1 = require("../lib/util/hostname.js");
14
13
  const client_utils_js_1 = require("./client-utils.js");
15
14
  const client_js_1 = require("./client.js");
@@ -47,41 +46,25 @@ class ClientManager {
47
46
  * @see {@link https://openid.net/specs/openid-connect-registration-1_0.html#rfc.section.2 OIDC Client Registration}
48
47
  */
49
48
  async getClient(clientId) {
50
- try {
51
- const metadata = await this.getClientMetadata(clientId);
52
- const jwks = metadata.jwks_uri
53
- ? await this.jwks.get(metadata.jwks_uri)
54
- : undefined;
55
- const partialInfo = await this.hooks.onClientInfo?.(clientId, {
49
+ const metadata = await this.getClientMetadata(clientId).catch((err) => {
50
+ throw invalid_client_metadata_error_js_1.InvalidClientMetadataError.from(err, `Unable to obtain client metadata for "${clientId}"`);
51
+ });
52
+ const jwks = metadata.jwks_uri
53
+ ? await this.jwks.get(metadata.jwks_uri).catch((err) => {
54
+ throw invalid_client_metadata_error_js_1.InvalidClientMetadataError.from(err, `Unable to obtain jwks from "${metadata.jwks_uri}" for "${clientId}"`);
55
+ })
56
+ : undefined;
57
+ const partialInfo = this.hooks.onClientInfo
58
+ ? await (0, function_js_1.callAsync)(this.hooks.onClientInfo, clientId, {
56
59
  metadata,
57
60
  jwks,
58
- });
59
- const isFirstParty = partialInfo?.isFirstParty ?? false;
60
- const isTrusted = partialInfo?.isTrusted ?? isFirstParty;
61
- return new client_js_1.Client(clientId, metadata, jwks, { isFirstParty, isTrusted });
62
- }
63
- catch (err) {
64
- if (err instanceof oauth_error_js_1.OAuthError) {
65
- throw err;
66
- }
67
- if (err instanceof fetch_1.FetchError) {
68
- const message = err instanceof fetch_1.FetchResponseError || err.statusCode !== 500
69
- ? // Only expose 500 message if it was generated on another server
70
- `Failed to fetch client information: ${err.message}`
71
- : `Failed to fetch client information due to an internal error`;
72
- throw new invalid_client_metadata_error_js_1.InvalidClientMetadataError(message, err);
73
- }
74
- if (err instanceof zod_1.ZodError) {
75
- const issues = err.issues
76
- .map(({ path, message }) => `Validation${path.length ? ` of "${path.join('.')}"` : ''} failed with error: ${message}`)
77
- .join(' ');
78
- throw new invalid_client_metadata_error_js_1.InvalidClientMetadataError(issues || err.message, err);
79
- }
80
- if (err?.['code'] === 'DEPTH_ZERO_SELF_SIGNED_CERT') {
81
- throw new invalid_client_metadata_error_js_1.InvalidClientMetadataError('Self-signed certificate', err);
82
- }
83
- throw invalid_client_metadata_error_js_1.InvalidClientMetadataError.from(err, `Unable to load client information for "${clientId}"`);
84
- }
61
+ }).catch((err) => {
62
+ throw invalid_client_metadata_error_js_1.InvalidClientMetadataError.from(err, `Rejected client information for "${clientId}"`);
63
+ })
64
+ : undefined;
65
+ const isFirstParty = partialInfo?.isFirstParty ?? false;
66
+ const isTrusted = partialInfo?.isTrusted ?? isFirstParty;
67
+ return new client_js_1.Client(clientId, metadata, jwks, { isFirstParty, isTrusted });
85
68
  }
86
69
  async getClientMetadata(clientId) {
87
70
  if ((0, oauth_types_1.isOAuthClientIdLoopback)(clientId)) {
@@ -1 +1 @@
1
- {"version":3,"file":"client-manager.js","sourceRoot":"","sources":["../../src/client/client-manager.ts"],"names":[],"mappings":";;;AAAA,+CAQ4B;AAC5B,6CAAyC;AACzC,6DAImC;AACnC,sCAAuD;AACvD,sDAU6B;AAC7B,6BAA8B;AAE9B,iGAAuF;AACvF,2FAAiF;AACjF,6DAAqD;AACrD,yDAIgC;AAKhC,uDAA+E;AAC/E,2CAAoC;AAEpC,MAAM,oBAAoB,GAAG,IAAA,WAAI,EAC/B,IAAA,wBAAgB,GAAE;AAClB,8IAA8I;AAC9I,IAAA,0BAAkB,EAAC,kBAAkB,EAAE,IAAI,CAAC,EAC5C,IAAA,6BAAqB,EAAC,uCAAyB,CAAC,CACjD,CAAA;AAED,MAAM,gBAAgB,GAAG,IAAA,WAAI,EAC3B,IAAA,wBAAgB,GAAE,EAClB,IAAA,0BAAkB,EAAC,kBAAkB,EAAE,KAAK,CAAC,EAC7C,IAAA,6BAAqB,EAAC,gBAAU,CAAC,CAClC,CAAA;AAMD,MAAa,aAAa;IAKH;IACA;IACA;IACA;IACA;IARF,IAAI,CAA4B;IAChC,cAAc,CAA2C;IAE5E,YACqB,cAAgD,EAChD,MAAc,EACd,KAAiB,EACjB,KAAyB,EACzB,mBAAkD,IAAI,EACzE,SAAgB,EAChB,eAA0C,EAC1C,mBAA6D;QAP1C,mBAAc,GAAd,cAAc,CAAkC;QACh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AAA;AAC9C,CAAC;AAED,SAAS,qBAAqB,CAAC,GAAQ;IACrC,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACnC,CAAC;AAED,SAAS,mBAAmB,CAAC,GAAW,EAAE,OAA0B;IAClE,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE;QACtB,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE;QACvC,mDAAmD;QACnD,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;QAChD,MAAM,EAAE,OAAO,EAAE,MAAM;QACvB,QAAQ,EAAE,OAAO;KAClB,CAAC,CAAA;AACJ,CAAC"}
1
+ {"version":3,"file":"client-manager.js","sourceRoot":"","sources":["../../src/client/client-manager.ts"],"names":[],"mappings":";;;AAAA,+CAM4B;AAC5B,6CAAyC;AACzC,6DAImC;AACnC,sCAAuD;AACvD,sDAU6B;AAE7B,iGAAuF;AACvF,2FAAiF;AACjF,yDAAmD;AACnD,yDAIgC;AAKhC,uDAA+E;AAC/E,2CAAoC;AAEpC,MAAM,oBAAoB,GAAG,IAAA,WAAI,EAC/B,IAAA,wBAAgB,GAAE;AAClB,8IAA8I;AAC9I,IAAA,0BAAkB,EAAC,kBAAkB,EAAE,IAAI,CAAC,EAC5C,IAAA,6BAAqB,EAAC,uCAAyB,CAAC,CACjD,CAAA;AAED,MAAM,gBAAgB,GAAG,IAAA,WAAI,EAC3B,IAAA,wBAAgB,GAAE,EAClB,IAAA,0BAAkB,EAAC,kBAAkB,EAAE,KAAK,CAAC,EAC7C,IAAA,6BAAqB,EAAC,gBAAU,CAAC,CAClC,CAAA;AAMD,MAAa,aAAa;IAKH;IACA;IACA;IACA;IACA;IARF,IAAI,CAA4B;IAChC,cAAc,CAA2C;IAE5E,YACqB,cAAgD,EAChD,MAAc,EACd,KAAiB,EACjB,KAAyB,EACzB,mBAAkD,IAAI,EACzE,SAAgB,E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  export declare class InvalidClientMetadataError extends OAuthError {
10
10
  constructor(error_description: string, cause?: unknown);
11
- static from(cause: unknown, fallbackMessage?: string): InvalidClientMetadataError;
11
+ static from(cause: unknown, message?: string): OAuthError;
12
12
  }
13
13
  //# sourceMappingURL=invalid-client-metadata-error.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"invalid-client-metadata-error.d.ts","sourceRoot":"","sources":["../../src/errors/invalid-client-metadata-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C;;;;;;GAMG;AACH,qBAAa,0BAA2B,SAAQ,UAAU;gBAC5C,iBAAiB,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;IAItD,MAAM,CAAC,IAAI,CACT,KAAK,EAAE,OAAO,EACd,eAAe,SAAqC,GACnD,0BAA0B;CAa9B"}
1
+ {"version":3,"file":"invalid-client-metadata-error.d.ts","sourceRoot":"","sources":["../../src/errors/invalid-client-metadata-error.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C;;;;;;GAMG;AACH,qBAAa,0BAA2B,SAAQ,UAAU;gBAC5C,iBAAiB,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;IAItD,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,SAA4B,GAAG,UAAU;CAmD7E"}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InvalidClientMetadataError = void 0;
4
+ const fetch_1 = require("@atproto-labs/fetch");
5
+ const zod_1 = require("zod");
4
6
  const oauth_error_js_1 = require("./oauth-error.js");
5
7
  /**
6
8
  * @see {@link https://datatracker.ietf.org/doc/html/rfc7591#section-3.2.2 | RFC7591 - Client Registration Error Response}
@@ -13,18 +15,32 @@ class InvalidClientMetadataError extends oauth_error_js_1.OAuthError {
13
15
  constructor(error_description, cause) {
14
16
  super('invalid_client_metadata', error_description, 400, cause);
15
17
  }
16
- static from(cause, fallbackMessage = 'Invalid client metadata document') {
17
- if (cause instanceof InvalidClientMetadataError) {
18
+ static from(cause, message = 'Invalid client metadata') {
19
+ if (cause instanceof oauth_error_js_1.OAuthError) {
18
20
  return cause;
19
21
  }
22
+ if (cause instanceof fetch_1.FetchError) {
23
+ throw new InvalidClientMetadataError(cause.expose ? `${message}: ${cause.message}` : message, cause);
24
+ }
25
+ if (cause instanceof zod_1.ZodError) {
26
+ const causeMessage = cause.issues
27
+ .map(({ path, message }) => `Validation${path.length ? ` of "${path.join('.')}"` : ''} failed with error: ${message}`)
28
+ .join(' ') || cause.message;
29
+ throw new InvalidClientMetadataError(causeMessage ? `${message}: ${causeMessage}` : message, cause);
30
+ }
31
+ if (cause instanceof Error &&
32
+ 'code' in cause &&
33
+ cause.code === 'DEPTH_ZERO_SELF_SIGNED_CERT') {
34
+ throw new InvalidClientMetadataError(`${message}: Self-signed certificate`, cause);
35
+ }
20
36
  if (cause instanceof TypeError) {
21
37
  // This method is meant to be used in the context of parsing & validating
22
38
  // a client client metadata. In that context, a TypeError would more
23
39
  // likely represent a problem with the data (e.g. invalid URL constructor
24
40
  // arg) and not a programming error.
25
- return new InvalidClientMetadataError(cause.message, cause);
41
+ return new InvalidClientMetadataError(`${message}: ${cause.message}`, cause);
26
42
  }
27
- return new InvalidClientMetadataError(fallbackMessage, cause);
43
+ return new InvalidClientMetadataError(message, cause);
28
44
  }
29
45
  }
30
46
  exports.InvalidClientMetadataError = InvalidClientMetadataError;
@@ -1 +1 @@
1
- {"version":3,"file":"invalid-client-metadata-error.js","sourceRoot":"","sources":["../../src/errors/invalid-client-metadata-error.ts"],"names":[],"mappings":";;;AAAA,qDAA6C;AAE7C;;;;;;GAMG;AACH,MAAa,0BAA2B,SAAQ,2BAAU;IACxD,YAAY,iBAAyB,EAAE,KAAe;QACpD,KAAK,CAAC,yBAAyB,EAAE,iBAAiB,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;IACjE,CAAC;IAED,MAAM,CAAC,IAAI,CACT,KAAc,EACd,eAAe,GAAG,kCAAkC;QAEpD,IAAI,KAAK,YAAY,0BAA0B,EAAE,CAAC;YAChD,OAAO,KAAK,CAAA;QACd,CAAC;QACD,IAAI,KAAK,YAAY,SAAS,EAAE,CAAC;YAC/B,yEAAyE;YACzE,oEAAoE;YACpE,yEAAyE;YACzE,oCAAoC;YACpC,OAAO,IAAI,0BAA0B,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QAC7D,CAAC;QACD,OAAO,IAAI,0BAA0B,CAAC,eAAe,EAAE,KAAK,CAAC,CAAA;IAC/D,CAAC;CACF;AArBD,gEAqBC"}
1
+ {"version":3,"file":"invalid-client-metadata-error.js","sourceRoot":"","sources":["../../src/errors/invalid-client-metadata-error.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;AAChD,6BAA8B;AAC9B,qDAA6C;AAE7C;;;;;;GAMG;AACH,MAAa,0BAA2B,SAAQ,2BAAU;IACxD,YAAY,iBAAyB,EAAE,KAAe;QACpD,KAAK,CAAC,yBAAyB,EAAE,iBAAiB,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;IACjE,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,KAAc,EAAE,OAAO,GAAG,yBAAyB;QAC7D,IAAI,KAAK,YAAY,2BAAU,EAAE,CAAC;YAChC,OAAO,KAAK,CAAA;QACd,CAAC;QAED,IAAI,KAAK,YAAY,kBAAU,EAAE,CAAC;YAChC,MAAM,IAAI,0BAA0B,CAClC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,EACvD,KAAK,CACN,CAAA;QACH,CAAC;QAED,IAAI,KAAK,YAAY,cAAQ,EAAE,CAAC;YAC9B,MAAM,YAAY,GAChB,KAAK,CAAC,MAAM;iBACT,GAAG,CACF,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CACpB,aAAa,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,uBAAuB,OAAO,EAAE,CAC5F;iBACA,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,OAAO,CAAA;YAE/B,MAAM,IAAI,0BAA0B,CAClC,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO,KAAK,YAAY,EAAE,CAAC,CAAC,CAAC,OAAO,EACtD,KAAK,CACN,CAAA;QACH,CAAC;QAED,IACE,KAAK,YAAY,KAAK;YACtB,MAAM,IAAI,KAAK;YACf,KAAK,CAAC,IAAI,KAAK,6BAA6B,EAC5C,CAAC;YACD,MAAM,IAAI,0BAA0B,CAClC,GAAG,OAAO,2BAA2B,EACrC,KAAK,CACN,CAAA;QACH,CAAC;QAED,IAAI,KAAK,YAAY,SAAS,EAAE,CAAC;YAC/B,yEAAyE;YACzE,oEAAoE;YACpE,yEAAyE;YACzE,oCAAoC;YACpC,OAAO,IAAI,0BAA0B,CACnC,GAAG,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE,EAC9B,KAAK,CACN,CAAA;QACH,CAAC;QAED,OAAO,IAAI,0BAA0B,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IACvD,CAAC;CACF;AAxDD,gEAwDC"}
@@ -0,0 +1,2 @@
1
+ export declare function callAsync<F extends (...args: any[]) => unknown>(this: ThisParameterType<F>, fn: F, ...args: Parameters<F>): Promise<Awaited<ReturnType<F>>>;
2
+ //# sourceMappingURL=function.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../../src/lib/util/function.ts"],"names":[],"mappings":"AAAA,wBAAsB,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,EACnE,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAC1B,EAAE,EAAE,CAAC,EACL,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,GACrB,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAEjC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.callAsync = callAsync;
4
+ async function callAsync(fn, ...args) {
5
+ return await fn(...args);
6
+ }
7
+ //# sourceMappingURL=function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function.js","sourceRoot":"","sources":["../../../src/lib/util/function.ts"],"names":[],"mappings":";;AAAA,8BAMC;AANM,KAAK,UAAU,SAAS,CAE7B,EAAK,EACL,GAAG,IAAmB;IAEtB,OAAO,MAAO,EAAE,CAAC,GAAG,IAAI,CAAmB,CAAA;AAC7C,CAAC"}
@@ -1,4 +1,4 @@
1
- import { OAuthAccessToken, OAuthAuthorizationRequestParameters, OAuthAuthorizationCodeGrantTokenRequest, OAuthClientCredentialsGrantTokenRequest, OAuthPasswordGrantTokenRequest, OAuthRefreshTokenGrantTokenRequest, OAuthTokenResponse, OAuthTokenType } from '@atproto/oauth-types';
1
+ import { OAuthAccessToken, OAuthAuthorizationCodeGrantTokenRequest, OAuthAuthorizationRequestParameters, OAuthClientCredentialsGrantTokenRequest, OAuthPasswordGrantTokenRequest, OAuthRefreshTokenGrantTokenRequest, OAuthTokenResponse, OAuthTokenType } from '@atproto/oauth-types';
2
2
  import { AccessTokenType } from '../access-token/access-token-type.js';
3
3
  import { DeviceAccountInfo } from '../account/account-store.js';
4
4
  import { Account } from '../account/account.js';
@@ -1 +1 @@
1
- {"version":3,"file":"token-manager.d.ts","sourceRoot":"","sources":["../../src/token/token-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,gBAAgB,EAChB,mCAAmC,EACnC,uCAAuC,EACvC,uCAAuC,EACvC,8BAA8B,EAC9B,kCAAkC,EAClC,kB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Z,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"}
@@ -12,6 +12,7 @@ const invalid_grant_error_js_1 = require("../errors/invalid-grant-error.js");
12
12
  const invalid_request_error_js_1 = require("../errors/invalid-request-error.js");
13
13
  const invalid_token_error_js_1 = require("../errors/invalid-token-error.js");
14
14
  const date_js_1 = require("../lib/util/date.js");
15
+ const function_js_1 = require("../lib/util/function.js");
15
16
  const code_js_1 = require("../request/code.js");
16
17
  const refresh_token_js_1 = require("./refresh-token.js");
17
18
  const token_id_js_1 = require("./token-id.js");
@@ -130,7 +131,13 @@ class TokenManager {
130
131
  : undefined;
131
132
  const now = new Date();
132
133
  const expiresAt = this.createTokenExpiry(now);
133
- const authorizationDetails = await this.hooks.onAuthorizationDetails?.call(null, { client, parameters, account });
134
+ const authorizationDetails = this.hooks.onAuthorizationDetails
135
+ ? await (0, function_js_1.callAsync)(this.hooks.onAuthorizationDetails, {
136
+ client,
137
+ parameters,
138
+ account,
139
+ })
140
+ : undefined;
134
141
  const tokenData = {
135
142
  createdAt: now,
136
143
  updatedAt: now,
@@ -244,11 +251,13 @@ class TokenManager {
244
251
  if (data.createdAt.getTime() + lifetime < Date.now()) {
245
252
  throw new invalid_grant_error_js_1.InvalidGrantError(`Refresh token expired`);
246
253
  }
247
- const authorization_details = await this.hooks.onAuthorizationDetails?.call(null, {
248
- client,
249
- parameters,
250
- account,
251
- });
254
+ const authorization_details = this.hooks.onAuthorizationDetails
255
+ ? await (0, function_js_1.callAsync)(this.hooks.onAuthorizationDetails, {
256
+ client,
257
+ parameters,
258
+ account,
259
+ })
260
+ : undefined;
252
261
  const nextTokenId = await (0, token_id_js_1.generateTokenId)();
253
262
  const nextRefreshToken = await (0, refresh_token_js_1.generateRefreshToken)();
254
263
  const now = new Date();
@@ -1 +1 @@
1
- {"version":3,"file":"token-manager.js","sourceRoot":"","sources":["../../src/token/token-manager.ts"],"names":[],"mappings":";;;AAAA,sCAA0C;AAC1C,sDAU6B;AAC7B,6CAAwC;AAExC,+EAAsE;AAKtE,kDAMwB;AAExB,mGAAwF;AACxF,uFAA6E;AAC7E,6EAAoE;AACpE,iFAAwE;AACxE,6EAAoE;AACpE,iDAAwE;AAExE,gDAAiD;AAEjD,yDAI2B;AAG3B,+CAKsB;AAEtB,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;IAC7C,CAAC;IAEM,iBAAiB,CAAC,GAAG,GAAG,IAAI,IAAI,EAAE;QAC1C,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,CAAA;IACnD,CAAC;IAES,iBAAiB,CAAC,OAAgB;QAC1C,IAAI,IAAI,CAAC,eAAe,KAAK,sCAAe,CAAC,IAAI,EAAE,CAAC;YAClD,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,OAAO,CAAC,GAAG,CAAA;QAC3C,CAAC;QAED,OAAO,IAAI,CAAC,eAAe,KAAK,sCAAe,CAAC,GAAG,CAAA;IACrD,CAAC;IAED,KAAK,CAAC,MAAM,CACV,MAAc,EACd,UAAsB,EACtB,OA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+ {"version":3,"file":"token-manager.js","sourceRoot":"","sources":["../../src/token/token-manager.ts"],"names":[],"mappings":";;;AAAA,sCAA0C;AAC1C,sDAU6B;AAC7B,6CAAwC;AAExC,+EAAsE;AAKtE,kDAMwB;AAExB,mGAAwF;AACxF,uFAA6E;AAC7E,6EAAoE;AACpE,iFAAwE;AACxE,6EAAoE;AACpE,iDAAwE;AACxE,yDAAmD;AAEnD,gDAAiD;AAEjD,yDAI2B;AAG3B,+CAKsB;AAEtB,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;IAC7C,CAAC;IAEM,iBAAiB,CAAC,GAAG,GAAG,IAAI,IAAI,EAAE;QAC1C,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,CAAA;IACnD,CAAC;IAES,iBAAiB,CAAC,OAAgB;QAC1C,IAAI,IAAI,CAAC,eAAe,KAAK,sCAAe,CAAC,IAAI,EAAE,CAAC;YAClD,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,OAAO,CAAC,GAAG,CAAA;QAC3C,CAAC;QAED,OAAO,IAAI,CAAC,eAAe,KAAK,sCAAe,CAAC,GAAG,CAAA;IACrD,CAAC;IAED,KAAK,CAAC,MAAM,CACV,MAAc,EACd,UAAsB,EACtB,OAAgB,EAChB,MAAwD,EACxD,UAA+C,EAC/C,KAGkC,EAClC,OAAsB;QAEtB,qEAAqE;QACrE,gEAAgE;QAChE,uBAAuB;QACvB,IAAI,MAAM,CAAC,QAAQ,CAAC,wBAAwB,IAAI,CAAC,OAAO,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1,6 @@
1
1
  {
2
2
  "name": "@atproto/oauth-provider",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
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": [
@@ -38,8 +38,8 @@
38
38
  "keygrip": "^1.1.0",
39
39
  "psl": "^1.9.0",
40
40
  "zod": "^3.23.8",
41
- "@atproto-labs/fetch": "0.1.1",
42
- "@atproto-labs/fetch-node": "0.1.3",
41
+ "@atproto-labs/fetch": "0.1.2",
42
+ "@atproto-labs/fetch-node": "0.1.4",
43
43
  "@atproto-labs/pipe": "0.1.0",
44
44
  "@atproto-labs/simple-store": "0.1.1",
45
45
  "@atproto-labs/simple-store-memory": "0.1.1",
@@ -1,11 +1,9 @@
1
1
  import {
2
2
  bindFetch,
3
3
  Fetch,
4
- FetchError,
5
4
  fetchJsonProcessor,
6
5
  fetchJsonZodProcessor,
7
6
  fetchOkProcessor,
8
- FetchResponseError,
9
7
  } from '@atproto-labs/fetch'
10
8
  import { pipe } from '@atproto-labs/pipe'
11
9
  import {
@@ -25,11 +23,10 @@ import {
25
23
  OAuthClientMetadataInput,
26
24
  oauthClientMetadataSchema,
27
25
  } from '@atproto/oauth-types'
28
- import { ZodError } from 'zod'
29
26
 
30
27
  import { InvalidClientMetadataError } from '../errors/invalid-client-metadata-error.js'
31
28
  import { InvalidRedirectUriError } from '../errors/invalid-redirect-uri-error.js'
32
- import { OAuthError } from '../errors/oauth-error.js'
29
+ import { callAsync } from '../lib/util/function.js'
33
30
  import {
34
31
  isInternetHost,
35
32
  isInternetUrl,
@@ -98,52 +95,38 @@ export class ClientManager {
98
95
  * @see {@link https://openid.net/specs/openid-connect-registration-1_0.html#rfc.section.2 OIDC Client Registration}
99
96
  */
100
97
  public async getClient(clientId: string) {
101
- try {
102
- const metadata = await this.getClientMetadata(clientId)
103
-
104
- const jwks = metadata.jwks_uri
105
- ? await this.jwks.get(metadata.jwks_uri)
106
- : undefined
107
-
108
- const partialInfo = await this.hooks.onClientInfo?.(clientId, {
109
- metadata,
110
- jwks,
111
- })
112
-
113
- const isFirstParty = partialInfo?.isFirstParty ?? false
114
- const isTrusted = partialInfo?.isTrusted ?? isFirstParty
115
-
116
- return new Client(clientId, metadata, jwks, { isFirstParty, isTrusted })
117
- } catch (err) {
118
- if (err instanceof OAuthError) {
119
- throw err
120
- }
121
- if (err instanceof FetchError) {
122
- const message =
123
- err instanceof FetchResponseError || err.statusCode !== 500
124
- ? // Only expose 500 message if it was generated on another server
125
- `Failed to fetch client information: ${err.message}`
126
- : `Failed to fetch client information due to an internal error`
127
- throw new InvalidClientMetadataError(message, err)
128
- }
129
- if (err instanceof ZodError) {
130
- const issues = err.issues
131
- .map(
132
- ({ path, message }) =>
133
- `Validation${path.length ? ` of "${path.join('.')}"` : ''} failed with error: ${message}`,
134
- )
135
- .join(' ')
136
- throw new InvalidClientMetadataError(issues || err.message, err)
137
- }
138
- if (err?.['code'] === 'DEPTH_ZERO_SELF_SIGNED_CERT') {
139
- throw new InvalidClientMetadataError('Self-signed certificate', err)
140
- }
141
-
98
+ const metadata = await this.getClientMetadata(clientId).catch((err) => {
142
99
  throw InvalidClientMetadataError.from(
143
100
  err,
144
- `Unable to load client information for "${clientId}"`,
101
+ `Unable to obtain client metadata for "${clientId}"`,
145
102
  )
146
- }
103
+ })
104
+
105
+ const jwks = metadata.jwks_uri
106
+ ? await this.jwks.get(metadata.jwks_uri).catch((err) => {
107
+ throw InvalidClientMetadataError.from(
108
+ err,
109
+ `Unable to obtain jwks from "${metadata.jwks_uri}" for "${clientId}"`,
110
+ )
111
+ })
112
+ : undefined
113
+
114
+ const partialInfo = this.hooks.onClientInfo
115
+ ? await callAsync(this.hooks.onClientInfo, clientId, {
116
+ metadata,
117
+ jwks,
118
+ }).catch((err) => {
119
+ throw InvalidClientMetadataError.from(
120
+ err,
121
+ `Rejected client information for "${clientId}"`,
122
+ )
123
+ })
124
+ : undefined
125
+
126
+ const isFirstParty = partialInfo?.isFirstParty ?? false
127
+ const isTrusted = partialInfo?.isTrusted ?? isFirstParty
128
+
129
+ return new Client(clientId, metadata, jwks, { isFirstParty, isTrusted })
147
130
  }
148
131
 
149
132
  protected async getClientMetadata(
@@ -1,3 +1,5 @@
1
+ import { FetchError } from '@atproto-labs/fetch'
2
+ import { ZodError } from 'zod'
1
3
  import { OAuthError } from './oauth-error.js'
2
4
 
3
5
  /**
@@ -12,20 +14,55 @@ export class InvalidClientMetadataError extends OAuthError {
12
14
  super('invalid_client_metadata', error_description, 400, cause)
13
15
  }
14
16
 
15
- static from(
16
- cause: unknown,
17
- fallbackMessage = 'Invalid client metadata document',
18
- ): InvalidClientMetadataError {
19
- if (cause instanceof InvalidClientMetadataError) {
17
+ static from(cause: unknown, message = 'Invalid client metadata'): OAuthError {
18
+ if (cause instanceof OAuthError) {
20
19
  return cause
21
20
  }
21
+
22
+ if (cause instanceof FetchError) {
23
+ throw new InvalidClientMetadataError(
24
+ cause.expose ? `${message}: ${cause.message}` : message,
25
+ cause,
26
+ )
27
+ }
28
+
29
+ if (cause instanceof ZodError) {
30
+ const causeMessage =
31
+ cause.issues
32
+ .map(
33
+ ({ path, message }) =>
34
+ `Validation${path.length ? ` of "${path.join('.')}"` : ''} failed with error: ${message}`,
35
+ )
36
+ .join(' ') || cause.message
37
+
38
+ throw new InvalidClientMetadataError(
39
+ causeMessage ? `${message}: ${causeMessage}` : message,
40
+ cause,
41
+ )
42
+ }
43
+
44
+ if (
45
+ cause instanceof Error &&
46
+ 'code' in cause &&
47
+ cause.code === 'DEPTH_ZERO_SELF_SIGNED_CERT'
48
+ ) {
49
+ throw new InvalidClientMetadataError(
50
+ `${message}: Self-signed certificate`,
51
+ cause,
52
+ )
53
+ }
54
+
22
55
  if (cause instanceof TypeError) {
23
56
  // This method is meant to be used in the context of parsing & validating
24
57
  // a client client metadata. In that context, a TypeError would more
25
58
  // likely represent a problem with the data (e.g. invalid URL constructor
26
59
  // arg) and not a programming error.
27
- return new InvalidClientMetadataError(cause.message, cause)
60
+ return new InvalidClientMetadataError(
61
+ `${message}: ${cause.message}`,
62
+ cause,
63
+ )
28
64
  }
29
- return new InvalidClientMetadataError(fallbackMessage, cause)
65
+
66
+ return new InvalidClientMetadataError(message, cause)
30
67
  }
31
68
  }
@@ -0,0 +1,7 @@
1
+ export async function callAsync<F extends (...args: any[]) => unknown>(
2
+ this: ThisParameterType<F>,
3
+ fn: F,
4
+ ...args: Parameters<F>
5
+ ): Promise<Awaited<ReturnType<F>>> {
6
+ return await (fn(...args) as ReturnType<F>)
7
+ }