@sphereon/jarm 0.17.0 → 0.17.1-feature.esm.cjs.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/index.cjs +516 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.cts +286 -0
  4. package/dist/index.d.ts +286 -4
  5. package/dist/index.js +462 -17
  6. package/dist/index.js.map +1 -1
  7. package/package.json +21 -12
  8. package/dist/index.d.ts.map +0 -1
  9. package/dist/jarm-auth-response/c-jarm-auth-response.d.ts +0 -55
  10. package/dist/jarm-auth-response/c-jarm-auth-response.d.ts.map +0 -1
  11. package/dist/jarm-auth-response/c-jarm-auth-response.js +0 -45
  12. package/dist/jarm-auth-response/c-jarm-auth-response.js.map +0 -1
  13. package/dist/jarm-auth-response/index.d.ts +0 -5
  14. package/dist/jarm-auth-response/index.d.ts.map +0 -1
  15. package/dist/jarm-auth-response/index.js +0 -21
  16. package/dist/jarm-auth-response/index.js.map +0 -1
  17. package/dist/jarm-auth-response/jarm-auth-response.d.ts +0 -48
  18. package/dist/jarm-auth-response/jarm-auth-response.d.ts.map +0 -1
  19. package/dist/jarm-auth-response/jarm-auth-response.js +0 -113
  20. package/dist/jarm-auth-response/jarm-auth-response.js.map +0 -1
  21. package/dist/jarm-auth-response/v-jarm-auth-response-params.d.ts +0 -31
  22. package/dist/jarm-auth-response/v-jarm-auth-response-params.d.ts.map +0 -1
  23. package/dist/jarm-auth-response/v-jarm-auth-response-params.js +0 -67
  24. package/dist/jarm-auth-response/v-jarm-auth-response-params.js.map +0 -1
  25. package/dist/jarm-auth-response/v-jarm-direct-post-jwt-auth-response-params.d.ts +0 -18
  26. package/dist/jarm-auth-response/v-jarm-direct-post-jwt-auth-response-params.d.ts.map +0 -1
  27. package/dist/jarm-auth-response/v-jarm-direct-post-jwt-auth-response-params.js +0 -38
  28. package/dist/jarm-auth-response/v-jarm-direct-post-jwt-auth-response-params.js.map +0 -1
  29. package/dist/jarm-auth-response-send/index.d.ts +0 -2
  30. package/dist/jarm-auth-response-send/index.d.ts.map +0 -1
  31. package/dist/jarm-auth-response-send/index.js +0 -18
  32. package/dist/jarm-auth-response-send/index.js.map +0 -1
  33. package/dist/jarm-auth-response-send/jarm-auth-response-send.d.ts +0 -17
  34. package/dist/jarm-auth-response-send/jarm-auth-response-send.d.ts.map +0 -1
  35. package/dist/jarm-auth-response-send/jarm-auth-response-send.js +0 -67
  36. package/dist/jarm-auth-response-send/jarm-auth-response-send.js.map +0 -1
  37. package/dist/metadata/index.d.ts +0 -4
  38. package/dist/metadata/index.d.ts.map +0 -1
  39. package/dist/metadata/index.js +0 -20
  40. package/dist/metadata/index.js.map +0 -1
  41. package/dist/metadata/jarm-validate-metadata.d.ts +0 -74
  42. package/dist/metadata/jarm-validate-metadata.d.ts.map +0 -1
  43. package/dist/metadata/jarm-validate-metadata.js +0 -98
  44. package/dist/metadata/jarm-validate-metadata.js.map +0 -1
  45. package/dist/metadata/v-jarm-client-metadata.d.ts +0 -34
  46. package/dist/metadata/v-jarm-client-metadata.d.ts.map +0 -1
  47. package/dist/metadata/v-jarm-client-metadata.js +0 -44
  48. package/dist/metadata/v-jarm-client-metadata.js.map +0 -1
  49. package/dist/metadata/v-jarm-server-metadata.d.ts +0 -11
  50. package/dist/metadata/v-jarm-server-metadata.d.ts.map +0 -1
  51. package/dist/metadata/v-jarm-server-metadata.js +0 -36
  52. package/dist/metadata/v-jarm-server-metadata.js.map +0 -1
  53. package/dist/utils.d.ts +0 -17
  54. package/dist/utils.d.ts.map +0 -1
  55. package/dist/utils.js +0 -33
  56. package/dist/utils.js.map +0 -1
  57. package/dist/v-response-mode-registry.d.ts +0 -30
  58. package/dist/v-response-mode-registry.d.ts.map +0 -1
  59. package/dist/v-response-mode-registry.js +0 -90
  60. package/dist/v-response-mode-registry.js.map +0 -1
  61. package/dist/v-response-type-registry.d.ts +0 -9
  62. package/dist/v-response-type-registry.d.ts.map +0 -1
  63. package/dist/v-response-type-registry.js +0 -38
  64. package/dist/v-response-type-registry.js.map +0 -1
  65. package/lib/__tests__/jarm.spec.ts +0 -5
  66. package/lib/index.ts +0 -3
  67. package/lib/jarm-auth-response/c-jarm-auth-response.ts +0 -41
  68. package/lib/jarm-auth-response/index.ts +0 -4
  69. package/lib/jarm-auth-response/jarm-auth-response.ts +0 -106
  70. package/lib/jarm-auth-response/v-jarm-auth-response-params.ts +0 -62
  71. package/lib/jarm-auth-response/v-jarm-direct-post-jwt-auth-response-params.ts +0 -26
  72. package/lib/jarm-auth-response-send/index.ts +0 -1
  73. package/lib/jarm-auth-response-send/jarm-auth-response-send.ts +0 -76
  74. package/lib/metadata/index.ts +0 -3
  75. package/lib/metadata/jarm-validate-metadata.ts +0 -80
  76. package/lib/metadata/v-jarm-client-metadata.ts +0 -42
  77. package/lib/metadata/v-jarm-server-metadata.ts +0 -29
  78. package/lib/utils.ts +0 -42
  79. package/lib/v-response-mode-registry.ts +0 -81
  80. package/lib/v-response-type-registry.ts +0 -23
