@atproto/oauth-types 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/atproto-loopback-client-metadata.d.ts.map +1 -1
  3. package/dist/atproto-loopback-client-metadata.js +4 -16
  4. package/dist/atproto-loopback-client-metadata.js.map +1 -1
  5. package/dist/constants.d.ts +0 -6
  6. package/dist/constants.d.ts.map +1 -1
  7. package/dist/constants.js +1 -17
  8. package/dist/constants.js.map +1 -1
  9. package/dist/index.d.ts +18 -5
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +18 -5
  12. package/dist/index.js.map +1 -1
  13. package/dist/oauth-access-token.d.ts +4 -0
  14. package/dist/oauth-access-token.d.ts.map +1 -0
  15. package/dist/oauth-access-token.js +6 -0
  16. package/dist/oauth-access-token.js.map +1 -0
  17. package/dist/oauth-authorization-code-grant-token-request.d.ts +20 -0
  18. package/dist/oauth-authorization-code-grant-token-request.d.ts.map +1 -0
  19. package/dist/oauth-authorization-code-grant-token-request.js +17 -0
  20. package/dist/oauth-authorization-code-grant-token-request.js.map +1 -0
  21. package/dist/oauth-authorization-request-jar.d.ts +16 -0
  22. package/dist/oauth-authorization-request-jar.d.ts.map +1 -0
  23. package/dist/oauth-authorization-request-jar.js +15 -0
  24. package/dist/oauth-authorization-request-jar.js.map +1 -0
  25. package/dist/oauth-authorization-request-par.d.ts +122 -0
  26. package/dist/oauth-authorization-request-par.d.ts.map +1 -0
  27. package/dist/oauth-authorization-request-par.js +11 -0
  28. package/dist/oauth-authorization-request-par.js.map +1 -0
  29. package/dist/{oauth-authentication-request-parameters.d.ts → oauth-authorization-request-parameters.d.ts} +18 -18
  30. package/dist/oauth-authorization-request-parameters.d.ts.map +1 -0
  31. package/dist/{oauth-authentication-request-parameters.js → oauth-authorization-request-parameters.js} +16 -17
  32. package/dist/oauth-authorization-request-parameters.js.map +1 -0
  33. package/dist/oauth-authorization-request-query.d.ts +128 -0
  34. package/dist/oauth-authorization-request-query.d.ts.map +1 -0
  35. package/dist/oauth-authorization-request-query.js +13 -0
  36. package/dist/oauth-authorization-request-query.js.map +1 -0
  37. package/dist/oauth-authorization-request-uri.d.ts +10 -0
  38. package/dist/oauth-authorization-request-uri.d.ts.map +1 -0
  39. package/dist/oauth-authorization-request-uri.js +9 -0
  40. package/dist/oauth-authorization-request-uri.js.map +1 -0
  41. package/dist/oauth-authorization-server-metadata.d.ts +16 -16
  42. package/dist/oauth-authorization-server-metadata.d.ts.map +1 -1
  43. package/dist/oauth-authorization-server-metadata.js +5 -1
  44. package/dist/oauth-authorization-server-metadata.js.map +1 -1
  45. package/dist/oauth-client-credentials-grant-token-request.d.ts +10 -0
  46. package/dist/oauth-client-credentials-grant-token-request.d.ts.map +1 -0
  47. package/dist/oauth-client-credentials-grant-token-request.js +8 -0
  48. package/dist/oauth-client-credentials-grant-token-request.js.map +1 -0
  49. package/dist/oauth-client-credentials.d.ts +18 -2
  50. package/dist/oauth-client-credentials.d.ts.map +1 -1
  51. package/dist/oauth-client-credentials.js +8 -2
  52. package/dist/oauth-client-credentials.js.map +1 -1
  53. package/dist/oauth-client-id-discoverable.d.ts +3 -2
  54. package/dist/oauth-client-id-discoverable.d.ts.map +1 -1
  55. package/dist/oauth-client-id-discoverable.js +22 -20
  56. package/dist/oauth-client-id-discoverable.js.map +1 -1
  57. package/dist/oauth-client-id-loopback.d.ts +10 -3
  58. package/dist/oauth-client-id-loopback.d.ts.map +1 -1
  59. package/dist/oauth-client-id-loopback.js +59 -23
  60. package/dist/oauth-client-id-loopback.js.map +1 -1
  61. package/dist/oauth-client-metadata.d.ts +91 -91
  62. package/dist/oauth-client-metadata.d.ts.map +1 -1
  63. package/dist/oauth-client-metadata.js +2 -1
  64. package/dist/oauth-client-metadata.js.map +1 -1
  65. package/dist/oauth-code-challenge-method.d.ts +3 -0
  66. package/dist/oauth-code-challenge-method.d.ts.map +1 -0
  67. package/dist/oauth-code-challenge-method.js +6 -0
  68. package/dist/oauth-code-challenge-method.js.map +1 -0
  69. package/dist/oauth-introspection-response.d.ts +20 -0
  70. package/dist/oauth-introspection-response.d.ts.map +1 -0
  71. package/dist/oauth-introspection-response.js +3 -0
  72. package/dist/oauth-introspection-response.js.map +1 -0
  73. package/dist/oauth-issuer-identifier.d.ts +2 -1
  74. package/dist/oauth-issuer-identifier.d.ts.map +1 -1
  75. package/dist/oauth-issuer-identifier.js +13 -12
  76. package/dist/oauth-issuer-identifier.js.map +1 -1
  77. package/dist/oauth-par-response.d.ts +3 -0
  78. package/dist/oauth-par-response.d.ts.map +1 -1
  79. package/dist/oauth-par-response.js +1 -0
  80. package/dist/oauth-par-response.js.map +1 -1
  81. package/dist/oauth-password-grant-token-request.d.ts +16 -0
  82. package/dist/oauth-password-grant-token-request.d.ts.map +1 -0
  83. package/dist/oauth-password-grant-token-request.js +10 -0
  84. package/dist/oauth-password-grant-token-request.js.map +1 -0
  85. package/dist/oauth-protected-resource-metadata.d.ts +2 -2
  86. package/dist/oauth-refresh-token-grant-token-request.d.ts +13 -0
  87. package/dist/oauth-refresh-token-grant-token-request.d.ts.map +1 -0
  88. package/dist/oauth-refresh-token-grant-token-request.js +10 -0
  89. package/dist/oauth-refresh-token-grant-token-request.js.map +1 -0
  90. package/dist/oauth-refresh-token.d.ts +4 -0
  91. package/dist/oauth-refresh-token.d.ts.map +1 -0
  92. package/dist/oauth-refresh-token.js +6 -0
  93. package/dist/oauth-refresh-token.js.map +1 -0
  94. package/dist/oauth-request-uri.d.ts +4 -0
  95. package/dist/oauth-request-uri.d.ts.map +1 -0
  96. package/dist/oauth-request-uri.js +6 -0
  97. package/dist/oauth-request-uri.js.map +1 -0
  98. package/dist/oauth-scope.d.ts +10 -0
  99. package/dist/oauth-scope.d.ts.map +1 -0
  100. package/dist/oauth-scope.js +16 -0
  101. package/dist/oauth-scope.js.map +1 -0
  102. package/dist/oauth-token-identification.d.ts +13 -0
  103. package/dist/oauth-token-identification.d.ts.map +1 -0
  104. package/dist/oauth-token-identification.js +11 -0
  105. package/dist/oauth-token-identification.js.map +1 -0
  106. package/dist/oauth-token-request.d.ts +46 -0
  107. package/dist/oauth-token-request.d.ts.map +1 -0
  108. package/dist/oauth-token-request.js +15 -0
  109. package/dist/oauth-token-request.js.map +1 -0
  110. package/dist/oauth-token-response.d.ts +3 -6
  111. package/dist/oauth-token-response.d.ts.map +1 -1
  112. package/dist/oauth-token-response.js +4 -2
  113. package/dist/oauth-token-response.js.map +1 -1
  114. package/dist/util.d.ts +2 -1
  115. package/dist/util.d.ts.map +1 -1
  116. package/dist/util.js +36 -6
  117. package/dist/util.js.map +1 -1
  118. package/package.json +2 -2
  119. package/src/atproto-loopback-client-metadata.ts +7 -20
  120. package/src/constants.ts +0 -16
  121. package/src/index.ts +18 -5
  122. package/src/oauth-access-token.ts +4 -0
  123. package/src/oauth-authorization-code-grant-token-request.ts +18 -0
  124. package/src/oauth-authorization-request-jar.ts +16 -0
  125. package/src/oauth-authorization-request-par.ts +13 -0
  126. package/src/{oauth-authentication-request-parameters.ts → oauth-authorization-request-parameters.ts} +21 -22
  127. package/src/oauth-authorization-request-query.ts +15 -0
  128. package/src/oauth-authorization-request-uri.ts +11 -0
  129. package/src/oauth-authorization-server-metadata.ts +5 -1
  130. package/src/oauth-client-credentials-grant-token-request.ts +9 -0
  131. package/src/oauth-client-credentials.ts +21 -1
  132. package/src/oauth-client-id-discoverable.ts +29 -26
  133. package/src/oauth-client-id-loopback.ts +78 -30
  134. package/src/oauth-client-metadata.ts +2 -1
  135. package/src/oauth-code-challenge-method.ts +3 -0
  136. package/src/oauth-introspection-response.ts +23 -0
  137. package/src/oauth-issuer-identifier.ts +17 -12
  138. package/src/oauth-par-response.ts +1 -0
  139. package/src/oauth-password-grant-token-request.ts +11 -0
  140. package/src/oauth-refresh-token-grant-token-request.ts +11 -0
  141. package/src/oauth-refresh-token.ts +4 -0
  142. package/src/oauth-request-uri.ts +5 -0
  143. package/src/oauth-scope.ts +15 -0
  144. package/src/oauth-token-identification.ts +12 -0
  145. package/src/oauth-token-request.ts +14 -0
  146. package/src/oauth-token-response.ts +4 -2
  147. package/src/util.ts +41 -1
  148. package/tsconfig.build.tsbuildinfo +1 -0
  149. package/dist/access-token.d.ts +0 -4
  150. package/dist/access-token.d.ts.map +0 -1
  151. package/dist/access-token.js +0 -6
  152. package/dist/access-token.js.map +0 -1
  153. package/dist/oauth-authentication-request-parameters.d.ts.map +0 -1
  154. package/dist/oauth-authentication-request-parameters.js.map +0 -1
  155. package/dist/oauth-client-id-url.d.ts +0 -3
  156. package/dist/oauth-client-id-url.d.ts.map +0 -1
  157. package/dist/oauth-client-id-url.js +0 -21
  158. package/dist/oauth-client-id-url.js.map +0 -1
  159. package/dist/oauth-client-identification.d.ts +0 -31
  160. package/dist/oauth-client-identification.d.ts.map +0 -1
  161. package/dist/oauth-client-identification.js +0 -12
  162. package/dist/oauth-client-identification.js.map +0 -1
  163. package/src/access-token.ts +0 -4
  164. package/src/oauth-client-id-url.ts +0 -25
  165. package/src/oauth-client-identification.ts +0 -14
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # @atproto/oauth-types
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#2874](https://github.com/bluesky-social/atproto/pull/2874) [`7f26b1765`](https://github.com/bluesky-social/atproto/commit/7f26b176526b9856a8f61faca6f065f0afd43abf) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Allow oauthIssuerIdentifier to be an "http:" url. Make sure to manually check for "http:" issuers if you don't allow them.
8
+
9
+ - [#2874](https://github.com/bluesky-social/atproto/pull/2874) [`7f26b1765`](https://github.com/bluesky-social/atproto/commit/7f26b176526b9856a8f61faca6f065f0afd43abf) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Remove ALLOW_UNSECURE_ORIGINS constant
10
+
11
+ - [#2871](https://github.com/bluesky-social/atproto/pull/2871) [`9d40ccbb6`](https://github.com/bluesky-social/atproto/commit/9d40ccbb69103fae9aae7e3cec31e9b3116f3ba2) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Remove invalid `issuer` property from OAuthTokenResponse
12
+
13
+ ### Patch Changes
14
+
15
+ - [#2871](https://github.com/bluesky-social/atproto/pull/2871) [`9d40ccbb6`](https://github.com/bluesky-social/atproto/commit/9d40ccbb69103fae9aae7e3cec31e9b3116f3ba2) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add missing "wap" display request parameter value
16
+
17
+ - [#2871](https://github.com/bluesky-social/atproto/pull/2871) [`9d40ccbb6`](https://github.com/bluesky-social/atproto/commit/9d40ccbb69103fae9aae7e3cec31e9b3116f3ba2) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Remove invalid `client_id` property from oauthRefreshTokenGrantTokenRequestSchema
18
+
19
+ - [#2874](https://github.com/bluesky-social/atproto/pull/2874) [`7f26b1765`](https://github.com/bluesky-social/atproto/commit/7f26b176526b9856a8f61faca6f065f0afd43abf) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Improve typing of oauthIssuerIdentifierSchema
20
+
21
+ ## 0.1.5
22
+
23
+ ### Patch Changes
24
+
25
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Properly validate client metadata scope
26
+
27
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Allow ClientID query params to end with a slash "/" char
28
+
29
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Expose OAuthScope
30
+
31
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - add assertion utils for client ids
32
+
33
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Allow loopback client ids to omit the (empty) path parameter
34
+
35
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Enforce ClientID URL path to be normalized
36
+
37
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Rename OAuthAuthenticationRequestParameters to OAuthAuthorizationRequestParameters
38
+
39
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Restrict the value used as code_challenge_methods_supported
40
+
41
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add missing "expires_in" property to OAuthParResponse type definition
42
+
43
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Allow loopback clients to define their scopes through the "scope" client_id query parameter.
44
+
45
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Improve error description in case of invalid loopback client_id
46
+
3
47
  ## 0.1.4
4
48
 
5
49
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"atproto-loopback-client-metadata.d.ts","sourceRoot":"","sources":["../src/atproto-loopback-client-metadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAGrE,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,MAAM,GACf,wBAAwB,CA6B1B"}
1
+ {"version":3,"file":"atproto-loopback-client-metadata.d.ts","sourceRoot":"","sources":["../src/atproto-loopback-client-metadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAErE,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,MAAM,GACf,wBAAwB,CAiB1B"}
@@ -1,31 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.atprotoLoopbackClientMetadata = void 0;
3
+ exports.atprotoLoopbackClientMetadata = atprotoLoopbackClientMetadata;
4
4
  const oauth_client_id_loopback_js_1 = require("./oauth-client-id-loopback.js");
5
- const oauth_client_id_url_js_1 = require("./oauth-client-id-url.js");
6
5
  function atprotoLoopbackClientMetadata(clientId) {
7
- if (!(0, oauth_client_id_loopback_js_1.isOAuthClientIdLoopback)(clientId)) {
8
- throw new TypeError(`Invalid loopback client ID ${clientId}`);
9
- }
10
- const { origin, pathname, searchParams } = (0, oauth_client_id_url_js_1.parseOAuthClientIdUrl)(clientId);
11
- for (const name of searchParams.keys()) {
12
- if (name !== 'redirect_uri') {
13
- throw new TypeError(`Invalid query parameter ${name} in client ID`);
14
- }
15
- }
16
- const redirectUris = searchParams.getAll('redirect_uri');
6
+ const { scope = 'atproto', redirect_uris = [`http://127.0.0.1/`, `http://[::1]/`], } = (0, oauth_client_id_loopback_js_1.parseOAuthLoopbackClientId)(clientId);
17
7
  return {
18
8
  client_id: clientId,
9
+ scope,
10
+ redirect_uris,
19
11
  client_name: 'Loopback client',
20
12
  response_types: ['code'],
21
13
  grant_types: ['authorization_code', 'refresh_token'],
22
- redirect_uris: (redirectUris.length
23
- ? redirectUris
24
- : ['127.0.0.1', '[::1]'].map((ip) => Object.assign(new URL(pathname, origin), { hostname: ip }).href)),
25
14
  token_endpoint_auth_method: 'none',
26
15
  application_type: 'native',
27
16
  dpop_bound_access_tokens: true,
28
17
  };
29
18
  }
30
- exports.atprotoLoopbackClientMetadata = atprotoLoopbackClientMetadata;
31
19
  //# sourceMappingURL=atproto-loopback-client-metadata.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"atproto-loopback-client-metadata.js","sourceRoot":"","sources":["../src/atproto-loopback-client-metadata.ts"],"names":[],"mappings":";;;AAAA,+EAAuE;AAEvE,qEAAgE;AAEhE,SAAgB,6BAA6B,CAC3C,QAAgB;IAEhB,IAAI,CAAC,IAAA,qDAAuB,EAAC,QAAQ,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,SAAS,CAAC,8BAA8B,QAAQ,EAAE,CAAC,CAAA;IAC/D,CAAC;IAED,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAA,8CAAqB,EAAC,QAAQ,CAAC,CAAA;IAE1E,KAAK,MAAM,IAAI,IAAI,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC;QACvC,IAAI,IAAI,KAAK,cAAc,EAAE,CAAC;YAC5B,MAAM,IAAI,SAAS,CAAC,2BAA2B,IAAI,eAAe,CAAC,CAAA;QACrE,CAAC;IACH,CAAC;IACD,MAAM,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC,CAAA;IAExD,OAAO;QACL,SAAS,EAAE,QAAQ;QACnB,WAAW,EAAE,iBAAiB;QAC9B,cAAc,EAAE,CAAC,MAAM,CAAC;QACxB,WAAW,EAAE,CAAC,oBAAoB,EAAE,eAAe,CAAC;QACpD,aAAa,EAAE,CAAC,YAAY,CAAC,MAAM;YACjC,CAAC,CAAC,YAAY;YACd,CAAC,CAAE,CAAC,WAAW,EAAE,OAAO,CAAW,CAAC,GAAG,CACnC,CAAC,EAAE,EAAE,EAAE,CACL,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAClE,CAA0B;QAC/B,0BAA0B,EAAE,MAAM;QAClC,gBAAgB,EAAE,QAAQ;QAC1B,wBAAwB,EAAE,IAAI;KAC/B,CAAA;AACH,CAAC;AA/BD,sEA+BC"}
1
+ {"version":3,"file":"atproto-loopback-client-metadata.js","sourceRoot":"","sources":["../src/atproto-loopback-client-metadata.ts"],"names":[],"mappings":";;AAGA,sEAmBC;AAtBD,+EAA0E;AAG1E,SAAgB,6BAA6B,CAC3C,QAAgB;IAEhB,MAAM,EACJ,KAAK,GAAG,SAAS,EACjB,aAAa,GAAG,CAAC,mBAAmB,EAAE,eAAe,CAAC,GACvD,GAAG,IAAA,wDAA0B,EAAC,QAAQ,CAAC,CAAA;IAExC,OAAO;QACL,SAAS,EAAE,QAAQ;QACnB,KAAK;QACL,aAAa;QACb,WAAW,EAAE,iBAAiB;QAC9B,cAAc,EAAE,CAAC,MAAM,CAAC;QACxB,WAAW,EAAE,CAAC,oBAAoB,EAAE,eAAe,CAAC;QACpD,0BAA0B,EAAE,MAAM;QAClC,gBAAgB,EAAE,QAAQ;QAC1B,wBAAwB,EAAE,IAAI;KAC/B,CAAA;AACH,CAAC"}
@@ -1,8 +1,2 @@
1
- /**
2
- * A variable that allows to determine if unsecure origins should be allowed
3
- * in OAuth related URI's. This variable is only set to `true` when NODE_ENV
4
- * is either `development` or `test`.
5
- */
6
- export declare const ALLOW_UNSECURE_ORIGINS: boolean;
7
1
  export declare const CLIENT_ASSERTION_TYPE_JWT_BEARER = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
8
2
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,SAS/B,CAAA;AAEJ,eAAO,MAAM,gCAAgC,2DACa,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gCAAgC,2DACa,CAAA"}
package/dist/constants.js CHANGED
@@ -1,21 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CLIENT_ASSERTION_TYPE_JWT_BEARER = exports.ALLOW_UNSECURE_ORIGINS = void 0;
4
- /**
5
- * A variable that allows to determine if unsecure origins should be allowed
6
- * in OAuth related URI's. This variable is only set to `true` when NODE_ENV
7
- * is either `development` or `test`.
8
- */
9
- exports.ALLOW_UNSECURE_ORIGINS = (() => {
10
- // try/catch to support running in a browser, including when process.env is
11
- // shimmed (e.g. by webpack)
12
- try {
13
- const env = process.env.NODE_ENV;
14
- return env === 'development' || env === 'test';
15
- }
16
- catch {
17
- return false;
18
- }
19
- })();
3
+ exports.CLIENT_ASSERTION_TYPE_JWT_BEARER = void 0;
20
4
  exports.CLIENT_ASSERTION_TYPE_JWT_BEARER = 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer';
21
5
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,sBAAsB,GAAG,CAAC,GAAG,EAAE;IAC1C,2EAA2E;IAC3E,4BAA4B;IAC5B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAA;QAChC,OAAO,GAAG,KAAK,aAAa,IAAI,GAAG,KAAK,MAAM,CAAA;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC,CAAC,EAAE,CAAA;AAES,QAAA,gCAAgC,GAC3C,wDAAwD,CAAA"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,gCAAgC,GAC3C,wDAAwD,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,24 +1,37 @@
1
1
  export * from './constants.js';
2
2
  export * from './util.js';
3
- export * from './access-token.js';
4
3
  export * from './atproto-loopback-client-metadata.js';
5
- export * from './oauth-client-id-discoverable.js';
6
- export * from './oauth-client-id-loopback.js';
7
- export * from './oauth-authentication-request-parameters.js';
4
+ export * from './oauth-access-token.js';
5
+ export * from './oauth-authorization-code-grant-token-request.js';
8
6
  export * from './oauth-authorization-details.js';
7
+ export * from './oauth-authorization-request-jar.js';
8
+ export * from './oauth-authorization-request-par.js';
9
+ export * from './oauth-authorization-request-parameters.js';
10
+ export * from './oauth-authorization-request-query.js';
11
+ export * from './oauth-authorization-request-uri.js';
9
12
  export * from './oauth-authorization-server-metadata.js';
13
+ export * from './oauth-client-credentials-grant-token-request.js';
10
14
  export * from './oauth-client-credentials.js';
15
+ export * from './oauth-client-id-discoverable.js';
16
+ export * from './oauth-client-id-loopback.js';
11
17
  export * from './oauth-client-id.js';
12
- export * from './oauth-client-identification.js';
13
18
  export * from './oauth-client-metadata.js';
14
19
  export * from './oauth-endpoint-auth-method.js';
15
20
  export * from './oauth-endpoint-name.js';
16
21
  export * from './oauth-grant-type.js';
22
+ export * from './oauth-introspection-response.js';
17
23
  export * from './oauth-issuer-identifier.js';
18
24
  export * from './oauth-par-response.js';
25
+ export * from './oauth-password-grant-token-request.js';
19
26
  export * from './oauth-protected-resource-metadata.js';
27
+ export * from './oauth-refresh-token-grant-token-request.js';
28
+ export * from './oauth-refresh-token.js';
29
+ export * from './oauth-request-uri.js';
20
30
  export * from './oauth-response-mode.js';
21
31
  export * from './oauth-response-type.js';
32
+ export * from './oauth-scope.js';
33
+ export * from './oauth-token-identification.js';
34
+ export * from './oauth-token-request.js';
22
35
  export * from './oauth-token-response.js';
23
36
  export * from './oauth-token-type.js';
24
37
  export * from './oidc-claims-parameter.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AAEzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,uCAAuC,CAAA;AACrD,cAAc,mCAAmC,CAAA;AACjD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,8CAA8C,CAAA;AAC5D,cAAc,kCAAkC,CAAA;AAChD,cAAc,0CAA0C,CAAA;AACxD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sBAAsB,CAAA;AACpC,cAAc,kCAAkC,CAAA;AAChD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,wCAAwC,CAAA;AACtD,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uBAAuB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AAEzB,cAAc,uCAAuC,CAAA;AACrD,cAAc,yBAAyB,CAAA;AACvC,cAAc,mDAAmD,CAAA;AACjE,cAAc,kCAAkC,CAAA;AAChD,cAAc,sCAAsC,CAAA;AACpD,cAAc,sCAAsC,CAAA;AACpD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,wCAAwC,CAAA;AACtD,cAAc,sCAAsC,CAAA;AACpD,cAAc,0CAA0C,CAAA;AACxD,cAAc,mDAAmD,CAAA;AACjE,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mCAAmC,CAAA;AACjD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sBAAsB,CAAA;AACpC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,mCAAmC,CAAA;AACjD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,yCAAyC,CAAA;AACvD,cAAc,wCAAwC,CAAA;AACtD,cAAc,8CAA8C,CAAA;AAC5D,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,kBAAkB,CAAA;AAChC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uBAAuB,CAAA"}
package/dist/index.js CHANGED
@@ -16,25 +16,38 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./constants.js"), exports);
18
18
  __exportStar(require("./util.js"), exports);
19
- __exportStar(require("./access-token.js"), exports);
20
19
  __exportStar(require("./atproto-loopback-client-metadata.js"), exports);
21
- __exportStar(require("./oauth-client-id-discoverable.js"), exports);
22
- __exportStar(require("./oauth-client-id-loopback.js"), exports);
23
- __exportStar(require("./oauth-authentication-request-parameters.js"), exports);
20
+ __exportStar(require("./oauth-access-token.js"), exports);
21
+ __exportStar(require("./oauth-authorization-code-grant-token-request.js"), exports);
24
22
  __exportStar(require("./oauth-authorization-details.js"), exports);
23
+ __exportStar(require("./oauth-authorization-request-jar.js"), exports);
24
+ __exportStar(require("./oauth-authorization-request-par.js"), exports);
25
+ __exportStar(require("./oauth-authorization-request-parameters.js"), exports);
26
+ __exportStar(require("./oauth-authorization-request-query.js"), exports);
27
+ __exportStar(require("./oauth-authorization-request-uri.js"), exports);
25
28
  __exportStar(require("./oauth-authorization-server-metadata.js"), exports);
29
+ __exportStar(require("./oauth-client-credentials-grant-token-request.js"), exports);
26
30
  __exportStar(require("./oauth-client-credentials.js"), exports);
31
+ __exportStar(require("./oauth-client-id-discoverable.js"), exports);
32
+ __exportStar(require("./oauth-client-id-loopback.js"), exports);
27
33
  __exportStar(require("./oauth-client-id.js"), exports);
28
- __exportStar(require("./oauth-client-identification.js"), exports);
29
34
  __exportStar(require("./oauth-client-metadata.js"), exports);
30
35
  __exportStar(require("./oauth-endpoint-auth-method.js"), exports);
31
36
  __exportStar(require("./oauth-endpoint-name.js"), exports);
32
37
  __exportStar(require("./oauth-grant-type.js"), exports);
38
+ __exportStar(require("./oauth-introspection-response.js"), exports);
33
39
  __exportStar(require("./oauth-issuer-identifier.js"), exports);
34
40
  __exportStar(require("./oauth-par-response.js"), exports);
41
+ __exportStar(require("./oauth-password-grant-token-request.js"), exports);
35
42
  __exportStar(require("./oauth-protected-resource-metadata.js"), exports);
43
+ __exportStar(require("./oauth-refresh-token-grant-token-request.js"), exports);
44
+ __exportStar(require("./oauth-refresh-token.js"), exports);
45
+ __exportStar(require("./oauth-request-uri.js"), exports);
36
46
  __exportStar(require("./oauth-response-mode.js"), exports);
37
47
  __exportStar(require("./oauth-response-type.js"), exports);
48
+ __exportStar(require("./oauth-scope.js"), exports);
49
+ __exportStar(require("./oauth-token-identification.js"), exports);
50
+ __exportStar(require("./oauth-token-request.js"), exports);
38
51
  __exportStar(require("./oauth-token-response.js"), exports);
39
52
  __exportStar(require("./oauth-token-type.js"), exports);
40
53
  __exportStar(require("./oidc-claims-parameter.js"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,4CAAyB;AAEzB,oDAAiC;AACjC,wEAAqD;AACrD,oEAAiD;AACjD,gEAA6C;AAC7C,+EAA4D;AAC5D,mEAAgD;AAChD,2EAAwD;AACxD,gEAA6C;AAC7C,uDAAoC;AACpC,mEAAgD;AAChD,6DAA0C;AAC1C,kEAA+C;AAC/C,2DAAwC;AACxC,wDAAqC;AACrC,+DAA4C;AAC5C,0DAAuC;AACvC,yEAAsD;AACtD,2DAAwC;AACxC,2DAAwC;AACxC,4DAAyC;AACzC,wDAAqC;AACrC,6DAA0C;AAC1C,8DAA2C;AAC3C,wDAAqC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,4CAAyB;AAEzB,wEAAqD;AACrD,0DAAuC;AACvC,oFAAiE;AACjE,mEAAgD;AAChD,uEAAoD;AACpD,uEAAoD;AACpD,8EAA2D;AAC3D,yEAAsD;AACtD,uEAAoD;AACpD,2EAAwD;AACxD,oFAAiE;AACjE,gEAA6C;AAC7C,oEAAiD;AACjD,gEAA6C;AAC7C,uDAAoC;AACpC,6DAA0C;AAC1C,kEAA+C;AAC/C,2DAAwC;AACxC,wDAAqC;AACrC,oEAAiD;AACjD,+DAA4C;AAC5C,0DAAuC;AACvC,0EAAuD;AACvD,yEAAsD;AACtD,+EAA4D;AAC5D,2DAAwC;AACxC,yDAAsC;AACtC,2DAAwC;AACxC,2DAAwC;AACxC,mDAAgC;AAChC,kEAA+C;AAC/C,2DAAwC;AACxC,4DAAyC;AACzC,wDAAqC;AACrC,6DAA0C;AAC1C,8DAA2C;AAC3C,wDAAqC"}
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ export declare const oauthAccessTokenSchema: z.ZodString;
3
+ export type OAuthAccessToken = z.infer<typeof oauthAccessTokenSchema>;
4
+ //# sourceMappingURL=oauth-access-token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-access-token.d.ts","sourceRoot":"","sources":["../src/oauth-access-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,sBAAsB,aAAoB,CAAA;AACvD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oauthAccessTokenSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.oauthAccessTokenSchema = zod_1.z.string().min(1);
6
+ //# sourceMappingURL=oauth-access-token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-access-token.js","sourceRoot":"","sources":["../src/oauth-access-token.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ export declare const oauthAuthorizationCodeGrantTokenRequestSchema: z.ZodObject<{
3
+ grant_type: z.ZodLiteral<"authorization_code">;
4
+ code: z.ZodString;
5
+ redirect_uri: z.ZodString;
6
+ /** @see {@link https://datatracker.ietf.org/doc/html/rfc7636#section-4.1} */
7
+ code_verifier: z.ZodOptional<z.ZodString>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ code: string;
10
+ redirect_uri: string;
11
+ grant_type: "authorization_code";
12
+ code_verifier?: string | undefined;
13
+ }, {
14
+ code: string;
15
+ redirect_uri: string;
16
+ grant_type: "authorization_code";
17
+ code_verifier?: string | undefined;
18
+ }>;
19
+ export type OAuthAuthorizationCodeGrantTokenRequest = z.infer<typeof oauthAuthorizationCodeGrantTokenRequestSchema>;
20
+ //# sourceMappingURL=oauth-authorization-code-grant-token-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-authorization-code-grant-token-request.d.ts","sourceRoot":"","sources":["../src/oauth-authorization-code-grant-token-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,6CAA6C;;;;IAIxD,6EAA6E;;;;;;;;;;;;EAO7E,CAAA;AAEF,MAAM,MAAM,uCAAuC,GAAG,CAAC,CAAC,KAAK,CAC3D,OAAO,6CAA6C,CACrD,CAAA"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oauthAuthorizationCodeGrantTokenRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.oauthAuthorizationCodeGrantTokenRequestSchema = zod_1.z.object({
6
+ grant_type: zod_1.z.literal('authorization_code'),
7
+ code: zod_1.z.string().min(1),
8
+ redirect_uri: zod_1.z.string().url(),
9
+ /** @see {@link https://datatracker.ietf.org/doc/html/rfc7636#section-4.1} */
10
+ code_verifier: zod_1.z
11
+ .string()
12
+ .min(43)
13
+ .max(128)
14
+ .regex(/^[a-zA-Z0-9-._~]+$/)
15
+ .optional(),
16
+ });
17
+ //# sourceMappingURL=oauth-authorization-code-grant-token-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-authorization-code-grant-token-request.js","sourceRoot":"","sources":["../src/oauth-authorization-code-grant-token-request.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,6CAA6C,GAAG,OAAC,CAAC,MAAM,CAAC;IACpE,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC3C,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC9B,6EAA6E;IAC7E,aAAa,EAAE,OAAC;SACb,MAAM,EAAE;SACR,GAAG,CAAC,EAAE,CAAC;SACP,GAAG,CAAC,GAAG,CAAC;SACR,KAAK,CAAC,oBAAoB,CAAC;SAC3B,QAAQ,EAAE;CACd,CAAC,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ export declare const oauthAuthorizationRequestJarSchema: z.ZodObject<{
3
+ /**
4
+ * AuthorizationRequest inside a JWT:
5
+ * - "iat" is required and **MUST** be less than one minute
6
+ *
7
+ * @see {@link https://datatracker.ietf.org/doc/html/rfc9101}
8
+ */
9
+ request: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>, z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}`, string>]>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ request: `${string}.${string}.${string}` | `${string}.${string}`;
12
+ }, {
13
+ request: string;
14
+ }>;
15
+ export type OAuthAuthorizationRequestJar = z.infer<typeof oauthAuthorizationRequestJarSchema>;
16
+ //# sourceMappingURL=oauth-authorization-request-jar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-authorization-request-jar.d.ts","sourceRoot":"","sources":["../src/oauth-authorization-request-jar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,kCAAkC;IAC7C;;;;;OAKG;;;;;;EAEH,CAAA;AAEF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,kCAAkC,CAC1C,CAAA"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oauthAuthorizationRequestJarSchema = void 0;
4
+ const jwk_1 = require("@atproto/jwk");
5
+ const zod_1 = require("zod");
6
+ exports.oauthAuthorizationRequestJarSchema = zod_1.z.object({
7
+ /**
8
+ * AuthorizationRequest inside a JWT:
9
+ * - "iat" is required and **MUST** be less than one minute
10
+ *
11
+ * @see {@link https://datatracker.ietf.org/doc/html/rfc9101}
12
+ */
13
+ request: zod_1.z.union([jwk_1.signedJwtSchema, jwk_1.unsignedJwtSchema]),
14
+ });
15
+ //# sourceMappingURL=oauth-authorization-request-jar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-authorization-request-jar.js","sourceRoot":"","sources":["../src/oauth-authorization-request-jar.ts"],"names":[],"mappings":";;;AAAA,sCAAiE;AACjE,6BAAuB;AAEV,QAAA,kCAAkC,GAAG,OAAC,CAAC,MAAM,CAAC;IACzD;;;;;OAKG;IACH,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,qBAAe,EAAE,uBAAiB,CAAC,CAAC;CACvD,CAAC,CAAA"}
@@ -0,0 +1,122 @@
1
+ import { z } from 'zod';
2
+ export declare const oauthAuthorizationRequestParSchema: z.ZodUnion<[z.ZodObject<{
3
+ client_id: z.ZodString;
4
+ state: z.ZodOptional<z.ZodString>;
5
+ redirect_uri: z.ZodOptional<z.ZodString>;
6
+ scope: z.ZodOptional<z.ZodString>;
7
+ response_type: z.ZodEnum<["code", "token", "none", "code id_token token", "code id_token", "code token", "id_token token", "id_token"]>;
8
+ code_challenge: z.ZodOptional<z.ZodString>;
9
+ code_challenge_method: z.ZodOptional<z.ZodDefault<z.ZodEnum<["S256", "plain"]>>>;
10
+ dpop_jkt: z.ZodOptional<z.ZodString>;
11
+ response_mode: z.ZodOptional<z.ZodEnum<["query", "fragment", "form_post"]>>;
12
+ nonce: z.ZodOptional<z.ZodString>;
13
+ max_age: z.ZodOptional<z.ZodNumber>;
14
+ claims: z.ZodOptional<z.ZodRecord<z.ZodEnum<["userinfo", "id_token"]>, z.ZodRecord<z.ZodEnum<["auth_time", "nonce", "acr", "name", "family_name", "given_name", "middle_name", "nickname", "preferred_username", "gender", "picture", "profile", "website", "birthdate", "zoneinfo", "locale", "updated_at", "email", "email_verified", "phone_number", "phone_number_verified", "address"]>, z.ZodUnion<[z.ZodLiteral<null>, z.ZodObject<{
15
+ essential: z.ZodOptional<z.ZodBoolean>;
16
+ value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
17
+ values: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ values?: (string | number | boolean)[] | undefined;
20
+ value?: string | number | boolean | undefined;
21
+ essential?: boolean | undefined;
22
+ }, {
23
+ values?: (string | number | boolean)[] | undefined;
24
+ value?: string | number | boolean | undefined;
25
+ essential?: boolean | undefined;
26
+ }>]>>>>;
27
+ login_hint: z.ZodOptional<z.ZodString>;
28
+ ui_locales: z.ZodOptional<z.ZodString>;
29
+ id_token_hint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>>;
30
+ display: z.ZodOptional<z.ZodEnum<["page", "popup", "touch", "wap"]>>;
31
+ prompt: z.ZodOptional<z.ZodEnum<["none", "login", "consent", "select_account"]>>;
32
+ authorization_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
33
+ type: z.ZodString;
34
+ locations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
35
+ actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
36
+ datatypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
37
+ identifier: z.ZodOptional<z.ZodString>;
38
+ privileges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ type: string;
41
+ locations?: string[] | undefined;
42
+ actions?: string[] | undefined;
43
+ datatypes?: string[] | undefined;
44
+ identifier?: string | undefined;
45
+ privileges?: string[] | undefined;
46
+ }, {
47
+ type: string;
48
+ locations?: string[] | undefined;
49
+ actions?: string[] | undefined;
50
+ datatypes?: string[] | undefined;
51
+ identifier?: string | undefined;
52
+ privileges?: string[] | undefined;
53
+ }>, "many">>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ client_id: string;
56
+ response_type: "code" | "none" | "token" | "code id_token token" | "code id_token" | "code token" | "id_token token" | "id_token";
57
+ redirect_uri?: string | undefined;
58
+ scope?: string | undefined;
59
+ nonce?: string | undefined;
60
+ state?: string | undefined;
61
+ code_challenge?: string | undefined;
62
+ code_challenge_method?: "S256" | "plain" | undefined;
63
+ dpop_jkt?: string | undefined;
64
+ response_mode?: "query" | "fragment" | "form_post" | undefined;
65
+ max_age?: number | undefined;
66
+ claims?: Partial<Record<"id_token" | "userinfo", Partial<Record<"auth_time" | "nonce" | "acr" | "name" | "family_name" | "given_name" | "middle_name" | "nickname" | "preferred_username" | "gender" | "picture" | "profile" | "website" | "birthdate" | "zoneinfo" | "locale" | "updated_at" | "email" | "email_verified" | "phone_number" | "phone_number_verified" | "address", {
67
+ values?: (string | number | boolean)[] | undefined;
68
+ value?: string | number | boolean | undefined;
69
+ essential?: boolean | undefined;
70
+ } | null>>>> | undefined;
71
+ login_hint?: string | undefined;
72
+ ui_locales?: string | undefined;
73
+ id_token_hint?: `${string}.${string}.${string}` | undefined;
74
+ display?: "page" | "popup" | "touch" | "wap" | undefined;
75
+ prompt?: "none" | "login" | "consent" | "select_account" | undefined;
76
+ authorization_details?: {
77
+ type: string;
78
+ locations?: string[] | undefined;
79
+ actions?: string[] | undefined;
80
+ datatypes?: string[] | undefined;
81
+ identifier?: string | undefined;
82
+ privileges?: string[] | undefined;
83
+ }[] | undefined;
84
+ }, {
85
+ client_id: string;
86
+ response_type: "code" | "none" | "token" | "code id_token token" | "code id_token" | "code token" | "id_token token" | "id_token";
87
+ redirect_uri?: string | undefined;
88
+ scope?: string | undefined;
89
+ nonce?: string | undefined;
90
+ state?: string | undefined;
91
+ code_challenge?: string | undefined;
92
+ code_challenge_method?: "S256" | "plain" | undefined;
93
+ dpop_jkt?: string | undefined;
94
+ response_mode?: "query" | "fragment" | "form_post" | undefined;
95
+ max_age?: number | undefined;
96
+ claims?: Partial<Record<"id_token" | "userinfo", Partial<Record<"auth_time" | "nonce" | "acr" | "name" | "family_name" | "given_name" | "middle_name" | "nickname" | "preferred_username" | "gender" | "picture" | "profile" | "website" | "birthdate" | "zoneinfo" | "locale" | "updated_at" | "email" | "email_verified" | "phone_number" | "phone_number_verified" | "address", {
97
+ values?: (string | number | boolean)[] | undefined;
98
+ value?: string | number | boolean | undefined;
99
+ essential?: boolean | undefined;
100
+ } | null>>>> | undefined;
101
+ login_hint?: string | undefined;
102
+ ui_locales?: string | undefined;
103
+ id_token_hint?: string | undefined;
104
+ display?: "page" | "popup" | "touch" | "wap" | undefined;
105
+ prompt?: "none" | "login" | "consent" | "select_account" | undefined;
106
+ authorization_details?: {
107
+ type: string;
108
+ locations?: string[] | undefined;
109
+ actions?: string[] | undefined;
110
+ datatypes?: string[] | undefined;
111
+ identifier?: string | undefined;
112
+ privileges?: string[] | undefined;
113
+ }[] | undefined;
114
+ }>, z.ZodObject<{
115
+ request: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>, z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}`, string>]>;
116
+ }, "strip", z.ZodTypeAny, {
117
+ request: `${string}.${string}.${string}` | `${string}.${string}`;
118
+ }, {
119
+ request: string;
120
+ }>]>;
121
+ export type OAuthAuthorizationRequestPar = z.infer<typeof oauthAuthorizationRequestParSchema>;
122
+ //# sourceMappingURL=oauth-authorization-request-par.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-authorization-request-par.d.ts","sourceRoot":"","sources":["../src/oauth-authorization-request-par.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAG7C,CAAA;AAEF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,kCAAkC,CAC1C,CAAA"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oauthAuthorizationRequestParSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const oauth_authorization_request_jar_js_1 = require("./oauth-authorization-request-jar.js");
6
+ const oauth_authorization_request_parameters_js_1 = require("./oauth-authorization-request-parameters.js");
7
+ exports.oauthAuthorizationRequestParSchema = zod_1.z.union([
8
+ oauth_authorization_request_parameters_js_1.oauthAuthorizationRequestParametersSchema,
9
+ oauth_authorization_request_jar_js_1.oauthAuthorizationRequestJarSchema,
10
+ ]);
11
+ //# sourceMappingURL=oauth-authorization-request-par.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-authorization-request-par.js","sourceRoot":"","sources":["../src/oauth-authorization-request-par.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEvB,6FAAyF;AACzF,2GAAuG;AAE1F,QAAA,kCAAkC,GAAG,OAAC,CAAC,KAAK,CAAC;IACxD,qFAAyC;IACzC,uEAAkC;CACnC,CAAC,CAAA"}
@@ -2,17 +2,17 @@ import { z } from 'zod';
2
2
  /**
3
3
  * @see {@link https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest | OIDC}
4
4
  */
5
- export declare const oauthAuthenticationRequestParametersSchema: z.ZodObject<{
5
+ export declare const oauthAuthorizationRequestParametersSchema: z.ZodObject<{
6
6
  client_id: z.ZodString;
7
7
  state: z.ZodOptional<z.ZodString>;
8
- nonce: z.ZodOptional<z.ZodString>;
9
- dpop_jkt: z.ZodOptional<z.ZodString>;
8
+ redirect_uri: z.ZodOptional<z.ZodString>;
9
+ scope: z.ZodOptional<z.ZodString>;
10
10
  response_type: z.ZodEnum<["code", "token", "none", "code id_token token", "code id_token", "code token", "id_token token", "id_token"]>;
11
- response_mode: z.ZodOptional<z.ZodEnum<["query", "fragment", "form_post"]>>;
12
11
  code_challenge: z.ZodOptional<z.ZodString>;
13
12
  code_challenge_method: z.ZodOptional<z.ZodDefault<z.ZodEnum<["S256", "plain"]>>>;
14
- redirect_uri: z.ZodOptional<z.ZodString>;
15
- scope: z.ZodOptional<z.ZodString>;
13
+ dpop_jkt: z.ZodOptional<z.ZodString>;
14
+ response_mode: z.ZodOptional<z.ZodEnum<["query", "fragment", "form_post"]>>;
15
+ nonce: z.ZodOptional<z.ZodString>;
16
16
  max_age: z.ZodOptional<z.ZodNumber>;
17
17
  claims: z.ZodOptional<z.ZodRecord<z.ZodEnum<["userinfo", "id_token"]>, z.ZodRecord<z.ZodEnum<["auth_time", "nonce", "acr", "name", "family_name", "given_name", "middle_name", "nickname", "preferred_username", "gender", "picture", "profile", "website", "birthdate", "zoneinfo", "locale", "updated_at", "email", "email_verified", "phone_number", "phone_number_verified", "address"]>, z.ZodUnion<[z.ZodLiteral<null>, z.ZodObject<{
18
18
  essential: z.ZodOptional<z.ZodBoolean>;
@@ -30,7 +30,7 @@ export declare const oauthAuthenticationRequestParametersSchema: z.ZodObject<{
30
30
  login_hint: z.ZodOptional<z.ZodString>;
31
31
  ui_locales: z.ZodOptional<z.ZodString>;
32
32
  id_token_hint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>>;
33
- display: z.ZodOptional<z.ZodEnum<["page", "popup", "touch"]>>;
33
+ display: z.ZodOptional<z.ZodEnum<["page", "popup", "touch", "wap"]>>;
34
34
  /**
35
35
  * - "none" will only be allowed if the user already allowed the client on the same device
36
36
  * - "login" will force the user to login again, unless he very recently logged in
@@ -63,14 +63,14 @@ export declare const oauthAuthenticationRequestParametersSchema: z.ZodObject<{
63
63
  }, "strip", z.ZodTypeAny, {
64
64
  client_id: string;
65
65
  response_type: "code" | "none" | "token" | "code id_token token" | "code id_token" | "code token" | "id_token token" | "id_token";
66
- scope?: string | undefined;
67
66
  redirect_uri?: string | undefined;
67
+ scope?: string | undefined;
68
68
  nonce?: string | undefined;
69
69
  state?: string | undefined;
70
- dpop_jkt?: string | undefined;
71
- response_mode?: "query" | "fragment" | "form_post" | undefined;
72
70
  code_challenge?: string | undefined;
73
71
  code_challenge_method?: "S256" | "plain" | undefined;
72
+ dpop_jkt?: string | undefined;
73
+ response_mode?: "query" | "fragment" | "form_post" | undefined;
74
74
  max_age?: number | undefined;
75
75
  claims?: Partial<Record<"id_token" | "userinfo", Partial<Record<"auth_time" | "nonce" | "acr" | "name" | "family_name" | "given_name" | "middle_name" | "nickname" | "preferred_username" | "gender" | "picture" | "profile" | "website" | "birthdate" | "zoneinfo" | "locale" | "updated_at" | "email" | "email_verified" | "phone_number" | "phone_number_verified" | "address", {
76
76
  values?: (string | number | boolean)[] | undefined;
@@ -80,7 +80,7 @@ export declare const oauthAuthenticationRequestParametersSchema: z.ZodObject<{
80
80
  login_hint?: string | undefined;
81
81
  ui_locales?: string | undefined;
82
82
  id_token_hint?: `${string}.${string}.${string}` | undefined;
83
- display?: "page" | "popup" | "touch" | undefined;
83
+ display?: "page" | "popup" | "touch" | "wap" | undefined;
84
84
  prompt?: "none" | "login" | "consent" | "select_account" | undefined;
85
85
  authorization_details?: {
86
86
  type: string;
@@ -93,14 +93,14 @@ export declare const oauthAuthenticationRequestParametersSchema: z.ZodObject<{
93
93
  }, {
94
94
  client_id: string;
95
95
  response_type: "code" | "none" | "token" | "code id_token token" | "code id_token" | "code token" | "id_token token" | "id_token";
96
- scope?: string | undefined;
97
96
  redirect_uri?: string | undefined;
97
+ scope?: string | undefined;
98
98
  nonce?: string | undefined;
99
99
  state?: string | undefined;
100
- dpop_jkt?: string | undefined;
101
- response_mode?: "query" | "fragment" | "form_post" | undefined;
102
100
  code_challenge?: string | undefined;
103
101
  code_challenge_method?: "S256" | "plain" | undefined;
102
+ dpop_jkt?: string | undefined;
103
+ response_mode?: "query" | "fragment" | "form_post" | undefined;
104
104
  max_age?: number | undefined;
105
105
  claims?: Partial<Record<"id_token" | "userinfo", Partial<Record<"auth_time" | "nonce" | "acr" | "name" | "family_name" | "given_name" | "middle_name" | "nickname" | "preferred_username" | "gender" | "picture" | "profile" | "website" | "birthdate" | "zoneinfo" | "locale" | "updated_at" | "email" | "email_verified" | "phone_number" | "phone_number_verified" | "address", {
106
106
  values?: (string | number | boolean)[] | undefined;
@@ -110,7 +110,7 @@ export declare const oauthAuthenticationRequestParametersSchema: z.ZodObject<{
110
110
  login_hint?: string | undefined;
111
111
  ui_locales?: string | undefined;
112
112
  id_token_hint?: string | undefined;
113
- display?: "page" | "popup" | "touch" | undefined;
113
+ display?: "page" | "popup" | "touch" | "wap" | undefined;
114
114
  prompt?: "none" | "login" | "consent" | "select_account" | undefined;
115
115
  authorization_details?: {
116
116
  type: string;
@@ -122,7 +122,7 @@ export declare const oauthAuthenticationRequestParametersSchema: z.ZodObject<{
122
122
  }[] | undefined;
123
123
  }>;
124
124
  /**
125
- * @see {oauthAuthenticationRequestParametersSchema}
125
+ * @see {oauthAuthorizationRequestParametersSchema}
126
126
  */
127
- export type OAuthAuthenticationRequestParameters = z.infer<typeof oauthAuthenticationRequestParametersSchema>;
128
- //# sourceMappingURL=oauth-authentication-request-parameters.d.ts.map
127
+ export type OAuthAuthorizationRequestParameters = z.infer<typeof oauthAuthorizationRequestParametersSchema>;
128
+ //# sourceMappingURL=oauth-authorization-request-parameters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-authorization-request-parameters.d.ts","sourceRoot":"","sources":["../src/oauth-authorization-request-parameters.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAWvB;;GAEG;AACH,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8DpD;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKH,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,yCAAyC,CACjD,CAAA"}