@atproto/oauth-types 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/atproto-loopback-client-metadata.d.ts.map +1 -1
  3. package/dist/atproto-loopback-client-metadata.js +3 -14
  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} +15 -15
  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} +15 -16
  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-scope.d.ts +10 -0
  90. package/dist/oauth-scope.d.ts.map +1 -0
  91. package/dist/oauth-scope.js +16 -0
  92. package/dist/oauth-scope.js.map +1 -0
  93. package/dist/oauth-token-identification.d.ts +13 -0
  94. package/dist/oauth-token-identification.d.ts.map +1 -0
  95. package/dist/oauth-token-identification.js +11 -0
  96. package/dist/oauth-token-identification.js.map +1 -0
  97. package/dist/oauth-token-request.d.ts +49 -0
  98. package/dist/oauth-token-request.d.ts.map +1 -0
  99. package/dist/oauth-token-request.js +15 -0
  100. package/dist/oauth-token-request.js.map +1 -0
  101. package/dist/util.d.ts +2 -1
  102. package/dist/util.d.ts.map +1 -1
  103. package/dist/util.js +34 -3
  104. package/dist/util.js.map +1 -1
  105. package/package.json +1 -1
  106. package/src/atproto-loopback-client-metadata.ts +7 -20
  107. package/src/index.ts +18 -5
  108. package/src/oauth-access-token.ts +4 -0
  109. package/src/oauth-authorization-code-grant-token-request.ts +18 -0
  110. package/src/oauth-authorization-request-jar.ts +16 -0
  111. package/src/oauth-authorization-request-par.ts +13 -0
  112. package/src/{oauth-authentication-request-parameters.ts → oauth-authorization-request-parameters.ts} +20 -21
  113. package/src/oauth-authorization-request-query.ts +15 -0
  114. package/src/oauth-authorization-request-uri.ts +11 -0
  115. package/src/oauth-authorization-server-metadata.ts +5 -1
  116. package/src/oauth-client-credentials-grant-token-request.ts +9 -0
  117. package/src/oauth-client-credentials.ts +21 -1
  118. package/src/oauth-client-id-discoverable.ts +29 -26
  119. package/src/oauth-client-id-loopback.ts +78 -30
  120. package/src/oauth-client-metadata.ts +2 -1
  121. package/src/oauth-code-challenge-method.ts +3 -0
  122. package/src/oauth-introspection-response.ts +23 -0
  123. package/src/oauth-par-response.ts +1 -0
  124. package/src/oauth-password-grant-token-request.ts +11 -0
  125. package/src/oauth-refresh-token-grant-token-request.ts +13 -0
  126. package/src/oauth-refresh-token.ts +4 -0
  127. package/src/oauth-request-uri.ts +5 -0
  128. package/src/oauth-scope.ts +15 -0
  129. package/src/oauth-token-identification.ts +12 -0
  130. package/src/oauth-token-request.ts +14 -0
  131. package/src/util.ts +41 -1
  132. package/dist/access-token.d.ts +0 -4
  133. package/dist/access-token.d.ts.map +0 -1
  134. package/dist/access-token.js +0 -6
  135. package/dist/access-token.js.map +0 -1
  136. package/dist/oauth-authentication-request-parameters.d.ts.map +0 -1
  137. package/dist/oauth-authentication-request-parameters.js.map +0 -1
  138. package/dist/oauth-client-id-url.d.ts +0 -3
  139. package/dist/oauth-client-id-url.d.ts.map +0 -1
  140. package/dist/oauth-client-id-url.js +0 -21
  141. package/dist/oauth-client-id-url.js.map +0 -1
  142. package/dist/oauth-client-identification.d.ts +0 -31
  143. package/dist/oauth-client-identification.d.ts.map +0 -1
  144. package/dist/oauth-client-identification.js +0 -12
  145. package/dist/oauth-client-identification.js.map +0 -1
  146. package/src/access-token.ts +0 -4
  147. package/src/oauth-client-id-url.ts +0 -25
  148. package/src/oauth-client-identification.ts +0 -14
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @atproto/oauth-types
2
2
 