@@ -1,4 +0,0 @@
1
- export * from './v-jarm-client-metadata.js';
2
- export * from './v-jarm-server-metadata.js';
3
- export * from './jarm-validate-metadata.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/metadata/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./v-jarm-client-metadata.js"), exports);
18
- __exportStar(require("./v-jarm-server-metadata.js"), exports);
19
- __exportStar(require("./jarm-validate-metadata.js"), exports);
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/metadata/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,8DAA4C;AAC5C,8DAA4C"}
@@ -1,74 +0,0 @@
1
- import * as v from 'valibot';
2
- export declare const vJarmAuthResponseValidateMetadataInput: v.ObjectSchema<{
3
- readonly client_metadata: v.UnionSchema<[v.ObjectSchema<{
4
- readonly authorization_signed_response_alg: v.SchemaWithPipe<[v.OptionalSchema<v.StringSchema<undefined>, never>, v.DescriptionAction<string | undefined, "JWA. If this is specified, the response will be signed using JWS and the configured algorithm. The algorithm none is not allowed.">]>;
5
- readonly authorization_encrypted_response_alg: v.OptionalSchema<v.NeverSchema<undefined>, never>;
6
- readonly authorization_encrypted_response_enc: v.OptionalSchema<v.NeverSchema<undefined>, never>;
7
- }, undefined>, v.ObjectSchema<{
8
- readonly authorization_signed_response_alg: v.OptionalSchema<v.NeverSchema<undefined>, never>;
9
- readonly authorization_encrypted_response_alg: v.SchemaWithPipe<[v.StringSchema<undefined>, v.DescriptionAction<string, "JWE alg algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.">]>;
10
- readonly authorization_encrypted_response_enc: v.SchemaWithPipe<[v.OptionalSchema<v.StringSchema<undefined>, "A128CBC-HS256">, v.DescriptionAction<string, "JWE enc algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.">]>;
11
- }, undefined>, v.ObjectSchema<{
12
- readonly authorization_encrypted_response_alg: v.SchemaWithPipe<[v.StringSchema<undefined>, v.DescriptionAction<string, "JWE alg algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.">]>;
13
- readonly authorization_encrypted_response_enc: v.SchemaWithPipe<[v.OptionalSchema<v.StringSchema<undefined>, "A128CBC-HS256">, v.DescriptionAction<string, "JWE enc algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.">]>;
14
- readonly authorization_signed_response_alg: v.SchemaWithPipe<[v.OptionalSchema<v.StringSchema<undefined>, never>, v.DescriptionAction<string | undefined, "JWA. If this is specified, the response will be signed using JWS and the configured algorithm. The algorithm none is not allowed.">]>;
15
- }, undefined>], undefined>;
16
- readonly server_metadata: Omit<v.ObjectSchema<{
17
- readonly authorization_signing_alg_values_supported: v.SchemaWithPipe<[v.ArraySchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string[], "JSON array containing a list of the JWS [RFC7515] signing algorithms (alg values) JWA [RFC7518] supported by the authorization endpoint to sign the response.">]>;
18
- readonly authorization_encryption_alg_values_supported: v.SchemaWithPipe<[v.ArraySchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string[], "JSON array containing a list of the JWE [RFC7516] encryption algorithms (alg values) JWA [RFC7518] supported by the authorization endpoint to encrypt the response.">]>;
19
- readonly authorization_encryption_enc_values_supported: v.SchemaWithPipe<[v.ArraySchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string[], "JSON array containing a list of the JWE [RFC7516] encryption algorithms (enc values) JWA [RFC7518] supported by the authorization endpoint to encrypt the response.">]>;
20
- }, undefined>, "_types" | "_run" | "entries"> & {
21
- readonly entries: {
22
- readonly authorization_signing_alg_values_supported: v.OptionalSchema<v.SchemaWithPipe<[v.ArraySchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string[], "JSON array containing a list of the JWS [RFC7515] signing algorithms (alg values) JWA [RFC7518] supported by the authorization endpoint to sign the response.">]>, never>;
23
- readonly authorization_encryption_alg_values_supported: v.OptionalSchema<v.SchemaWithPipe<[v.ArraySchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string[], "JSON array containing a list of the JWE [RFC7516] encryption algorithms (alg values) JWA [RFC7518] supported by the authorization endpoint to encrypt the response.">]>, never>;
24
- readonly authorization_encryption_enc_values_supported: v.OptionalSchema<v.SchemaWithPipe<[v.ArraySchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string[], "JSON array containing a list of the JWE [RFC7516] encryption algorithms (enc values) JWA [RFC7518] supported by the authorization endpoint to encrypt the response.">]>, never>;
25
- };
26
- readonly _run: (dataset: v.Dataset<unknown, never>, config: v.Config<v.BaseIssue<unknown>>) => v.Dataset<v.InferObjectOutput<{
27
- readonly authorization_signing_alg_values_supported: v.OptionalSchema<v.SchemaWithPipe<[v.ArraySchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string[], "JSON array containing a list of the JWS [RFC7515] signing algorithms (alg values) JWA [RFC7518] supported by the authorization endpoint to sign the response.">]>, never>;
28
- readonly authorization_encryption_alg_values_supported: v.OptionalSchema<v.SchemaWithPipe<[v.ArraySchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string[], "JSON array containing a list of the JWE [RFC7516] encryption algorithms (alg values) JWA [RFC7518] supported by the authorization endpoint to encrypt the response.">]>, never>;
29
- readonly authorization_encryption_enc_values_supported: v.OptionalSchema<v.SchemaWithPipe<[v.ArraySchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string[], "JSON array containing a list of the JWE [RFC7516] encryption algorithms (enc values) JWA [RFC7518] supported by the authorization endpoint to encrypt the response.">]>, never>;
30
- }>, v.InferIssue<v.ObjectSchema<{
31
- readonly authorization_signing_alg_values_supported: v.SchemaWithPipe<[v.ArraySchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string[], "JSON array containing a list of the JWS [RFC7515] signing algorithms (alg values) JWA [RFC7518] supported by the authorization endpoint to sign the response.">]>;
32
- readonly authorization_encryption_alg_values_supported: v.SchemaWithPipe<[v.ArraySchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string[], "JSON array containing a list of the JWE [RFC7516] encryption algorithms (alg values) JWA [RFC7518] supported by the authorization endpoint to encrypt the response.">]>;
33
- readonly authorization_encryption_enc_values_supported: v.SchemaWithPipe<[v.ArraySchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string[], "JSON array containing a list of the JWE [RFC7516] encryption algorithms (enc values) JWA [RFC7518] supported by the authorization endpoint to encrypt the response.">]>;
34
- }, undefined>>>;
35
- readonly _types?: {
36
- readonly input: {
37
- authorization_signing_alg_values_supported?: string[] | undefined;
38
- authorization_encryption_alg_values_supported?: string[] | undefined;
39
- authorization_encryption_enc_values_supported?: string[] | undefined;
40
- };
41
- readonly output: {
42
- authorization_signing_alg_values_supported?: string[] | undefined;
43
- authorization_encryption_alg_values_supported?: string[] | undefined;
44
- authorization_encryption_enc_values_supported?: string[] | undefined;
45
- };
46
- readonly issue: v.StringIssue | v.ObjectIssue | v.ArrayIssue;
47
- } | undefined;
48
- };
49
- }, undefined>;
50
- export type JarmMetadataValidate = v.InferInput<typeof vJarmAuthResponseValidateMetadataInput>;
51
- export declare const vJarmMetadataValidateOut: v.VariantSchema<"type", [v.ObjectSchema<{
52
- readonly type: v.LiteralSchema<"signed", undefined>;
53
- readonly client_metadata: v.ObjectSchema<{
54
- readonly authorization_signed_response_alg: v.SchemaWithPipe<[v.OptionalSchema<v.StringSchema<undefined>, never>, v.DescriptionAction<string | undefined, "JWA. If this is specified, the response will be signed using JWS and the configured algorithm. The algorithm none is not allowed.">]>;
55
- readonly authorization_encrypted_response_alg: v.OptionalSchema<v.NeverSchema<undefined>, never>;
56
- readonly authorization_encrypted_response_enc: v.OptionalSchema<v.NeverSchema<undefined>, never>;
57
- }, undefined>;
58
- }, undefined>, v.ObjectSchema<{
59
- readonly type: v.LiteralSchema<"encrypted", undefined>;
60
- readonly client_metadata: v.ObjectSchema<{
61
- readonly authorization_signed_response_alg: v.OptionalSchema<v.NeverSchema<undefined>, never>;
62
- readonly authorization_encrypted_response_alg: v.SchemaWithPipe<[v.StringSchema<undefined>, v.DescriptionAction<string, "JWE alg algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.">]>;
63
- readonly authorization_encrypted_response_enc: v.SchemaWithPipe<[v.OptionalSchema<v.StringSchema<undefined>, "A128CBC-HS256">, v.DescriptionAction<string, "JWE enc algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.">]>;
64
- }, undefined>;
65
- }, undefined>, v.ObjectSchema<{
66
- readonly type: v.LiteralSchema<"signed encrypted", undefined>;
67
- readonly client_metadata: v.ObjectSchema<{
68
- readonly authorization_encrypted_response_alg: v.SchemaWithPipe<[v.StringSchema<undefined>, v.DescriptionAction<string, "JWE alg algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.">]>;
69
- readonly authorization_encrypted_response_enc: v.SchemaWithPipe<[v.OptionalSchema<v.StringSchema<undefined>, "A128CBC-HS256">, v.DescriptionAction<string, "JWE enc algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.">]>;
70
- readonly authorization_signed_response_alg: v.SchemaWithPipe<[v.OptionalSchema<v.StringSchema<undefined>, never>, v.DescriptionAction<string | undefined, "JWA. If this is specified, the response will be signed using JWS and the configured algorithm. The algorithm none is not allowed.">]>;
71
- }, undefined>;
72
- }, undefined>], undefined>;
73
- export declare const jarmMetadataValidate: (vJarmMetadataValidate: JarmMetadataValidate) => v.InferOutput<typeof vJarmMetadataValidateOut>;
74
- //# sourceMappingURL=jarm-validate-metadata.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jarm-validate-metadata.d.ts","sourceRoot":"","sources":["../../lib/metadata/jarm-validate-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAW7B,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAGjD,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,UAAU,CAAC,OAAO,sCAAsC,CAAC,CAAC;AAE/F,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;0BAanC,CAAC;AAEH,eAAO,MAAM,oBAAoB,0BAA2B,oBAAoB,KAAG,CAAC,CAAC,WAAW,CAAC,OAAO,wBAAwB,CA+C/H,CAAC"}
@@ -1,98 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.jarmMetadataValidate = exports.vJarmMetadataValidateOut = exports.vJarmAuthResponseValidateMetadataInput = void 0;
27
- const v = __importStar(require("valibot"));
28
- const v_jarm_client_metadata_js_1 = require("../metadata/v-jarm-client-metadata.js");
29
- const v_jarm_server_metadata_js_1 = require("../metadata/v-jarm-server-metadata.js");
30
- const utils_js_1 = require("../utils.js");
31
- exports.vJarmAuthResponseValidateMetadataInput = v.object({
32
- client_metadata: v_jarm_client_metadata_js_1.vJarmClientMetadata,
33
- server_metadata: v.partial(v_jarm_server_metadata_js_1.vJarmServerMetadata),
34
- });
35
- exports.vJarmMetadataValidateOut = v.variant('type', [
36
- v.object({
37
- type: v.literal('signed'),
38
- client_metadata: v_jarm_client_metadata_js_1.vJarmClientMetadataSign,
39
- }),
40
- v.object({
41
- type: v.literal('encrypted'),
42
- client_metadata: v_jarm_client_metadata_js_1.vJarmClientMetadataEncrypt,
43
- }),
44
- v.object({
45
- type: v.literal('signed encrypted'),
46
- client_metadata: v_jarm_client_metadata_js_1.vJarmClientMetadataSignEncrypt,
47
- }),
48
- ]);
49
- const jarmMetadataValidate = (vJarmMetadataValidate) => {
50
- var _a, _b, _c;
51
- const { client_metadata, server_metadata } = vJarmMetadataValidate;
52
- const { authorization_encrypted_response_alg, authorization_encrypted_response_enc, authorization_signed_response_alg } = client_metadata;
53
- (0, utils_js_1.assertValueSupported)({
54
- supported: (_a = server_metadata.authorization_signing_alg_values_supported) !== null && _a !== void 0 ? _a : [],
55
- actual: authorization_signed_response_alg,
56
- required: !!authorization_signed_response_alg,
57
- error: new Error('Invalid authorization_signed_response_alg'),
58
- });
59
- (0, utils_js_1.assertValueSupported)({
60
- supported: (_b = server_metadata.authorization_encryption_alg_values_supported) !== null && _b !== void 0 ? _b : [],
61
- actual: authorization_encrypted_response_alg,
62
- required: !!authorization_encrypted_response_alg,
63
- error: new Error('Invalid authorization_encrypted_response_alg'),
64
- });
65
- (0, utils_js_1.assertValueSupported)({
66
- supported: (_c = server_metadata.authorization_encryption_enc_values_supported) !== null && _c !== void 0 ? _c : [],
67
- actual: authorization_encrypted_response_enc,
68
- required: !!authorization_encrypted_response_enc,
69
- error: new Error('Invalid authorization_encrypted_response_enc'),
70
- });
71
- if (authorization_signed_response_alg && authorization_encrypted_response_alg && authorization_encrypted_response_enc) {
72
- return {
73
- type: 'signed encrypted',
74
- client_metadata: {
75
- authorization_signed_response_alg,
76
- authorization_encrypted_response_alg,
77
- authorization_encrypted_response_enc,
78
- },
79
- };
80
- }
81
- else if (authorization_signed_response_alg && !authorization_encrypted_response_alg && !authorization_encrypted_response_enc) {
82
- return {
83
- type: 'signed',
84
- client_metadata: { authorization_signed_response_alg },
85
- };
86
- }
87
- else if (!authorization_signed_response_alg && authorization_encrypted_response_alg && authorization_encrypted_response_enc) {
88
- return {
89
- type: 'encrypted',
90
- client_metadata: { authorization_encrypted_response_alg, authorization_encrypted_response_enc },
91
- };
92
- }
93
- else {
94
- throw new Error(`Invalid jarm client_metadata combination`);
95
- }
96
- };
97
- exports.jarmMetadataValidate = jarmMetadataValidate;
98
- //# sourceMappingURL=jarm-validate-metadata.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jarm-validate-metadata.js","sourceRoot":"","sources":["../../lib/metadata/jarm-validate-metadata.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAE7B,qFAK+C;AAC/C,qFAA4E;AAC5E,0CAAmD;AAEtC,QAAA,sCAAsC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7D,eAAe,EAAE,+CAAmB;IACpC,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,+CAAmB,CAAC;CAChD,CAAC,CAAC;AAGU,QAAA,wBAAwB,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE;IACxD,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;QACzB,eAAe,EAAE,mDAAuB;KACzC,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;QAC5B,eAAe,EAAE,sDAA0B;KAC5C,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC;QACnC,eAAe,EAAE,0DAA8B;KAChD,CAAC;CACH,CAAC,CAAC;AAEI,MAA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AC,iCAAiC,IAAI,oCAAoC,IAAI,oCAAoC,EAAE,CAAC;QAC9H,OAAO;YACL,IAAI,EAAE,WAAW;YACjB,eAAe,EAAE,EAAE,oCAAoC,EAAE,oCAAoC,EAAE;SAChG,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC,CAAC;AA/CW,QAAA,oBAAoB,wBA+C/B"}
@@ -1,34 +0,0 @@
1
- import * as v from 'valibot';
2
- export declare const vJarmClientMetadataSign: v.ObjectSchema<{
3
- readonly authorization_signed_response_alg: v.SchemaWithPipe<[v.OptionalSchema<v.StringSchema<undefined>, never>, v.DescriptionAction<string | undefined, "JWA. If this is specified, the response will be signed using JWS and the configured algorithm. The algorithm none is not allowed.">]>;
4
- readonly authorization_encrypted_response_alg: v.OptionalSchema<v.NeverSchema<undefined>, never>;
5
- readonly authorization_encrypted_response_enc: v.OptionalSchema<v.NeverSchema<undefined>, never>;
6
- }, undefined>;
7
- export declare const vJarmClientMetadataEncrypt: v.ObjectSchema<{
8
- readonly authorization_signed_response_alg: v.OptionalSchema<v.NeverSchema<undefined>, never>;
9
- readonly authorization_encrypted_response_alg: v.SchemaWithPipe<[v.StringSchema<undefined>, v.DescriptionAction<string, "JWE alg algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.">]>;
10
- readonly authorization_encrypted_response_enc: v.SchemaWithPipe<[v.OptionalSchema<v.StringSchema<undefined>, "A128CBC-HS256">, v.DescriptionAction<string, "JWE enc algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.">]>;
11
- }, undefined>;
12
- export declare const vJarmClientMetadataSignEncrypt: v.ObjectSchema<{
13
- readonly authorization_encrypted_response_alg: v.SchemaWithPipe<[v.StringSchema<undefined>, v.DescriptionAction<string, "JWE alg algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.">]>;
14
- readonly authorization_encrypted_response_enc: v.SchemaWithPipe<[v.OptionalSchema<v.StringSchema<undefined>, "A128CBC-HS256">, v.DescriptionAction<string, "JWE enc algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.">]>;
15
- readonly authorization_signed_response_alg: v.SchemaWithPipe<[v.OptionalSchema<v.StringSchema<undefined>, never>, v.DescriptionAction<string | undefined, "JWA. If this is specified, the response will be signed using JWS and the configured algorithm. The algorithm none is not allowed.">]>;
16
- }, undefined>;
17
- /**
18
- * Clients may register their public encryption keys using the jwks_uri or jwks metadata parameters.
19
- */
20
- export declare const vJarmClientMetadata: v.UnionSchema<[v.ObjectSchema<{
21
- readonly authorization_signed_response_alg: v.SchemaWithPipe<[v.OptionalSchema<v.StringSchema<undefined>, never>, v.DescriptionAction<string | undefined, "JWA. If this is specified, the response will be signed using JWS and the configured algorithm. The algorithm none is not allowed.">]>;
22
- readonly authorization_encrypted_response_alg: v.OptionalSchema<v.NeverSchema<undefined>, never>;
23
- readonly authorization_encrypted_response_enc: v.OptionalSchema<v.NeverSchema<undefined>, never>;
24
- }, undefined>, v.ObjectSchema<{
25
- readonly authorization_signed_response_alg: v.OptionalSchema<v.NeverSchema<undefined>, never>;
26
- readonly authorization_encrypted_response_alg: v.SchemaWithPipe<[v.StringSchema<undefined>, v.DescriptionAction<string, "JWE alg algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.">]>;
27
- readonly authorization_encrypted_response_enc: v.SchemaWithPipe<[v.OptionalSchema<v.StringSchema<undefined>, "A128CBC-HS256">, v.DescriptionAction<string, "JWE enc algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.">]>;
28
- }, undefined>, v.ObjectSchema<{
29
- readonly authorization_encrypted_response_alg: v.SchemaWithPipe<[v.StringSchema<undefined>, v.DescriptionAction<string, "JWE alg algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.">]>;
30
- readonly authorization_encrypted_response_enc: v.SchemaWithPipe<[v.OptionalSchema<v.StringSchema<undefined>, "A128CBC-HS256">, v.DescriptionAction<string, "JWE enc algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.">]>;
31
- readonly authorization_signed_response_alg: v.SchemaWithPipe<[v.OptionalSchema<v.StringSchema<undefined>, never>, v.DescriptionAction<string | undefined, "JWA. If this is specified, the response will be signed using JWS and the configured algorithm. The algorithm none is not allowed.">]>;
32
- }, undefined>], undefined>;
33
- export type JarmClientMetadata = v.InferInput<typeof vJarmClientMetadata>;
34
- //# sourceMappingURL=v-jarm-client-metadata.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v-jarm-client-metadata.d.ts","sourceRoot":"","sources":["../../lib/metadata/v-jarm-client-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,eAAO,MAAM,uBAAuB;;;;aAUlC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;aAerC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;aAGzC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;0BAAiG,CAAC;AAElI,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.vJarmClientMetadata = exports.vJarmClientMetadataSignEncrypt = exports.vJarmClientMetadataEncrypt = exports.vJarmClientMetadataSign = void 0;
27
- const v = __importStar(require("valibot"));
28
- exports.vJarmClientMetadataSign = v.object({
29
- authorization_signed_response_alg: v.pipe(v.optional(v.string()), // @default 'RS256' This makes no sense with openid4vp if just encrypted can be specified
30
- v.description('JWA. If this is specified, the response will be signed using JWS and the configured algorithm. The algorithm none is not allowed.')),
31
- authorization_encrypted_response_alg: v.optional(v.never()),
32
- authorization_encrypted_response_enc: v.optional(v.never()),
33
- });
34
- exports.vJarmClientMetadataEncrypt = v.object({
35
- authorization_signed_response_alg: v.optional(v.never()),
36
- authorization_encrypted_response_alg: v.pipe(v.string(), v.description('JWE alg algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.')),
37
- authorization_encrypted_response_enc: v.pipe(v.optional(v.string(), 'A128CBC-HS256'), v.description('JWE enc algorithm JWA. If both signing and encryption are requested, the response will be signed then encrypted with the provided algorithm.')),
38
- });
39
- exports.vJarmClientMetadataSignEncrypt = v.object(Object.assign(Object.assign({}, v.pick(exports.vJarmClientMetadataSign, ['authorization_signed_response_alg']).entries), v.pick(exports.vJarmClientMetadataEncrypt, ['authorization_encrypted_response_alg', 'authorization_encrypted_response_enc']).entries));
40
- /**
41
- * Clients may register their public encryption keys using the jwks_uri or jwks metadata parameters.
42
- */
43
- exports.vJarmClientMetadata = v.union([exports.vJarmClientMetadataSign, exports.vJarmClientMetadataEncrypt, exports.vJarmClientMetadataSignEncrypt]);
44
- //# sourceMappingURL=v-jarm-client-metadata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mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,+BAAuB,EAAE,kCAA0B,EAAE,sCAA8B,CAAC,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- import * as v from 'valibot';
2
- /**
3
- * Authorization servers SHOULD publish the supported algorithms for signing and encrypting the JWT of an authorization response by utilizing OAuth 2.0 Authorization Server Metadata [RFC8414] parameters.
4
- */
5
- export declare const vJarmServerMetadata: v.ObjectSchema<{
6
- readonly authorization_signing_alg_values_supported: v.SchemaWithPipe<[v.ArraySchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string[], "JSON array containing a list of the JWS [RFC7515] signing algorithms (alg values) JWA [RFC7518] supported by the authorization endpoint to sign the response.">]>;
7
- readonly authorization_encryption_alg_values_supported: v.SchemaWithPipe<[v.ArraySchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string[], "JSON array containing a list of the JWE [RFC7516] encryption algorithms (alg values) JWA [RFC7518] supported by the authorization endpoint to encrypt the response.">]>;
8
- readonly authorization_encryption_enc_values_supported: v.SchemaWithPipe<[v.ArraySchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string[], "JSON array containing a list of the JWE [RFC7516] encryption algorithms (enc values) JWA [RFC7518] supported by the authorization endpoint to encrypt the response.">]>;
9
- }, undefined>;
10
- export type JarmServerMetadata = v.InferInput<typeof vJarmServerMetadata>;
11
- //# sourceMappingURL=v-jarm-server-metadata.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v-jarm-server-metadata.d.ts","sourceRoot":"","sources":["../../lib/metadata/v-jarm-server-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;aAqB9B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -1,36 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.vJarmServerMetadata = void 0;
27
- const v = __importStar(require("valibot"));
28
- /**
29
- * Authorization servers SHOULD publish the supported algorithms for signing and encrypting the JWT of an authorization response by utilizing OAuth 2.0 Authorization Server Metadata [RFC8414] parameters.
30
- */
31
- exports.vJarmServerMetadata = v.object({
32
- authorization_signing_alg_values_supported: v.pipe(v.array(v.string()), v.description('JSON array containing a list of the JWS [RFC7515] signing algorithms (alg values) JWA [RFC7518] supported by the authorization endpoint to sign the response.')),
33
- authorization_encryption_alg_values_supported: v.pipe(v.array(v.string()), v.description('JSON array containing a list of the JWE [RFC7516] encryption algorithms (alg values) JWA [RFC7518] supported by the authorization endpoint to encrypt the response.')),
34
- authorization_encryption_enc_values_supported: v.pipe(v.array(v.string()), v.description('JSON array containing a list of the JWE [RFC7516] encryption algorithms (enc values) JWA [RFC7518] supported by the authorization endpoint to encrypt the response.')),
35
- });
36
- //# sourceMappingURL=v-jarm-server-metadata.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v-jarm-server-metadata.js","sourceRoot":"","sources":["../../lib/metadata/v-jarm-server-metadata.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAE7B;;GAEG;AACU,QAAA,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,0CAA0C,EAAE,CAAC,CAAC,IAAI,CAChD,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EACnB,CAAC,CAAC,WAAW,CACX,+JAA+J,CAChK,CACF;IAED,6CAA6C,EAAE,CAAC,CAAC,IAAI,CACnD,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EACnB,CAAC,CAAC,WAAW,CACX,qKAAqK,CACtK,CACF;IAED,6CAA6C,EAAE,CAAC,CAAC,IAAI,CACnD,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EACnB,CAAC,CAAC,WAAW,CACX,qKAAqK,CACtK,CACF;CACF,CAAC,CAAC"}
package/dist/utils.d.ts DELETED
@@ -1,17 +0,0 @@
1
- export declare function appendQueryParams(input: {
2
- url: URL;
3
- params: Record<string, string | number | boolean>;
4
- }): URL;
5
- export declare function appendFragmentParams(input: {
6
- url: URL;
7
- fragments: Record<string, string | number | boolean>;
8
- }): URL;
9
- interface AssertValueSupported<T> {
10
- supported: T[];
11
- actual: T;
12
- error: Error;
13
- required: boolean;
14
- }
15
- export declare function assertValueSupported<T>(input: AssertValueSupported<T>): T | undefined;
16
- export {};
17
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../lib/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAA;CAAE,OASvG;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAA;CAAE,OAe7G;AAED,UAAU,oBAAoB,CAAC,CAAC;IAC9B,SAAS,EAAE,CAAC,EAAE,CAAC;IACf,MAAM,EAAE,CAAC,CAAC;IACV,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CAMrF"}
package/dist/utils.js DELETED
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.appendQueryParams = appendQueryParams;
4
- exports.appendFragmentParams = appendFragmentParams;
5
- exports.assertValueSupported = assertValueSupported;
6
- function appendQueryParams(input) {
7
- const { url, params } = input;
8
- // Append the new query parameters from the params object
9
- for (const [key, value] of Object.entries(params)) {
10
- url.searchParams.append(key, encodeURIComponent(value));
11
- }
12
- return url;
13
- }
14
- function appendFragmentParams(input) {
15
- const { url, fragments } = input;
16
- // Convert existing fragment to an object and remove the leading '#'
17
- const fragmentParams = new URLSearchParams(url.hash.slice(1)); // Remove the leading '#' from the fragment
18
- // Append the new fragments from the fragments object
19
- for (const [key, value] of Object.entries(fragments)) {
20
- fragmentParams.append(key, encodeURIComponent(value));
21
- }
22
- // Rebuild the fragment string and assign it to the URL
23
- url.hash = fragmentParams.toString();
24
- return url;
25
- }
26
- function assertValueSupported(input) {
27
- const { required, error, supported, actual } = input;
28
- const intersection = supported.find((value) => value === actual);
29
- if (required && !intersection)
30
- throw error;
31
- return intersection;
32
- }
33
- //# sourceMappingURL=utils.js.map
package/dist/utils.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceR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AC,YAAY;QAAE,MAAM,KAAK,CAAC;IAC3C,OAAO,YAAY,CAAC;AACtB,CAAC"}
@@ -1,30 +0,0 @@
1
- import * as v from 'valibot';
2
- import type { ResponseTypeOut } from './v-response-type-registry.js';
3
- export declare const vJarmResponseMode: v.PicklistSchema<["jwt", "query.jwt", "fragment.jwt", "form_post.jwt"], undefined>;
4
- export type JarmResponseMode = v.InferInput<typeof vJarmResponseMode>;
5
- export declare const vOpenid4vpResponseMode: v.PicklistSchema<["direct_post"], undefined>;
6
- export type Openid4vpResponseMode = v.InferInput<typeof vOpenid4vpResponseMode>;
7
- /**
8
- * * 'direct_post.jwt' The response is send as HTTP POST request using the application/x-www-form-urlencoded content type. The body contains a single parameter response which is the JWT encoded Response as defined in JARM 4.1
9
- */
10
- export declare const vOpenid4vpJarmResponseMode: v.PicklistSchema<["direct_post.jwt"], undefined>;
11
- export type Openid4vpJarmResponseMode = v.InferInput<typeof vOpenid4vpJarmResponseMode>;
12
- /**
13
- * The use of this parameter is NOT RECOMMENDED when the Response Mode that would be requested is the default mode specified for the Response Type.
14
- * * 'query' In this mode, Authorization Response parameters are encoded in the query string added to the redirect_uri when redirecting back to the Client.
15
- * * 'fragment' In this mode, Authorization Response parameters are encoded in the fragment added to the redirect_uri when redirecting back to the Client.
16
- * * 'direct_post' the Authorization Response is send to an endpoint controlled by the Verifier via an HTTP POST request.
17
- */
18
- export declare const vResponseMode: v.SchemaWithPipe<[v.PicklistSchema<["query", "fragment", "direct_post", "jwt", "query.jwt", "fragment.jwt", "form_post.jwt", "direct_post.jwt"], undefined>, v.DescriptionAction<"jwt" | "query.jwt" | "fragment.jwt" | "form_post.jwt" | "direct_post" | "direct_post.jwt" | "query" | "fragment", "Informs the Authorization Server of the mechanism to be used for returning parameters from the Authorization Endpoint.">]>;
19
- export type ResponseMode = v.InferInput<typeof vResponseMode>;
20
- export declare const getDefaultResponseMode: (input: {
21
- response_type: ResponseTypeOut;
22
- }) => "query" | "fragment";
23
- export declare const getJarmDefaultResponseMode: (input: {
24
- response_type: ResponseTypeOut;
25
- }) => "query.jwt" | "fragment.jwt";
26
- export declare const validateResponseMode: (input: {
27
- response_type: ResponseTypeOut;
28
- response_mode: ResponseMode;
29
- }) => void;
30
- //# sourceMappingURL=v-response-mode-registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v-response-mode-registry.d.ts","sourceRoot":"","sources":["../lib/v-response-mode-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,eAAO,MAAM,iBAAiB,oFAAoE,CAAC;AACnG,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEtE,eAAO,MAAM,sBAAsB,8CAA8B,CAAC;AAClE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,0BAA0B,kDAAkC,CAAC;AAC1E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAExF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,iaAGzB,CAAC;AACF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AAkB9D,eAAO,MAAM,sBAAsB,UAAW;IAAE,aAAa,EAAE,eAAe,CAAA;CAAE,KAAG,OAAO,GAAG,UAiB5F,CAAC;AAEF,eAAO,MAAM,0BAA0B,UAAW;IAAE,aAAa,EAAE,eAAe,CAAA;CAAE,KAAG,WAAW,GAAG,cASpG,CAAC;AAEF,eAAO,MAAM,oBAAoB,UAAW;IAAE,aAAa,EAAE,eAAe,CAAC;IAAC,aAAa,EAAE,YAAY,CAAA;CAAE,SAM1G,CAAC"}
@@ -1,90 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.validateResponseMode = exports.getJarmDefaultResponseMode = exports.getDefaultResponseMode = exports.vResponseMode = exports.vOpenid4vpJarmResponseMode = exports.vOpenid4vpResponseMode = exports.vJarmResponseMode = void 0;
27
- const v = __importStar(require("valibot"));
28
- exports.vJarmResponseMode = v.picklist(['jwt', 'query.jwt', 'fragment.jwt', 'form_post.jwt']);
29
- exports.vOpenid4vpResponseMode = v.picklist(['direct_post']);
30
- /**
31
- * * 'direct_post.jwt' The response is send as HTTP POST request using the application/x-www-form-urlencoded content type. The body contains a single parameter response which is the JWT encoded Response as defined in JARM 4.1
32
- */
33
- exports.vOpenid4vpJarmResponseMode = v.picklist(['direct_post.jwt']);
34
- /**
35
- * The use of this parameter is NOT RECOMMENDED when the Response Mode that would be requested is the default mode specified for the Response Type.
36
- * * 'query' In this mode, Authorization Response parameters are encoded in the query string added to the redirect_uri when redirecting back to the Client.
37
- * * 'fragment' In this mode, Authorization Response parameters are encoded in the fragment added to the redirect_uri when redirecting back to the Client.
38
- * * 'direct_post' the Authorization Response is send to an endpoint controlled by the Verifier via an HTTP POST request.
39
- */
40
- exports.vResponseMode = v.pipe(v.picklist(['query', 'fragment', ...exports.vOpenid4vpResponseMode.options, ...exports.vJarmResponseMode.options, ...exports.vOpenid4vpJarmResponseMode.options]), v.description('Informs the Authorization Server of the mechanism to be used for returning parameters from the Authorization Endpoint.'));
41
- const getDisAllowedResponseModes = (input) => {
42
- const { response_type } = input;
43
- switch (response_type) {
44
- case 'code token':
45
- return ['query'];
46
- case 'code id_token':
47
- return ['query'];
48
- case 'id_token token':
49
- return ['query'];
50
- case 'code id_token token':
51
- return ['query'];
52
- }
53
- return undefined;
54
- };
55
- const getDefaultResponseMode = (input) => {
56
- const { response_type } = input;
57
- switch (response_type) {
58
- case 'code':
59
- case 'none':
60
- return 'query';
61
- case 'token':
62
- case 'id_token':
63
- case 'code token':
64
- case 'code id_token':
65
- case 'id_token token':
66
- case 'code id_token token':
67
- case 'vp_token':
68
- case 'id_token vp_token':
69
- return 'fragment';
70
- }
71
- };
72
- exports.getDefaultResponseMode = getDefaultResponseMode;
73
- const getJarmDefaultResponseMode = (input) => {
74
- const responseMode = (0, exports.getDefaultResponseMode)(input);
75
- switch (responseMode) {
76
- case 'query':
77
- return 'query.jwt';
78
- case 'fragment':
79
- return 'fragment.jwt';
80
- }
81
- };
82
- exports.getJarmDefaultResponseMode = getJarmDefaultResponseMode;
83
- const validateResponseMode = (input) => {
84
- const disallowedResponseModes = getDisAllowedResponseModes(input);
85
- if (disallowedResponseModes === null || disallowedResponseModes === void 0 ? void 0 : disallowedResponseModes.includes(input.response_mode)) {
86
- throw new Error(`Response_type '${input.response_type}' is not compatible with response_mode '${input.response_mode}'.`);
87
- }
88
- };
89
- exports.validateResponseMode = validateResponseMode;
90
- //# sourceMappingURL=v-response-mode-registry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v-response-mode-registry.js","sourceRoot":"","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Z,KAAK,MAAM;YACT,OAAO,OAAO,CAAC;QACjB,KAAK,OAAO,CAAC;QACb,KAAK,UAAU,CAAC;QAChB,KAAK,YAAY,CAAC;QAClB,KAAK,eAAe,CAAC;QACrB,KAAK,gBAAgB,CAAC;QACtB,KAAK,qBAAqB,CAAC;QAC3B,KAAK,UAAU,CAAC;QAChB,KAAK,mBAAmB;YACtB,OAAO,UAAU,CAAC;IACtB,CAAC;AACH,CAAC,CAAC;AAjBW,QAAA,sBAAsB,0BAiBjC;AAEK,MAAM,0BAA0B,GAAG,CAAC,KAAyC,EAAgC,EAAE;IACpH,MAAM,YAAY,GAAG,IAAA,8BAAsB,EAAC,KAAK,CAAC,CAAC;IAEnD,QAAQ,YAAY,EAAE,CAAC;QACrB,KAAK,OAAO;YACV,OAAO,WAAW,CAAC;QACrB,KAAK,UAAU;YACb,OAAO,cAAc,CAAC;IAC1B,CAAC;AACH,CAAC,CAAC;AATW,QAAA,0BAA0B,8BASrC;AAEK,MAAM,oBAAoB,GAAG,CAAC,KAAsE,EAAE,EAAE;IAC7G,MAAM,uBAAuB,GAAG,0BAA0B,CAAC,KAAK,CAAC,CAAC;IAElE,IAAI,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,KAAK,CAAC,kBAAkB,KAAK,CAAC,aAAa,2CAA2C,KAAK,CAAC,aAAa,IAAI,CAAC,CAAC;IAC3H,CAAC;AACH,CAAC,CAAC;AANW,QAAA,oBAAoB,wBAM/B"}
@@ -1,9 +0,0 @@
1
- import * as v from 'valibot';
2
- export declare const oAuthResponseTypes: v.PicklistSchema<["code", "token"], undefined>;
3
- export declare const oAuthMRTEPResponseTypes: v.PicklistSchema<["none", "id_token", "code token", "code id_token", "id_token token", "code id_token token"], undefined>;
4
- export declare const openid4vpResponseTypes: v.PicklistSchema<["vp_token", "id_token vp_token"], undefined>;
5
- export declare const vTransformedResponseTypes: v.PicklistSchema<["vp_token", "id_token vp_token", "code", "token", "none", "id_token", "code token", "code id_token", "id_token token", "code id_token token"], undefined>;
6
- export declare const vResponseType: v.SchemaWithPipe<[v.StringSchema<undefined>, v.TransformAction<string, string>, v.PicklistSchema<["vp_token", "id_token vp_token", "code", "token", "none", "id_token", "code token", "code id_token", "id_token token", "code id_token token"], undefined>]>;
7
- export type ResponseType = v.InferInput<typeof vTransformedResponseTypes>;
8
- export type ResponseTypeOut = v.InferOutput<typeof vTransformedResponseTypes>;
9
- //# sourceMappingURL=v-response-type-registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v-response-type-registry.d.ts","sourceRoot":"","sources":["../lib/v-response-type-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,eAAO,MAAM,kBAAkB,gDAAgC,CAAC;AAGhE,eAAO,MAAM,uBAAuB,2HAA2G,CAAC;AAEhJ,eAAO,MAAM,sBAAsB,gEAAgD,CAAC;AAEpF,eAAO,MAAM,yBAAyB,6KAIpC,CAAC;AAEH,eAAO,MAAM,aAAa,+PAIzB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC1E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,yBAAyB,CAAC,CAAC"}