@atproto/oauth-types 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/atproto-loopback-client-metadata.d.ts.map +1 -1
  3. package/dist/atproto-loopback-client-metadata.js +5 -17
  4. package/dist/atproto-loopback-client-metadata.js.map +1 -1
  5. package/dist/index.d.ts +18 -5
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +18 -5
  8. package/dist/index.js.map +1 -1
  9. package/dist/oauth-access-token.d.ts +4 -0
  10. package/dist/oauth-access-token.d.ts.map +1 -0
  11. package/dist/oauth-access-token.js +6 -0
  12. package/dist/oauth-access-token.js.map +1 -0
  13. package/dist/oauth-authorization-code-grant-token-request.d.ts +20 -0
  14. package/dist/oauth-authorization-code-grant-token-request.d.ts.map +1 -0
  15. package/dist/oauth-authorization-code-grant-token-request.js +17 -0
  16. package/dist/oauth-authorization-code-grant-token-request.js.map +1 -0
  17. package/dist/oauth-authorization-request-jar.d.ts +16 -0
  18. package/dist/oauth-authorization-request-jar.d.ts.map +1 -0
  19. package/dist/oauth-authorization-request-jar.js +15 -0
  20. package/dist/oauth-authorization-request-jar.js.map +1 -0
  21. package/dist/oauth-authorization-request-par.d.ts +122 -0
  22. package/dist/oauth-authorization-request-par.d.ts.map +1 -0
  23. package/dist/oauth-authorization-request-par.js +11 -0
  24. package/dist/oauth-authorization-request-par.js.map +1 -0
  25. package/dist/{oauth-authentication-request-parameters.d.ts → oauth-authorization-request-parameters.d.ts} +16 -16
  26. package/dist/oauth-authorization-request-parameters.d.ts.map +1 -0
  27. package/dist/{oauth-authentication-request-parameters.js → oauth-authorization-request-parameters.js} +17 -25
  28. package/dist/oauth-authorization-request-parameters.js.map +1 -0
  29. package/dist/oauth-authorization-request-query.d.ts +128 -0
  30. package/dist/oauth-authorization-request-query.d.ts.map +1 -0
  31. package/dist/oauth-authorization-request-query.js +13 -0
  32. package/dist/oauth-authorization-request-query.js.map +1 -0
  33. package/dist/oauth-authorization-request-uri.d.ts +10 -0
  34. package/dist/oauth-authorization-request-uri.d.ts.map +1 -0
  35. package/dist/oauth-authorization-request-uri.js +9 -0
  36. package/dist/oauth-authorization-request-uri.js.map +1 -0
  37. package/dist/oauth-authorization-server-metadata.d.ts +10 -10
  38. package/dist/oauth-authorization-server-metadata.d.ts.map +1 -1
  39. package/dist/oauth-authorization-server-metadata.js +5 -1
  40. package/dist/oauth-authorization-server-metadata.js.map +1 -1
  41. package/dist/oauth-client-credentials-grant-token-request.d.ts +10 -0
  42. package/dist/oauth-client-credentials-grant-token-request.d.ts.map +1 -0
  43. package/dist/oauth-client-credentials-grant-token-request.js +8 -0
  44. package/dist/oauth-client-credentials-grant-token-request.js.map +1 -0
  45. package/dist/oauth-client-credentials.d.ts +18 -2
  46. package/dist/oauth-client-credentials.d.ts.map +1 -1
  47. package/dist/oauth-client-credentials.js +8 -2
  48. package/dist/oauth-client-credentials.js.map +1 -1
  49. package/dist/oauth-client-id-discoverable.d.ts +3 -2
  50. package/dist/oauth-client-id-discoverable.d.ts.map +1 -1
  51. package/dist/oauth-client-id-discoverable.js +21 -18
  52. package/dist/oauth-client-id-discoverable.js.map +1 -1
  53. package/dist/oauth-client-id-loopback.d.ts +10 -3
  54. package/dist/oauth-client-id-loopback.d.ts.map +1 -1
  55. package/dist/oauth-client-id-loopback.js +58 -21
  56. package/dist/oauth-client-id-loopback.js.map +1 -1
  57. package/dist/oauth-client-metadata.d.ts +1 -1
  58. package/dist/oauth-client-metadata.d.ts.map +1 -1
  59. package/dist/oauth-client-metadata.js +2 -1
  60. package/dist/oauth-client-metadata.js.map +1 -1
  61. package/dist/oauth-code-challenge-method.d.ts +3 -0
  62. package/dist/oauth-code-challenge-method.d.ts.map +1 -0
  63. package/dist/oauth-code-challenge-method.js +6 -0
  64. package/dist/oauth-code-challenge-method.js.map +1 -0
  65. package/dist/oauth-introspection-response.d.ts +20 -0
  66. package/dist/oauth-introspection-response.d.ts.map +1 -0
  67. package/dist/oauth-introspection-response.js +3 -0
  68. package/dist/oauth-introspection-response.js.map +1 -0
  69. package/dist/oauth-par-response.d.ts +3 -0
  70. package/dist/oauth-par-response.d.ts.map +1 -1
  71. package/dist/oauth-par-response.js +1 -0
  72. package/dist/oauth-par-response.js.map +1 -1
  73. package/dist/oauth-password-grant-token-request.d.ts +16 -0
  74. package/dist/oauth-password-grant-token-request.d.ts.map +1 -0
  75. package/dist/oauth-password-grant-token-request.js +10 -0
  76. package/dist/oauth-password-grant-token-request.js.map +1 -0
  77. package/dist/oauth-refresh-token-grant-token-request.d.ts +16 -0
  78. package/dist/oauth-refresh-token-grant-token-request.d.ts.map +1 -0
  79. package/dist/oauth-refresh-token-grant-token-request.js +12 -0
  80. package/dist/oauth-refresh-token-grant-token-request.js.map +1 -0
  81. package/dist/oauth-refresh-token.d.ts +4 -0
  82. package/dist/oauth-refresh-token.d.ts.map +1 -0
  83. package/dist/oauth-refresh-token.js +6 -0
  84. package/dist/oauth-refresh-token.js.map +1 -0
  85. package/dist/oauth-request-uri.d.ts +4 -0
  86. package/dist/oauth-request-uri.d.ts.map +1 -0
  87. package/dist/oauth-request-uri.js +6 -0
  88. package/dist/oauth-request-uri.js.map +1 -0
  89. package/dist/oauth-response-type.js +2 -2
  90. package/dist/oauth-response-type.js.map +1 -1
  91. package/dist/oauth-scope.d.ts +10 -0
  92. package/dist/oauth-scope.d.ts.map +1 -0
  93. package/dist/oauth-scope.js +16 -0
  94. package/dist/oauth-scope.js.map +1 -0
  95. package/dist/oauth-token-identification.d.ts +13 -0
  96. package/dist/oauth-token-identification.d.ts.map +1 -0
  97. package/dist/oauth-token-identification.js +11 -0
  98. package/dist/oauth-token-identification.js.map +1 -0
  99. package/dist/oauth-token-request.d.ts +49 -0
  100. package/dist/oauth-token-request.d.ts.map +1 -0
  101. package/dist/oauth-token-request.js +15 -0
  102. package/dist/oauth-token-request.js.map +1 -0
  103. package/dist/oauth-token-response.d.ts +0 -3
  104. package/dist/oauth-token-response.d.ts.map +1 -1
  105. package/dist/oauth-token-response.js +0 -1
  106. package/dist/oauth-token-response.js.map +1 -1
  107. package/dist/util.d.ts +2 -1
  108. package/dist/util.d.ts.map +1 -1
  109. package/dist/util.js +34 -3
  110. package/dist/util.js.map +1 -1
  111. package/package.json +1 -1
  112. package/src/atproto-loopback-client-metadata.ts +9 -23
  113. package/src/index.ts +18 -5
  114. package/src/oauth-access-token.ts +4 -0
  115. package/src/oauth-authorization-code-grant-token-request.ts +18 -0
  116. package/src/oauth-authorization-request-jar.ts +16 -0
  117. package/src/oauth-authorization-request-par.ts +13 -0
  118. package/src/{oauth-authentication-request-parameters.ts → oauth-authorization-request-parameters.ts} +22 -31
  119. package/src/oauth-authorization-request-query.ts +15 -0
  120. package/src/oauth-authorization-request-uri.ts +11 -0
  121. package/src/oauth-authorization-server-metadata.ts +5 -1
  122. package/src/oauth-client-credentials-grant-token-request.ts +9 -0
  123. package/src/oauth-client-credentials.ts +21 -1
  124. package/src/oauth-client-id-discoverable.ts +29 -26
  125. package/src/oauth-client-id-loopback.ts +78 -30
  126. package/src/oauth-client-metadata.ts +2 -1
  127. package/src/oauth-code-challenge-method.ts +3 -0
  128. package/src/oauth-introspection-response.ts +23 -0
  129. package/src/oauth-par-response.ts +1 -0
  130. package/src/oauth-password-grant-token-request.ts +11 -0
  131. package/src/oauth-refresh-token-grant-token-request.ts +13 -0
  132. package/src/oauth-refresh-token.ts +4 -0
  133. package/src/oauth-request-uri.ts +5 -0
  134. package/src/oauth-response-type.ts +2 -2
  135. package/src/oauth-scope.ts +15 -0
  136. package/src/oauth-token-identification.ts +12 -0
  137. package/src/oauth-token-request.ts +14 -0
  138. package/src/oauth-token-response.ts +0 -1
  139. package/src/util.ts +41 -1
  140. package/dist/access-token.d.ts +0 -4
  141. package/dist/access-token.d.ts.map +0 -1
  142. package/dist/access-token.js +0 -6
  143. package/dist/access-token.js.map +0 -1
  144. package/dist/oauth-authentication-request-parameters.d.ts.map +0 -1
  145. package/dist/oauth-authentication-request-parameters.js.map +0 -1
  146. package/dist/oauth-client-id-url.d.ts +0 -3
  147. package/dist/oauth-client-id-url.d.ts.map +0 -1
  148. package/dist/oauth-client-id-url.js +0 -21
  149. package/dist/oauth-client-id-url.js.map +0 -1
  150. package/dist/oauth-client-identification.d.ts +0 -31
  151. package/dist/oauth-client-identification.d.ts.map +0 -1
  152. package/dist/oauth-client-identification.js +0 -12
  153. package/dist/oauth-client-identification.js.map +0 -1
  154. package/src/access-token.ts +0 -4
  155. package/src/oauth-client-id-url.ts +0 -25
  156. package/src/oauth-client-identification.ts +0 -14
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseOAuthLoopbackClientId = exports.isOAuthClientIdLoopback = void 0;
4
- const oauth_client_id_url_js_1 = require("./oauth-client-id-url.js");
3
+ exports.parseOAuthLoopbackClientId = exports.assertOAuthLoopbackClientId = exports.isOAuthClientIdLoopback = void 0;
4
+ const oauth_scope_js_1 = require("./oauth-scope.js");
5
+ const util_js_1 = require("./util.js");
6
+ const OAUTH_CLIENT_ID_LOOPBACK_URL = 'http://localhost';
5
7
  function isOAuthClientIdLoopback(clientId) {
6
8
  try {
7
9
  parseOAuthLoopbackClientId(clientId);
@@ -12,33 +14,68 @@ function isOAuthClientIdLoopback(clientId) {
12
14
  }
13
15
  }
14
16
  exports.isOAuthClientIdLoopback = isOAuthClientIdLoopback;
17
+ function assertOAuthLoopbackClientId(clientId) {
18
+ void parseOAuthLoopbackClientId(clientId);
19
+ }
20
+ exports.assertOAuthLoopbackClientId = assertOAuthLoopbackClientId;
21
+ // @TODO: should we turn this into a zod schema? (more coherent error with other
22
+ // validation functions)
15
23
  function parseOAuthLoopbackClientId(clientId) {
16
- const url = (0, oauth_client_id_url_js_1.parseOAuthClientIdUrl)(clientId);
17
- // Optimization: cheap checks first
18
- if (url.protocol !== 'http:') {
19
- throw new TypeError('Loopback ClientID must use the "http:" protocol');
24
+ if (!clientId.startsWith(OAUTH_CLIENT_ID_LOOPBACK_URL)) {
25
+ throw new TypeError(`Loopback ClientID must start with "${OAUTH_CLIENT_ID_LOOPBACK_URL}"`);
20
26
  }
21
- if (url.hostname !== 'localhost') {
22
- throw new TypeError('Loopback ClientID must use the "localhost" hostname');
27
+ else if (clientId.includes('#', OAUTH_CLIENT_ID_LOOPBACK_URL.length)) {
28
+ throw new TypeError('Loopback ClientID must not contain a hash component');
23
29
  }
24
- if (url.hash) {
25
- throw new TypeError('Loopback ClientID must not contain a fragment');
30
+ const queryStringIdx = clientId.length > OAUTH_CLIENT_ID_LOOPBACK_URL.length &&
31
+ clientId[OAUTH_CLIENT_ID_LOOPBACK_URL.length] === '/'
32
+ ? OAUTH_CLIENT_ID_LOOPBACK_URL.length + 1
33
+ : OAUTH_CLIENT_ID_LOOPBACK_URL.length;
34
+ if (clientId.length === queryStringIdx) {
35
+ return {}; // no query string to parse
26
36
  }
27
- if (url.username || url.password) {
28
- throw new TypeError('Loopback ClientID must not contain credentials');
37
+ if (clientId[queryStringIdx] !== '?') {
38
+ throw new TypeError('Loopback ClientID must not contain a path component');
29
39
  }
30
- if (url.port) {
31
- throw new TypeError('Loopback ClientID must not contain a port');
40
+ const searchParams = new URLSearchParams(clientId.slice(queryStringIdx + 1));
41
+ for (const name of searchParams.keys()) {
42
+ if (name !== 'redirect_uri' && name !== 'scope') {
43
+ throw new TypeError(`Invalid query parameter "${name}" in client ID`);
44
+ }
32
45
  }
33
- // Note: url.pathname === '/' is allowed for loopback URIs
34
- if (url.pathname !== '/' && url.pathname.endsWith('/')) {
35
- throw new TypeError('Loopback ClientID must not end with a trailing slash');
46
+ const scope = searchParams.get('scope') ?? undefined;
47
+ if (scope != null) {
48
+ if (searchParams.getAll('scope').length > 1) {
49
+ throw new TypeError('Loopback ClientID must contain at most one scope query parameter');
50
+ }
51
+ else if (!oauth_scope_js_1.oauthScopeSchema.safeParse(scope).success) {
52
+ throw new TypeError('Invalid scope query parameter in client ID');
53
+ }
36
54
  }
37
- if (url.pathname.includes('//')) {
38
- throw new TypeError(`Loopback ClientID must not contain any double slashes in its path`);
55
+ const redirect_uris = searchParams.has('redirect_uri')
56
+ ? searchParams.getAll('redirect_uri')
57
+ : undefined;
58
+ if (redirect_uris) {
59
+ for (const uri of redirect_uris) {
60
+ const url = (0, util_js_1.safeUrl)(uri);
61
+ if (!url) {
62
+ throw new TypeError(`Invalid redirect_uri in client ID: ${uri}`);
63
+ }
64
+ if (url.protocol !== 'http:') {
65
+ throw new TypeError(`Loopback ClientID must use "http:" redirect_uri's (got ${uri})`);
66
+ }
67
+ if (url.hostname === 'localhost') {
68
+ throw new TypeError(`Loopback ClientID must not use "localhost" as redirect_uri hostname (got ${uri})`);
69
+ }
70
+ if (!(0, util_js_1.isLoopbackHost)(url.hostname)) {
71
+ throw new TypeError(`Loopback ClientID must use loopback addresses as redirect_uri's (got ${uri})`);
72
+ }
73
+ }
39
74
  }
40
- // Note: Query string is allowed
41
- return url;
75
+ return {
76
+ scope,
77
+ redirect_uris,
78
+ };
42
79
  }
43
80
  exports.parseOAuthLoopbackClientId = parseOAuthLoopbackClientId;
44
81
  //# sourceMappingURL=oauth-client-id-loopback.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-client-id-loopback.js","sourceRoot":"","sources":["../src/oauth-client-id-loopback.ts"],"names":[],"mappings":";;;AAAA,qEAAgE;AAMhE,SAAgB,uBAAuB,CACrC,QAAW;IAEX,IAAI,CAAC;QACH,0BAA0B,CAAC,QAAQ,CAAC,CAAA;QACpC,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AATD,0DASC;AAED,SAAgB,0BAA0B,CAAC,QAAuB;IAChE,MAAM,GAAG,GAAG,IAAA,8CAAqB,EAAC,QAAQ,CAAC,CAAA;IAE3C,mCAAmC;IAEnC,IAAI,GAAG,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QAC7B,MAAM,IAAI,SAA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E,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO;QACL,KAAK;QACL,aAAa;KACd,CAAA;AACH,CAAC;AA7ED,gEA6EC"}
@@ -1427,9 +1427,9 @@ export declare const oauthClientMetadataSchema: z.ZodObject<{
1427
1427
  authorization_details_types?: string[] | undefined;
1428
1428
  }, {
1429
1429
  redirect_uris: [string, ...string[]];
1430
+ scope?: string | undefined;
1430
1431
  response_types?: ["code" | "none" | "token" | "code id_token token" | "code id_token" | "code token" | "id_token token" | "id_token", ...("code" | "none" | "token" | "code id_token token" | "code id_token" | "code token" | "id_token token" | "id_token")[]] | undefined;
1431
1432
  grant_types?: ["authorization_code" | "implicit" | "refresh_token" | "password" | "client_credentials" | "urn:ietf:params:oauth:grant-type:jwt-bearer" | "urn:ietf:params:oauth:grant-type:saml2-bearer", ...("authorization_code" | "implicit" | "refresh_token" | "password" | "client_credentials" | "urn:ietf:params:oauth:grant-type:jwt-bearer" | "urn:ietf:params:oauth:grant-type:saml2-bearer")[]] | undefined;
1432
- scope?: string | undefined;
1433
1433
  token_endpoint_auth_method?: "client_secret_basic" | "client_secret_jwt" | "client_secret_post" | "none" | "private_key_jwt" | "self_signed_tls_client_auth" | "tls_client_auth" | undefined;
1434
1434
  token_endpoint_auth_signing_alg?: string | undefined;
1435
1435
  userinfo_signed_response_alg?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-client-metadata.d.ts","sourceRoot":"","sources":["../src/oauth-client-metadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AASvB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWH,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAC3E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA"}
@@ -7,6 +7,7 @@ const oauth_client_id_js_1 = require("./oauth-client-id.js");
7
7
  const oauth_endpoint_auth_method_js_1 = require("./oauth-endpoint-auth-method.js");
8
8
  const oauth_grant_type_js_1 = require("./oauth-grant-type.js");
9
9
  const oauth_response_type_js_1 = require("./oauth-response-type.js");
10
+ const oauth_scope_js_1 = require("./oauth-scope.js");
10
11
  // https://openid.net/specs/openid-connect-registration-1_0.html
11
12
  // https://datatracker.ietf.org/doc/html/rfc7591
12
13
  exports.oauthClientMetadataSchema = zod_1.z.object({
@@ -23,7 +24,7 @@ exports.oauthClientMetadataSchema = zod_1.z.object({
23
24
  // > If omitted, the default behavior is that the client will use only the
24
25
  // > "authorization_code" Grant Type.
25
26
  .default(['authorization_code']),
26
- scope: zod_1.z.string().optional(),
27
+ scope: oauth_scope_js_1.oauthScopeSchema.optional(),
27
28
  token_endpoint_auth_method: oauth_endpoint_auth_method_js_1.oauthEndpointAuthMethod
28
29
  .default('none')
29
30
  .optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-client-metadata.js","sourceRoot":"","sources":["../src/oauth-client-metadata.ts"],"names":[],"mappings":";;;AAAA,sCAA4C;AAC5C,6BAAuB;AAEvB,6DAA0D;AAC1D,mFAAyE;AACzE,+DAA4D;AAC5D,qEAAkE;AAElE,gEAAgE;AAChE,gDAAgD;AACnC,QAAA,yBAAyB,GAAG,OAAC,CAAC,M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A0C,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAElE,4DAA4D;IAC5D,wBAAwB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAEhD,6DAA6D;IAC7D,2BAA2B,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC5D,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { z } from 'zod';
2
+ export declare const oauthCodeChallengeMethodSchema: z.ZodEnum<["S256", "plain"]>;
3
+ //# sourceMappingURL=oauth-code-challenge-method.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-code-challenge-method.d.ts","sourceRoot":"","sources":["../src/oauth-code-challenge-method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,8BAA8B,8BAA4B,CAAA"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oauthCodeChallengeMethodSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.oauthCodeChallengeMethodSchema = zod_1.z.enum(['S256', 'plain']);
6
+ //# sourceMappingURL=oauth-code-challenge-method.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-code-challenge-method.js","sourceRoot":"","sources":["../src/oauth-code-challenge-method.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,8BAA8B,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA"}
@@ -0,0 +1,20 @@
1
+ import { OAuthAuthorizationDetails } from './oauth-authorization-details.js';
2
+ import { OAuthTokenType } from './oauth-token-type.js';
3
+ export type OAuthIntrospectionResponse = {
4
+ active: false;
5
+ } | {
6
+ active: true;
7
+ scope?: string;
8
+ client_id?: string;
9
+ username?: string;
10
+ token_type?: OAuthTokenType;
11
+ authorization_details?: OAuthAuthorizationDetails;
12
+ aud?: string | [string, ...string[]];
13
+ exp?: number;
14
+ iat?: number;
15
+ iss?: string;
16
+ jti?: string;
17
+ nbf?: number;
18
+ sub?: string;
19
+ };
20
+ //# sourceMappingURL=oauth-introspection-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-introspection-response.d.ts","sourceRoot":"","sources":["../src/oauth-introspection-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAA;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAGtD,MAAM,MAAM,0BAA0B,GAClC;IAAE,MAAM,EAAE,KAAK,CAAA;CAAE,GACjB;IACE,MAAM,EAAE,IAAI,CAAA;IAEZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,cAAc,CAAA;IAC3B,qBAAqB,CAAC,EAAE,yBAAyB,CAAA;IAEjD,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAA;IACpC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=oauth-introspection-response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-introspection-response.js","sourceRoot":"","sources":["../src/oauth-introspection-response.ts"],"names":[],"mappings":""}
@@ -1,10 +1,13 @@
1
1
  import { z } from 'zod';
2
2
  export declare const oauthParResponseSchema: z.ZodObject<{
3
3
  request_uri: z.ZodString;
4
+ expires_in: z.ZodNumber;
4
5
  }, "strip", z.ZodTypeAny, {
5
6
  request_uri: string;
7
+ expires_in: number;
6
8
  }, {
7
9
  request_uri: string;
10
+ expires_in: number;
8
11
  }>;
9
12
  export type OAuthParResponse = z.infer<typeof oauthParResponseSchema>;
10
13
  //# sourceMappingURL=oauth-par-response.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-par-response.d.ts","sourceRoot":"","sources":["../src/oauth-par-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,sBAAsB;;;;;;EAEjC,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
1
+ {"version":3,"file":"oauth-par-response.d.ts","sourceRoot":"","sources":["../src/oauth-par-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,sBAAsB;;;;;;;;;EAGjC,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
@@ -4,5 +4,6 @@ exports.oauthParResponseSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.oauthParResponseSchema = zod_1.z.object({
6
6
  request_uri: zod_1.z.string(),
7
+ expires_in: zod_1.z.number().int().positive(),
7
8
  });
8
9
  //# sourceMappingURL=oauth-par-response.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-par-response.js","sourceRoot":"","sources":["../src/oauth-par-response.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAA"}
1
+ {"version":3,"file":"oauth-par-response.js","sourceRoot":"","sources":["../src/oauth-par-response.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;IACvB,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ export declare const oauthPasswordGrantTokenRequestSchema: z.ZodObject<{
3
+ grant_type: z.ZodLiteral<"password">;
4
+ username: z.ZodString;
5
+ password: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ password: string;
8
+ grant_type: "password";
9
+ username: string;
10
+ }, {
11
+ password: string;
12
+ grant_type: "password";
13
+ username: string;
14
+ }>;
15
+ export type OAuthPasswordGrantTokenRequest = z.infer<typeof oauthPasswordGrantTokenRequestSchema>;
16
+ //# sourceMappingURL=oauth-password-grant-token-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-password-grant-token-request.d.ts","sourceRoot":"","sources":["../src/oauth-password-grant-token-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,oCAAoC;;;;;;;;;;;;EAI/C,CAAA;AAEF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,oCAAoC,CAC5C,CAAA"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oauthPasswordGrantTokenRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.oauthPasswordGrantTokenRequestSchema = zod_1.z.object({
6
+ grant_type: zod_1.z.literal('password'),
7
+ username: zod_1.z.string(),
8
+ password: zod_1.z.string(),
9
+ });
10
+ //# sourceMappingURL=oauth-password-grant-token-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-password-grant-token-request.js","sourceRoot":"","sources":["../src/oauth-password-grant-token-request.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,oCAAoC,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3D,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IACjC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ export declare const oauthRefreshTokenGrantTokenRequestSchema: z.ZodObject<{
3
+ grant_type: z.ZodLiteral<"refresh_token">;
4
+ refresh_token: z.ZodString;
5
+ client_id: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ refresh_token: string;
8
+ client_id: string;
9
+ grant_type: "refresh_token";
10
+ }, {
11
+ refresh_token: string;
12
+ client_id: string;
13
+ grant_type: "refresh_token";
14
+ }>;
15
+ export type OAuthRefreshTokenGrantTokenRequest = z.infer<typeof oauthRefreshTokenGrantTokenRequestSchema>;
16
+ //# sourceMappingURL=oauth-refresh-token-grant-token-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-refresh-token-grant-token-request.d.ts","sourceRoot":"","sources":["../src/oauth-refresh-token-grant-token-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,wCAAwC;;;;;;;;;;;;EAInD,CAAA;AAEF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,wCAAwC,CAChD,CAAA"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oauthRefreshTokenGrantTokenRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const oauth_client_id_js_1 = require("./oauth-client-id.js");
6
+ const oauth_refresh_token_js_1 = require("./oauth-refresh-token.js");
7
+ exports.oauthRefreshTokenGrantTokenRequestSchema = zod_1.z.object({
8
+ grant_type: zod_1.z.literal('refresh_token'),
9
+ refresh_token: oauth_refresh_token_js_1.oauthRefreshTokenSchema,
10
+ client_id: oauth_client_id_js_1.oauthClientIdSchema,
11
+ });
12
+ //# sourceMappingURL=oauth-refresh-token-grant-token-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-refresh-token-grant-token-request.js","sourceRoot":"","sources":["../src/oauth-refresh-token-grant-token-request.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,6DAA0D;AAC1D,qEAAkE;AAErD,QAAA,wCAAwC,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/D,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,eAAe,CAAC;IACtC,aAAa,EAAE,gDAAuB;IACtC,SAAS,EAAE,wCAAmB;CAC/B,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ export declare const oauthRefreshTokenSchema: z.ZodString;
3
+ export type OAuthRefreshToken = z.infer<typeof oauthRefreshTokenSchema>;
4
+ //# sourceMappingURL=oauth-refresh-token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-refresh-token.d.ts","sourceRoot":"","sources":["../src/oauth-refresh-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,uBAAuB,aAAoB,CAAA;AACxD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oauthRefreshTokenSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.oauthRefreshTokenSchema = zod_1.z.string().min(1);
6
+ //# sourceMappingURL=oauth-refresh-token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-refresh-token.js","sourceRoot":"","sources":["../src/oauth-refresh-token.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ export declare const oauthRequestUriSchema: z.ZodString;
3
+ export type OAuthRequestUri = z.infer<typeof oauthRequestUriSchema>;
4
+ //# sourceMappingURL=oauth-request-uri.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-request-uri.d.ts","sourceRoot":"","sources":["../src/oauth-request-uri.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,qBAAqB,aAAa,CAAA;AAE/C,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oauthRequestUriSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.oauthRequestUriSchema = zod_1.z.string();
6
+ //# sourceMappingURL=oauth-request-uri.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-request-uri.js","sourceRoot":"","sources":["../src/oauth-request-uri.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,EAAE,CAAA"}
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.oauthResponseTypeSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.oauthResponseTypeSchema = zod_1.z.enum([
6
- // OAuth
6
+ // OAuth2 (https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-10#section-4.1.1)
7
7
  'code', // Authorization Code Grant
8
8
  'token', // Implicit Grant
9
- // OpenID
9
+ // OIDC (https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html)
10
10
  'none',
11
11
  'code id_token token',
12
12
  'code id_token',
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-response-type.js","sourceRoot":"","sources":["../src/oauth-response-type.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,uBAAuB,GAAG,OAAC,CAAC,IAAI,CAAC;IAC5C,QAAQ;IACR,MAAM,EAAE,2BAA2B;IACnC,OAAO,EAAE,iBAAiB;IAE1B,SAAS;IACT,MAAM;IACN,qBAAqB;IACrB,eAAe;IACf,YAAY;IACZ,gBAAgB;IAChB,UAAU;CACX,CAAC,CAAA"}
1
+ {"version":3,"file":"oauth-response-type.js","sourceRoot":"","sources":["../src/oauth-response-type.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,uBAAuB,GAAG,OAAC,CAAC,IAAI,CAAC;IAC5C,wFAAwF;IACxF,MAAM,EAAE,2BAA2B;IACnC,OAAO,EAAE,iBAAiB;IAE1B,4EAA4E;IAC5E,MAAM;IACN,qBAAqB;IACrB,eAAe;IACf,YAAY;IACZ,gBAAgB;IAChB,UAAU;CACX,CAAC,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * A space separated list of most non-control ASCII characters except backslash
4
+ * and double quote.
5
+ *
6
+ * @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-11#section-1.4.1}
7
+ */
8
+ export declare const oauthScopeSchema: z.ZodString;
9
+ export type OAuthScope = z.infer<typeof oauthScopeSchema>;
10
+ //# sourceMappingURL=oauth-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-scope.d.ts","sourceRoot":"","sources":["../src/oauth-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,aAIyC,CAAA;AAEtE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oauthScopeSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * A space separated list of most non-control ASCII characters except backslash
7
+ * and double quote.
8
+ *
9
+ * @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-11#section-1.4.1}
10
+ */
11
+ exports.oauthScopeSchema = zod_1.z
12
+ .string()
13
+ // scope = scope-token *( SP scope-token )
14
+ // scope-token = 1*( %x21 / %x23-5B / %x5D-7E )
15
+ .regex(/^[\x21\x23-\x5B\x5D-\x7E]+(?: [\x21\x23-\x5B\x5D-\x7E]+)*$/);
16
+ //# sourceMappingURL=oauth-scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-scope.js","sourceRoot":"","sources":["../src/oauth-scope.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEvB;;;;;GAKG;AACU,QAAA,gBAAgB,GAAG,OAAC;KAC9B,MAAM,EAAE;IACT,gDAAgD;IAChD,+CAA+C;KAC9C,KAAK,CAAC,4DAA4D,CAAC,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export declare const oauthTokenIdentificationSchema: z.ZodObject<{
3
+ token: z.ZodUnion<[z.ZodString, z.ZodString]>;
4
+ token_type_hint: z.ZodOptional<z.ZodEnum<["access_token", "refresh_token"]>>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ token: string;
7
+ token_type_hint?: "refresh_token" | "access_token" | undefined;
8
+ }, {
9
+ token: string;
10
+ token_type_hint?: "refresh_token" | "access_token" | undefined;
11
+ }>;
12
+ export type OAuthTokenIdentification = z.infer<typeof oauthTokenIdentificationSchema>;
13
+ //# sourceMappingURL=oauth-token-identification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-token-identification.d.ts","sourceRoot":"","sources":["../src/oauth-token-identification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,8BAA8B;;;;;;;;;EAGzC,CAAA;AAEF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAA"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oauthTokenIdentificationSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const oauth_access_token_js_1 = require("./oauth-access-token.js");
6
+ const oauth_refresh_token_js_1 = require("./oauth-refresh-token.js");
7
+ exports.oauthTokenIdentificationSchema = zod_1.z.object({
8
+ token: zod_1.z.union([oauth_access_token_js_1.oauthAccessTokenSchema, oauth_refresh_token_js_1.oauthRefreshTokenSchema]),
9
+ token_type_hint: zod_1.z.enum(['access_token', 'refresh_token']).optional(),
10
+ });
11
+ //# sourceMappingURL=oauth-token-identification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-token-identification.js","sourceRoot":"","sources":["../src/oauth-token-identification.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,mEAAgE;AAChE,qEAAkE;AAErD,QAAA,8BAA8B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,8CAAsB,EAAE,gDAAuB,CAAC,CAAC;IACjE,eAAe,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC,CAAC,QAAQ,EAAE;CACtE,CAAC,CAAA"}
@@ -0,0 +1,49 @@
1
+ import { z } from 'zod';
2
+ export declare const oauthTokenRequestSchema: z.ZodDiscriminatedUnion<"grant_type", [z.ZodObject<{
3
+ grant_type: z.ZodLiteral<"authorization_code">;
4
+ code: z.ZodString;
5
+ redirect_uri: z.ZodString;
6
+ code_verifier: z.ZodOptional<z.ZodString>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ code: string;
9
+ redirect_uri: string;
10
+ grant_type: "authorization_code";
11
+ code_verifier?: string | undefined;
12
+ }, {
13
+ code: string;
14
+ redirect_uri: string;
15
+ grant_type: "authorization_code";
16
+ code_verifier?: string | undefined;
17
+ }>, z.ZodObject<{
18
+ grant_type: z.ZodLiteral<"refresh_token">;
19
+ refresh_token: z.ZodString;
20
+ client_id: z.ZodString;
21
+ }, "strip", z.ZodTypeAny, {
22
+ refresh_token: string;
23
+ client_id: string;
24
+ grant_type: "refresh_token";
25
+ }, {
26
+ refresh_token: string;
27
+ client_id: string;
28
+ grant_type: "refresh_token";
29
+ }>, z.ZodObject<{
30
+ grant_type: z.ZodLiteral<"password">;
31
+ username: z.ZodString;
32
+ password: z.ZodString;
33
+ }, "strip", z.ZodTypeAny, {
34
+ password: string;
35
+ grant_type: "password";
36
+ username: string;
37
+ }, {
38
+ password: string;
39
+ grant_type: "password";
40
+ username: string;
41
+ }>, z.ZodObject<{
42
+ grant_type: z.ZodLiteral<"client_credentials">;
43
+ }, "strip", z.ZodTypeAny, {
44
+ grant_type: "client_credentials";
45
+ }, {
46
+ grant_type: "client_credentials";
47
+ }>]>;
48
+ export type OAuthTokenRequest = z.infer<typeof oauthTokenRequestSchema>;
49
+ //# sourceMappingURL=oauth-token-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-token-request.d.ts","sourceRoot":"","sources":["../src/oauth-token-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKlC,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oauthTokenRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const oauth_authorization_code_grant_token_request_js_1 = require("./oauth-authorization-code-grant-token-request.js");
6
+ const oauth_client_credentials_grant_token_request_js_1 = require("./oauth-client-credentials-grant-token-request.js");
7
+ const oauth_password_grant_token_request_js_1 = require("./oauth-password-grant-token-request.js");
8
+ const oauth_refresh_token_grant_token_request_js_1 = require("./oauth-refresh-token-grant-token-request.js");
9
+ exports.oauthTokenRequestSchema = zod_1.z.discriminatedUnion('grant_type', [
10
+ oauth_authorization_code_grant_token_request_js_1.oauthAuthorizationCodeGrantTokenRequestSchema,
11
+ oauth_refresh_token_grant_token_request_js_1.oauthRefreshTokenGrantTokenRequestSchema,
12
+ oauth_password_grant_token_request_js_1.oauthPasswordGrantTokenRequestSchema,
13
+ oauth_client_credentials_grant_token_request_js_1.oauthClientCredentialsGrantTokenRequestSchema,
14
+ ]);
15
+ //# sourceMappingURL=oauth-token-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-token-request.js","sourceRoot":"","sources":["../src/oauth-token-request.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,uHAAiH;AACjH,uHAAiH;AACjH,mGAA8F;AAC9F,6GAAuG;AAE1F,QAAA,uBAAuB,GAAG,OAAC,CAAC,kBAAkB,CAAC,YAAY,EAAE;IACxE,+FAA6C;IAC7C,qFAAwC;IACxC,4EAAoC;IACpC,+FAA6C;CAC9C,CAAC,CAAA"}
@@ -6,7 +6,6 @@ export declare const oauthTokenResponseSchema: z.ZodObject<{
6
6
  access_token: z.ZodString;
7
7
  token_type: z.ZodUnion<[z.ZodEffects<z.ZodString, "DPoP", string>, z.ZodEffects<z.ZodString, "Bearer", string>]>;
8
8
  issuer: z.ZodOptional<z.ZodString>;
9
- sub: z.ZodOptional<z.ZodString>;
10
9
  scope: z.ZodOptional<z.ZodString>;
11
10
  id_token: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>>;
12
11
  refresh_token: z.ZodOptional<z.ZodString>;
@@ -37,7 +36,6 @@ export declare const oauthTokenResponseSchema: z.ZodObject<{
37
36
  access_token: z.ZodString;
38
37
  token_type: z.ZodUnion<[z.ZodEffects<z.ZodString, "DPoP", string>, z.ZodEffects<z.ZodString, "Bearer", string>]>;
39
38
  issuer: z.ZodOptional<z.ZodString>;
40
- sub: z.ZodOptional<z.ZodString>;
41
39
  scope: z.ZodOptional<z.ZodString>;
42
40
  id_token: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>>;
43
41
  refresh_token: z.ZodOptional<z.ZodString>;
@@ -68,7 +66,6 @@ export declare const oauthTokenResponseSchema: z.ZodObject<{
68
66
  access_token: z.ZodString;
69
67
  token_type: z.ZodUnion<[z.ZodEffects<z.ZodString, "DPoP", string>, z.ZodEffects<z.ZodString, "Bearer", string>]>;
70
68
  issuer: z.ZodOptional<z.ZodString>;
71
- sub: z.ZodOptional<z.ZodString>;
72
69
  scope: z.ZodOptional<z.ZodString>;
73
70
  id_token: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>>;
74
71
  refresh_token: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-token-response.d.ts","sourceRoot":"","sources":["../src/oauth-token-response.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAcrB,CAAA;AAEhB;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
1
+ {"version":3,"file":"oauth-token-response.d.ts","sourceRoot":"","sources":["../src/oauth-token-response.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAarB,CAAA;AAEhB;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
@@ -13,7 +13,6 @@ exports.oauthTokenResponseSchema = zod_1.z
13
13
  access_token: zod_1.z.string(),
14
14
  token_type: oauth_token_type_js_1.oauthTokenTypeSchema,
15
15
  issuer: zod_1.z.string().url().optional(),
16
- sub: zod_1.z.string().optional(),
17
16
  scope: zod_1.z.string().optional(),
18
17
  id_token: jwk_1.signedJwtSchema.optional(),
19
18
  refresh_token: zod_1.z.string().optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-token-response.js","sourceRoot":"","sources":["../src/oauth-token-response.ts"],"names":[],"mappings":";;;AAAA,sCAA8C;AAC9C,6BAAuB;AAEvB,qFAAkF;AAClF,+DAA4D;AAE5D;;GAEG;AACU,QAAA,wBAAwB,GAAG,OAAC;KACtC,MAAM,CAAC;IACN,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;IACxB,UAAU,EAAE,0CAAoB;IAChC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACnC,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,QAAQ,EAAE,qBAAe,CAAC,QAAQ,EAAE;IACpC,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,qBAAqB,EAAE,gEAA+B,CAAC,QAAQ,EAAE;CAClE,CAAC;IACF,0DAA0D;IAC1D,qEAAqE;KACpE,WAAW,EAAE,CAAA"}
1
+ {"version":3,"file":"oauth-token-response.js","sourceRoot":"","sources":["../src/oauth-token-response.ts"],"names":[],"mappings":";;;AAAA,sCAA8C;AAC9C,6BAAuB;AAEvB,qFAAkF;AAClF,+DAA4D;AAE5D;;GAEG;AACU,QAAA,wBAAwB,GAAG,OAAC;KACtC,MAAM,CAAC;IACN,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;IACxB,UAAU,EAAE,0CAAoB;IAChC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACnC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,QAAQ,EAAE,qBAAe,CAAC,QAAQ,EAAE;IACpC,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,qBAAqB,EAAE,gEAA+B,CAAC,QAAQ,EAAE;CAClE,CAAC;IACF,0DAA0D;IAC1D,qEAAqE;KACpE,WAAW,EAAE,CAAA"}
package/dist/util.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- export declare function isIP(hostname: string): boolean;
1
+ export declare function isHostnameIP(hostname: string): boolean;
2
2
  export type LoopbackHost = 'localhost' | '127.0.0.1' | '[::1]';
3
3
  export declare function isLoopbackHost(host: unknown): host is LoopbackHost;
4
4
  export declare function isLoopbackUrl(input: URL | string): boolean;
5
5
  export declare function safeUrl(input: URL | string): URL | null;
6
+ export declare function extractUrlPath(url: any): any;
6
7
  //# sourceMappingURL=util.d.ts.map