3
+ ## 0.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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
8
+
9
+ - [#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
10
+
11
+ - [#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
12
+
13
+ - [#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
14
+
15
+ - [#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
16
+
17
+ - [#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
18
+
19
+ - [#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
20
+
21
+ - [#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
22
+
23
+ - [#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
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)! - Allow loopback clients to define their scopes through the "scope" client_id query parameter.
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)! - Improve error description in case of invalid loopback client_id
28
+
3
29
  ## 0.1.4
4
30
 
5
31
  ### 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"}
@@ -2,26 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.atprotoLoopbackClientMetadata = void 0;
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,
@@ -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":";;;AAAA,+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;AAnBD,sEAmBC"}
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"]>>;
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" | 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" | 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>;
@@ -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;
@@ -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;
@@ -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"}
@@ -1,38 +1,37 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.oauthAuthenticationRequestParametersSchema = void 0;
3
+ exports.oauthAuthorizationRequestParametersSchema = void 0;
4
4
  const jwk_1 = require("@atproto/jwk");
5
5
  const zod_1 = require("zod");
6
6
  const oauth_authorization_details_js_1 = require("./oauth-authorization-details.js");
7
7
  const oauth_client_id_js_1 = require("./oauth-client-id.js");
8
+ const oauth_code_challenge_method_js_1 = require("./oauth-code-challenge-method.js");
8
9
  const oauth_response_type_js_1 = require("./oauth-response-type.js");
10
+ const oauth_scope_js_1 = require("./oauth-scope.js");
9
11
  const oidc_claims_parameter_js_1 = require("./oidc-claims-parameter.js");
10
12
  const oidc_claims_properties_js_1 = require("./oidc-claims-properties.js");
11
13
  const oidc_entity_type_js_1 = require("./oidc-entity-type.js");
12
14
  /**
13
15
  * @see {@link https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest | OIDC}
14
16
  */
15
- exports.oauthAuthenticationRequestParametersSchema = zod_1.z.object({
17
+ exports.oauthAuthorizationRequestParametersSchema = zod_1.z.object({
16
18
  client_id: oauth_client_id_js_1.oauthClientIdSchema,
17
19
  state: zod_1.z.string().optional(),
18
- nonce: zod_1.z.string().optional(),
19
- dpop_jkt: zod_1.z.string().optional(),
20
+ redirect_uri: zod_1.z.string().url().optional(),
21
+ scope: oauth_scope_js_1.oauthScopeSchema.optional(),
20
22
  response_type: oauth_response_type_js_1.oauthResponseTypeSchema,
21
- // Default depend on response_type
22
- response_mode: zod_1.z.enum(['query', 'fragment', 'form_post']).optional(),
23
23
  // PKCE
24
24
  code_challenge: zod_1.z.string().optional(),
25
- code_challenge_method: zod_1.z.enum(['S256', 'plain']).default('S256').optional(),
26
- redirect_uri: zod_1.z.string().url().optional(),
27
- // https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-11#section-1.4.1
28
- // scope = scope-token *( SP scope-token )
29
- // scope-token = 1*( %x21 / %x23-5B / %x5D-7E )
30
- // = Basically most ASCII characters except backslash and double quote
31
- scope: zod_1.z
32
- .string()
33
- .regex(/^[!\x23-\x5B\x5D-\x7E]+( [!\x23-\x5B\x5D-\x7E]+)*$/)
25
+ code_challenge_method: oauth_code_challenge_method_js_1.oauthCodeChallengeMethodSchema
26
+ .default('S256')
34
27
  .optional(),
28
+ // DPOP
29
+ // https://datatracker.ietf.org/doc/html/rfc9449#section-12.3
30
+ dpop_jkt: zod_1.z.string().optional(),
35
31
  // OIDC
32
+ // Default depend on response_type
33
+ response_mode: zod_1.z.enum(['query', 'fragment', 'form_post']).optional(),
34
+ nonce: zod_1.z.string().optional(),
36
35
  // Specifies the allowable elapsed time in seconds since the last time the
37
36
  // End-User was actively authenticated by the OP. If the elapsed time is
38
37
  // greater than this value, the OP MUST attempt to actively re-authenticate
@@ -66,4 +65,4 @@ exports.oauthAuthenticationRequestParametersSchema = zod_1.z.object({
66
65
  // https://datatracker.ietf.org/doc/html/rfc9396
67
66
  authorization_details: oauth_authorization_details_js_1.oauthAuthorizationDetailsSchema.optional(),
68
67
  });
69
- //# sourceMappingURL=oauth-authentication-request-parameters.js.map
68
+ //# sourceMappingURL=oauth-authorization-request-parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-authorization-request-parameters.js","sourceRoot":"","sources":["../src/oauth-authorization-request-parameters.ts"],"names":[],"mappings":";;;AAAA,sCAA8C;AAC9C,6BAAuB;AAEvB,qFAAkF;AAClF,6DAA0D;AAC1D,qFAAiF;AACjF,qEAAkE;AAClE,qDAAmD;AACnD,yEAAsE;AACtE,2EAAwE;AACxE,+DAA4D;AAE5D;;GAEG;AACU,QAAA,yCAAyC,GAAG,OAAC,CAAC,MAAM,CAAC;IAChE,SAAS,EAAE,wCAAmB;IAC9B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACzC,KAAK,EAAE,iCAAgB,CAAC,QAAQ,EAAE;IAClC,aAAa,EAAE,gDAAuB;IAEtC,OAAO;IAEP,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,qBAAqB,EAAE,+DAA8B;SAClD,OAAO,CAAC,MAAM,CAAC;SACf,QAAQ,EAAE;IAEb,OAAO;IAEP,6DAA6D;IAC7D,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAE/B,OAAO;IAEP,kCAAkC;IAClC,aAAa,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,QAAQ,EAAE;IAEpE,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAE5B,0EAA0E;IAC1E,wEAAwE;IACxE,2EAA2E;IAC3E,6EAA6E;IAC7E,4EAA4E;IAC5E,yEAAyE;IACzE,2CAA2C;IAC3C,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAE3C,MAAM,EAAE,OAAC;SACN,MAAM,CACL,0CAAoB,EACpB,OAAC,CAAC,MAAM,CACN,oDAAyB,EACzB,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,sDAA0B,CAAC,CAAC,CACvD,CACF;SACA,QAAQ,EAAE;IAEb,8EAA8E;IAC9E,uCAAuC;IACvC,iDAAiD;IAEjD,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAExC,UAAU,EAAE,OAAC;SACV,MAAM,EAAE;SACR,KAAK,CAAC,gDAAgD,CAAC,CAAC,cAAc;SACtE,QAAQ,EAAE;IAEb,iEAAiE;IACjE,aAAa,EAAE,qBAAe,CAAC,QAAQ,EAAE;IAEzC,oCAAoC;IACpC,OAAO,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE;IAEtD;;;;;OAKG;IACH,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC,QAAQ,EAAE;IAEzE,gDAAgD;IAChD,qBAAqB,EAAE,gEAA+B,CAAC,QAAQ,EAAE;CAClE,CAAC,CAAA"}