@metamask-previews/profile-sync-controller 32.1.1-preview-c6cdff1dd → 32.1.1-preview-9d2a9bdf5

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 (63) hide show
  1. package/CHANGELOG.md +0 -2
  2. package/dist/controllers/authentication/AuthenticationController.d.ts.map +1 -1
  3. package/dist/controllers/authentication/AuthenticationController.js +5 -6
  4. package/dist/controllers/authentication/AuthenticationController.js.map +1 -1
  5. package/dist/controllers/user-storage/UserStorageController.d.ts.map +1 -1
  6. package/dist/controllers/user-storage/UserStorageController.js +5 -6
  7. package/dist/controllers/user-storage/UserStorageController.js.map +1 -1
  8. package/dist/sdk/authentication-jwt-bearer/flow-srp.d.ts +1 -56
  9. package/dist/sdk/authentication-jwt-bearer/flow-srp.d.ts.map +1 -1
  10. package/dist/sdk/authentication-jwt-bearer/flow-srp.js +1 -119
  11. package/dist/sdk/authentication-jwt-bearer/flow-srp.js.map +1 -1
  12. package/dist/sdk/authentication.d.ts +6 -15
  13. package/dist/sdk/authentication.d.ts.map +1 -1
  14. package/dist/sdk/authentication.js +0 -24
  15. package/dist/sdk/authentication.js.map +1 -1
  16. package/dist/sdk/constants.d.ts +0 -2
  17. package/dist/sdk/constants.d.ts.map +1 -1
  18. package/dist/sdk/constants.js +0 -2
  19. package/dist/sdk/constants.js.map +1 -1
  20. package/dist/sdk/errors.d.ts +0 -91
  21. package/dist/sdk/errors.d.ts.map +1 -1
  22. package/dist/sdk/errors.js +0 -161
  23. package/dist/sdk/errors.js.map +1 -1
  24. package/dist/sdk/index.d.ts +0 -3
  25. package/dist/sdk/index.d.ts.map +1 -1
  26. package/dist/sdk/index.js +0 -1
  27. package/dist/sdk/index.js.map +1 -1
  28. package/dist/sdk/mocks/auth.d.ts +0 -63
  29. package/dist/sdk/mocks/auth.d.ts.map +1 -1
  30. package/dist/sdk/mocks/auth.js +0 -90
  31. package/dist/sdk/mocks/auth.js.map +1 -1
  32. package/dist/sdk/utils/validate-login-response.d.ts.map +1 -1
  33. package/dist/sdk/utils/validate-login-response.js +7 -5
  34. package/dist/sdk/utils/validate-login-response.js.map +1 -1
  35. package/dist/shared/utils/entropy-source.d.ts +12 -3
  36. package/dist/shared/utils/entropy-source.d.ts.map +1 -1
  37. package/dist/shared/utils/entropy-source.js +17 -4
  38. package/dist/shared/utils/entropy-source.js.map +1 -1
  39. package/package.json +1 -3
  40. package/dist/sdk/authentication-jwt-bearer/mfa/schemas.d.ts +0 -691
  41. package/dist/sdk/authentication-jwt-bearer/mfa/schemas.d.ts.map +0 -1
  42. package/dist/sdk/authentication-jwt-bearer/mfa/schemas.js +0 -265
  43. package/dist/sdk/authentication-jwt-bearer/mfa/schemas.js.map +0 -1
  44. package/dist/sdk/authentication-jwt-bearer/mfa/services.d.ts +0 -104
  45. package/dist/sdk/authentication-jwt-bearer/mfa/services.d.ts.map +0 -1
  46. package/dist/sdk/authentication-jwt-bearer/mfa/services.js +0 -363
  47. package/dist/sdk/authentication-jwt-bearer/mfa/services.js.map +0 -1
  48. package/dist/sdk/authentication-jwt-bearer/mfa/types.d.ts +0 -125
  49. package/dist/sdk/authentication-jwt-bearer/mfa/types.d.ts.map +0 -1
  50. package/dist/sdk/authentication-jwt-bearer/mfa/types.js +0 -3
  51. package/dist/sdk/authentication-jwt-bearer/mfa/types.js.map +0 -1
  52. package/dist/sdk/utils/as-record.d.ts +0 -10
  53. package/dist/sdk/utils/as-record.d.ts.map +0 -1
  54. package/dist/sdk/utils/as-record.js +0 -14
  55. package/dist/sdk/utils/as-record.js.map +0 -1
  56. package/dist/sdk/utils/jwt.d.ts +0 -13
  57. package/dist/sdk/utils/jwt.d.ts.map +0 -1
  58. package/dist/sdk/utils/jwt.js +0 -21
  59. package/dist/sdk/utils/jwt.js.map +0 -1
  60. package/dist/sdk/utils/to-error-message.d.ts +0 -8
  61. package/dist/sdk/utils/to-error-message.d.ts.map +0 -1
  62. package/dist/sdk/utils/to-error-message.js +0 -10
  63. package/dist/sdk/utils/to-error-message.js.map +0 -1
@@ -1,265 +0,0 @@
1
- import { array, assert, boolean, enums, integer, literal, min, nullable, object, optional, pattern, refine, sensitive, size, string, StructError, type, union, } from '@metamask/superstruct';
2
- import { ElevatedTokenInvalidError, MfaError } from '../../errors.js';
3
- import { asRecord } from '../../utils/as-record.js';
4
- export const MFA_CREDENTIAL_TYPES = ['passkey', 'email_otp'];
5
- export const MfaCredentialTypeStruct = enums(MFA_CREDENTIAL_TYPES);
6
- const CredentialDescriptorStruct = type({
7
- type: literal('public-key'),
8
- id: string(),
9
- transports: optional(array(string())),
10
- });
11
- const ExtensionsStruct = type({});
12
- export const PublicKeyCredentialCreationOptionsJSONStruct = type({
13
- rp: type({
14
- id: string(),
15
- name: string(),
16
- }),
17
- user: type({
18
- id: sensitive(string()),
19
- name: sensitive(string()),
20
- displayName: sensitive(string()),
21
- }),
22
- challenge: sensitive(string()),
23
- pubKeyCredParams: array(type({
24
- type: literal('public-key'),
25
- alg: integer(),
26
- })),
27
- excludeCredentials: optional(array(CredentialDescriptorStruct)),
28
- authenticatorSelection: optional(type({
29
- authenticatorAttachment: optional(string()),
30
- residentKey: optional(string()),
31
- requireResidentKey: optional(boolean()),
32
- userVerification: optional(string()),
33
- })),
34
- attestation: optional(string()),
35
- timeout: optional(integer()),
36
- extensions: optional(ExtensionsStruct),
37
- });
38
- export const PublicKeyCredentialRequestOptionsJSONStruct = type({
39
- challenge: sensitive(string()),
40
- rpId: optional(string()),
41
- allowCredentials: optional(array(CredentialDescriptorStruct)),
42
- userVerification: optional(string()),
43
- timeout: optional(integer()),
44
- extensions: optional(ExtensionsStruct),
45
- });
46
- export const PasskeyCreateDataStruct = type({
47
- publicKey: PublicKeyCredentialCreationOptionsJSONStruct,
48
- });
49
- export const PasskeyRequestDataStruct = type({
50
- publicKey: PublicKeyCredentialRequestOptionsJSONStruct,
51
- });
52
- export const RegistrationResponseJSONStruct = sensitive(type({
53
- id: string(),
54
- rawId: string(),
55
- type: literal('public-key'),
56
- response: type({
57
- attestationObject: string(),
58
- clientDataJSON: string(),
59
- transports: optional(array(string())),
60
- publicKeyAlgorithm: optional(integer()),
61
- publicKey: optional(string()),
62
- authenticatorData: optional(string()),
63
- }),
64
- authenticatorAttachment: optional(nullable(string())),
65
- clientExtensionResults: optional(ExtensionsStruct),
66
- }));
67
- export const AuthenticationResponseJSONStruct = sensitive(type({
68
- id: string(),
69
- rawId: string(),
70
- type: literal('public-key'),
71
- response: type({
72
- authenticatorData: string(),
73
- clientDataJSON: string(),
74
- signature: string(),
75
- userHandle: optional(nullable(string())),
76
- }),
77
- authenticatorAttachment: optional(nullable(string())),
78
- clientExtensionResults: optional(ExtensionsStruct),
79
- }));
80
- /**
81
- * Only the assertion JWT is consumed from the verification response; the
82
- * profile fields on the wire duplicate what the login flow already resolved.
83
- */
84
- export const MfaVerifyCompleteResponseStruct = type({
85
- token: sensitive(string()),
86
- expires_in: integer(),
87
- });
88
- export const MfaEnrollResponseStruct = type({
89
- flow_id: string(),
90
- expires_at: string(),
91
- passkey_create_data: optional(sensitive(string())),
92
- });
93
- export const MfaEnrollCompleteResponseStruct = type({
94
- status: literal('enrolled'),
95
- });
96
- export const MfaVerifyResponseStruct = type({
97
- flow_id: string(),
98
- expires_at: string(),
99
- passkey_request_data: optional(sensitive(string())),
100
- });
101
- export const MfaPasskeyDetailStruct = type({
102
- display_name: optional(sensitive(string())),
103
- added_at: optional(string()),
104
- });
105
- export const MfaEmailDetailStruct = type({
106
- address: optional(sensitive(string())),
107
- verified: optional(boolean()),
108
- });
109
- export const MfaCredentialStruct = type({
110
- // Intentionally accepts strings so future server credential types and
111
- // statuses can be ignored without making the complete response invalid.
112
- credential_type: string(),
113
- status: string(),
114
- enrolled_at: optional(string()),
115
- passkey: optional(MfaPasskeyDetailStruct),
116
- email: optional(MfaEmailDetailStruct),
117
- });
118
- export const MfaCredentialsResponseStruct = type({
119
- credentials: array(MfaCredentialStruct),
120
- });
121
- export const MfaErrorResponseStruct = type({
122
- code: optional(string()),
123
- message: string(),
124
- });
125
- export const TokenReasonStruct = object({
126
- operation: pattern(string(), /^[A-Za-z0-9_.:-]{1,64}$/u),
127
- });
128
- export const BeginEnrollmentRequestStruct = refine(object({
129
- type: MfaCredentialTypeStruct,
130
- email: optional(sensitive(size(string(), 3, 254))),
131
- reason: TokenReasonStruct,
132
- }), 'BeginEnrollmentRequest', (value) => {
133
- if (value.type === 'email_otp' && value.email === undefined) {
134
- return 'email is required for email_otp enrollment';
135
- }
136
- if (value.type === 'passkey' && value.email !== undefined) {
137
- return 'email is not accepted for passkey enrollment';
138
- }
139
- return true;
140
- });
141
- const EmailOtpCodeStruct = sensitive(pattern(string(), /^\d{6}$/u));
142
- const EnrollmentProofStruct = union([
143
- object({
144
- type: literal('passkey'),
145
- attestation: RegistrationResponseJSONStruct,
146
- }),
147
- object({
148
- type: literal('email_otp'),
149
- code: EmailOtpCodeStruct,
150
- }),
151
- ]);
152
- export const CompleteEnrollmentRequestStruct = object({
153
- flowId: string(),
154
- proof: EnrollmentProofStruct,
155
- reason: TokenReasonStruct,
156
- });
157
- export const BeginStepUpRequestStruct = object({
158
- type: MfaCredentialTypeStruct,
159
- reason: TokenReasonStruct,
160
- });
161
- const StepUpProofStruct = union([
162
- object({
163
- type: literal('passkey'),
164
- assertion: AuthenticationResponseJSONStruct,
165
- }),
166
- object({
167
- type: literal('email_otp'),
168
- code: EmailOtpCodeStruct,
169
- }),
170
- ]);
171
- export const CompleteStepUpRequestStruct = object({
172
- flowId: string(),
173
- proof: StepUpProofStruct,
174
- reason: TokenReasonStruct,
175
- });
176
- export const GetElevatedTokenRequestStruct = object({
177
- maxSessionAgeMs: optional(min(integer(), 0)),
178
- });
179
- export const ElevatedTokenClaimsStruct = type({
180
- sub: sensitive(string()),
181
- aal: literal(2),
182
- exp: integer(),
183
- amr: union([MfaCredentialTypeStruct, array(MfaCredentialTypeStruct)]),
184
- });
185
- function formatStructError(error) {
186
- return error
187
- .failures()
188
- .map(({ path, message }) => `[${path.join('.')}] ${message}`)
189
- .join(', ');
190
- }
191
- /**
192
- * Validates data received from the authentication service.
193
- *
194
- * @param value - Untrusted response data.
195
- * @param struct - Expected response structure.
196
- * @throws MfaError if the response does not match the structure.
197
- */
198
- export function assertValidMfaResponse(value, struct) {
199
- try {
200
- assert(value, struct);
201
- }
202
- catch (error) {
203
- if (error instanceof StructError) {
204
- throw new MfaError('invalid_response', formatStructError(error));
205
- }
206
- /* istanbul ignore next */
207
- throw error;
208
- }
209
- }
210
- /**
211
- * Validates data received from an untyped controller boundary.
212
- *
213
- * @param value - Untrusted request data.
214
- * @param struct - Expected request structure.
215
- * @throws MfaError if the request does not match the structure.
216
- */
217
- export function assertValidMfaRequest(value, struct) {
218
- try {
219
- assert(value, struct);
220
- }
221
- catch (error) {
222
- if (error instanceof StructError) {
223
- throw new MfaError('invalid_request', formatStructError(error));
224
- }
225
- /* istanbul ignore next */
226
- throw error;
227
- }
228
- }
229
- /**
230
- * Validates and normalizes claims from an elevated access token.
231
- *
232
- * Hydra places hook-supplied claims under `ext` unless they are promoted to
233
- * the top level, so `aal` and `amr` are read from either location.
234
- *
235
- * @param payload - Decoded JWT payload.
236
- * @returns Validated claims with `amr` represented as an array.
237
- * @throws ElevatedTokenInvalidError if claims are missing or invalid.
238
- */
239
- export function parseElevatedTokenClaims(payload) {
240
- const record = asRecord(payload);
241
- const ext = asRecord(record?.ext);
242
- const value = {
243
- sub: record?.sub,
244
- exp: record?.exp,
245
- aal: record?.aal ?? ext?.aal,
246
- amr: record?.amr ?? ext?.amr,
247
- };
248
- try {
249
- assert(value, ElevatedTokenClaimsStruct);
250
- }
251
- catch (error) {
252
- if (error instanceof StructError) {
253
- throw new ElevatedTokenInvalidError(formatStructError(error));
254
- }
255
- /* istanbul ignore next */
256
- throw error;
257
- }
258
- return {
259
- sub: value.sub,
260
- aal: value.aal,
261
- exp: value.exp,
262
- amr: Array.isArray(value.amr) ? value.amr : [value.amr],
263
- };
264
- }
265
- //# sourceMappingURL=schemas.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../../src/sdk/authentication-jwt-bearer/mfa/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,KAAK,EACL,OAAO,EACP,OAAO,EACP,GAAG,EACH,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,OAAO,EACP,MAAM,EACN,SAAS,EACT,IAAI,EACJ,MAAM,EACN,WAAW,EACX,IAAI,EACJ,KAAK,GACN,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,SAAS,EAAE,WAAW,CAAU,CAAC;AAEtE,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC,oBAAoB,CAAC,CAAC;AAEnE,MAAM,0BAA0B,GAAG,IAAI,CAAC;IACtC,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC;IAC3B,EAAE,EAAE,MAAM,EAAE;IACZ,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;CACtC,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;AAElC,MAAM,CAAC,MAAM,4CAA4C,GAAG,IAAI,CAAC;IAC/D,EAAE,EAAE,IAAI,CAAC;QACP,EAAE,EAAE,MAAM,EAAE;QACZ,IAAI,EAAE,MAAM,EAAE;KACf,CAAC;IACF,IAAI,EAAE,IAAI,CAAC;QACT,EAAE,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC;QACvB,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC;QACzB,WAAW,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC;KACjC,CAAC;IACF,SAAS,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AE,MAAM,EAAE,GAAG;QAChB,GAAG,EAAE,MAAM,EAAE,GAAG;QAChB,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,EAAE,GAAG;QAC5B,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,EAAE,GAAG;KAC7B,CAAC;IAEF,IAAI,CAAC;QACH,MAAM,CAAC,KAAK,EAAE,yBAAyB,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;YACjC,MAAM,IAAI,yBAAyB,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;QAChE,CAAC;QACD,0BAA0B;QAC1B,MAAM,KAAK,CAAC;IACd,CAAC;IAED,OAAO;QACL,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;KACxD,CAAC;AACJ,CAAC","sourcesContent":["import {\n array,\n assert,\n boolean,\n enums,\n integer,\n literal,\n min,\n nullable,\n object,\n optional,\n pattern,\n refine,\n sensitive,\n size,\n string,\n StructError,\n type,\n union,\n} from '@metamask/superstruct';\nimport type { Struct } from '@metamask/superstruct';\n\nimport { ElevatedTokenInvalidError, MfaError } from '../../errors.js';\nimport { asRecord } from '../../utils/as-record.js';\n\nexport const MFA_CREDENTIAL_TYPES = ['passkey', 'email_otp'] as const;\n\nexport const MfaCredentialTypeStruct = enums(MFA_CREDENTIAL_TYPES);\n\nconst CredentialDescriptorStruct = type({\n type: literal('public-key'),\n id: string(),\n transports: optional(array(string())),\n});\n\nconst ExtensionsStruct = type({});\n\nexport const PublicKeyCredentialCreationOptionsJSONStruct = type({\n rp: type({\n id: string(),\n name: string(),\n }),\n user: type({\n id: sensitive(string()),\n name: sensitive(string()),\n displayName: sensitive(string()),\n }),\n challenge: sensitive(string()),\n pubKeyCredParams: array(\n type({\n type: literal('public-key'),\n alg: integer(),\n }),\n ),\n excludeCredentials: optional(array(CredentialDescriptorStruct)),\n authenticatorSelection: optional(\n type({\n authenticatorAttachment: optional(string()),\n residentKey: optional(string()),\n requireResidentKey: optional(boolean()),\n userVerification: optional(string()),\n }),\n ),\n attestation: optional(string()),\n timeout: optional(integer()),\n extensions: optional(ExtensionsStruct),\n});\n\nexport const PublicKeyCredentialRequestOptionsJSONStruct = type({\n challenge: sensitive(string()),\n rpId: optional(string()),\n allowCredentials: optional(array(CredentialDescriptorStruct)),\n userVerification: optional(string()),\n timeout: optional(integer()),\n extensions: optional(ExtensionsStruct),\n});\n\nexport const PasskeyCreateDataStruct = type({\n publicKey: PublicKeyCredentialCreationOptionsJSONStruct,\n});\n\nexport const PasskeyRequestDataStruct = type({\n publicKey: PublicKeyCredentialRequestOptionsJSONStruct,\n});\n\nexport const RegistrationResponseJSONStruct = sensitive(\n type({\n id: string(),\n rawId: string(),\n type: literal('public-key'),\n response: type({\n attestationObject: string(),\n clientDataJSON: string(),\n transports: optional(array(string())),\n publicKeyAlgorithm: optional(integer()),\n publicKey: optional(string()),\n authenticatorData: optional(string()),\n }),\n authenticatorAttachment: optional(nullable(string())),\n clientExtensionResults: optional(ExtensionsStruct),\n }),\n);\n\nexport const AuthenticationResponseJSONStruct = sensitive(\n type({\n id: string(),\n rawId: string(),\n type: literal('public-key'),\n response: type({\n authenticatorData: string(),\n clientDataJSON: string(),\n signature: string(),\n userHandle: optional(nullable(string())),\n }),\n authenticatorAttachment: optional(nullable(string())),\n clientExtensionResults: optional(ExtensionsStruct),\n }),\n);\n\n/**\n * Only the assertion JWT is consumed from the verification response; the\n * profile fields on the wire duplicate what the login flow already resolved.\n */\nexport const MfaVerifyCompleteResponseStruct = type({\n token: sensitive(string()),\n\n expires_in: integer(),\n});\n\nexport const MfaEnrollResponseStruct = type({\n flow_id: string(),\n\n expires_at: string(),\n\n passkey_create_data: optional(sensitive(string())),\n});\n\nexport const MfaEnrollCompleteResponseStruct = type({\n status: literal('enrolled'),\n});\n\nexport const MfaVerifyResponseStruct = type({\n flow_id: string(),\n\n expires_at: string(),\n\n passkey_request_data: optional(sensitive(string())),\n});\n\nexport const MfaPasskeyDetailStruct = type({\n display_name: optional(sensitive(string())),\n\n added_at: optional(string()),\n});\n\nexport const MfaEmailDetailStruct = type({\n address: optional(sensitive(string())),\n verified: optional(boolean()),\n});\n\nexport const MfaCredentialStruct = type({\n // Intentionally accepts strings so future server credential types and\n // statuses can be ignored without making the complete response invalid.\n\n credential_type: string(),\n status: string(),\n\n enrolled_at: optional(string()),\n passkey: optional(MfaPasskeyDetailStruct),\n email: optional(MfaEmailDetailStruct),\n});\n\nexport const MfaCredentialsResponseStruct = type({\n credentials: array(MfaCredentialStruct),\n});\n\nexport const MfaErrorResponseStruct = type({\n code: optional(string()),\n message: string(),\n});\n\nexport const TokenReasonStruct = object({\n operation: pattern(string(), /^[A-Za-z0-9_.:-]{1,64}$/u),\n});\n\nexport const BeginEnrollmentRequestStruct = refine(\n object({\n type: MfaCredentialTypeStruct,\n email: optional(sensitive(size(string(), 3, 254))),\n reason: TokenReasonStruct,\n }),\n 'BeginEnrollmentRequest',\n (value) => {\n if (value.type === 'email_otp' && value.email === undefined) {\n return 'email is required for email_otp enrollment';\n }\n if (value.type === 'passkey' && value.email !== undefined) {\n return 'email is not accepted for passkey enrollment';\n }\n return true;\n },\n);\n\nconst EmailOtpCodeStruct = sensitive(pattern(string(), /^\\d{6}$/u));\n\nconst EnrollmentProofStruct = union([\n object({\n type: literal('passkey'),\n attestation: RegistrationResponseJSONStruct,\n }),\n object({\n type: literal('email_otp'),\n code: EmailOtpCodeStruct,\n }),\n]);\n\nexport const CompleteEnrollmentRequestStruct = object({\n flowId: string(),\n proof: EnrollmentProofStruct,\n reason: TokenReasonStruct,\n});\n\nexport const BeginStepUpRequestStruct = object({\n type: MfaCredentialTypeStruct,\n reason: TokenReasonStruct,\n});\n\nconst StepUpProofStruct = union([\n object({\n type: literal('passkey'),\n assertion: AuthenticationResponseJSONStruct,\n }),\n object({\n type: literal('email_otp'),\n code: EmailOtpCodeStruct,\n }),\n]);\n\nexport const CompleteStepUpRequestStruct = object({\n flowId: string(),\n proof: StepUpProofStruct,\n reason: TokenReasonStruct,\n});\n\nexport const GetElevatedTokenRequestStruct = object({\n maxSessionAgeMs: optional(min(integer(), 0)),\n});\n\nexport const ElevatedTokenClaimsStruct = type({\n sub: sensitive(string()),\n aal: literal(2),\n exp: integer(),\n amr: union([MfaCredentialTypeStruct, array(MfaCredentialTypeStruct)]),\n});\n\nfunction formatStructError(error: StructError): string {\n return error\n .failures()\n .map(({ path, message }) => `[${path.join('.')}] ${message}`)\n .join(', ');\n}\n\n/**\n * Validates data received from the authentication service.\n *\n * @param value - Untrusted response data.\n * @param struct - Expected response structure.\n * @throws MfaError if the response does not match the structure.\n */\nexport function assertValidMfaResponse<Value>(\n value: unknown,\n struct: Struct<Value>,\n): asserts value is Value {\n try {\n assert(value, struct);\n } catch (error) {\n if (error instanceof StructError) {\n throw new MfaError('invalid_response', formatStructError(error));\n }\n /* istanbul ignore next */\n throw error;\n }\n}\n\n/**\n * Validates data received from an untyped controller boundary.\n *\n * @param value - Untrusted request data.\n * @param struct - Expected request structure.\n * @throws MfaError if the request does not match the structure.\n */\nexport function assertValidMfaRequest<Value>(\n value: unknown,\n struct: Struct<Value>,\n): asserts value is Value {\n try {\n assert(value, struct);\n } catch (error) {\n if (error instanceof StructError) {\n throw new MfaError('invalid_request', formatStructError(error));\n }\n /* istanbul ignore next */\n throw error;\n }\n}\n\n/**\n * Validates and normalizes claims from an elevated access token.\n *\n * Hydra places hook-supplied claims under `ext` unless they are promoted to\n * the top level, so `aal` and `amr` are read from either location.\n *\n * @param payload - Decoded JWT payload.\n * @returns Validated claims with `amr` represented as an array.\n * @throws ElevatedTokenInvalidError if claims are missing or invalid.\n */\nexport function parseElevatedTokenClaims(payload: unknown): {\n sub: string;\n aal: 2;\n exp: number;\n amr: ('passkey' | 'email_otp')[];\n} {\n const record = asRecord(payload);\n const ext = asRecord(record?.ext);\n const value: unknown = {\n sub: record?.sub,\n exp: record?.exp,\n aal: record?.aal ?? ext?.aal,\n amr: record?.amr ?? ext?.amr,\n };\n\n try {\n assert(value, ElevatedTokenClaimsStruct);\n } catch (error) {\n if (error instanceof StructError) {\n throw new ElevatedTokenInvalidError(formatStructError(error));\n }\n /* istanbul ignore next */\n throw error;\n }\n\n return {\n sub: value.sub,\n aal: value.aal,\n exp: value.exp,\n amr: Array.isArray(value.amr) ? value.amr : [value.amr],\n };\n}\n"]}
@@ -1,104 +0,0 @@
1
- import type { Env } from '../../../shared/env.js';
2
- import type { AuthenticationResponseJSON, EnrolledCredential, MfaCredential, MfaCredentialType, MfaEnrollRequest, MfaVerifyRequest, PublicKeyCredentialCreationOptionsJSON as PasskeyCreationOptions, PublicKeyCredentialRequestOptionsJSON as PasskeyRequestOptions, RegistrationResponseJSON } from './types.js';
3
- export declare const MFA_ENROLL_URL: (env: Env) => string;
4
- export declare const MFA_ENROLL_COMPLETE_URL: (env: Env) => string;
5
- export declare const MFA_VERIFY_URL: (env: Env) => string;
6
- export declare const MFA_VERIFY_COMPLETE_URL: (env: Env) => string;
7
- export declare const MFA_CREDENTIALS_URL: (env: Env) => string;
8
- type EnrollmentServiceResult = {
9
- flowId: string;
10
- expiresAt: number;
11
- publicKey?: PasskeyCreationOptions;
12
- };
13
- type VerificationServiceResult = {
14
- flowId: string;
15
- expiresAt: number;
16
- publicKey?: PasskeyRequestOptions;
17
- };
18
- export type MfaStepUpAssertion = {
19
- /** AAL2 assertion JWT to exchange at Hydra for an elevated access token. */
20
- token: string;
21
- /** Assertion lifetime in seconds. */
22
- expiresIn: number;
23
- };
24
- type EnrollmentCompletionParams = {
25
- credential_type: MfaCredentialType;
26
- flow_id: string;
27
- otp_code?: string;
28
- passkey_attestation?: RegistrationResponseJSON;
29
- };
30
- type VerificationCompletionParams = {
31
- credential_type: MfaCredentialType;
32
- flow_id: string;
33
- otp_code?: string;
34
- passkey_assertion?: AuthenticationResponseJSON;
35
- };
36
- /**
37
- * Parses passkey creation data embedded in an enrollment response.
38
- *
39
- * @param value - JSON-encoded creation options.
40
- * @returns Validated public-key creation options.
41
- */
42
- export declare function parsePasskeyCreateData(value: string): PasskeyCreationOptions;
43
- /**
44
- * Parses passkey request data embedded in a verification response.
45
- *
46
- * @param value - JSON-encoded request options.
47
- * @returns Validated public-key request options.
48
- */
49
- export declare function parsePasskeyRequestData(value: string): PasskeyRequestOptions;
50
- /**
51
- * Begins enrollment of an MFA credential.
52
- *
53
- * @param env - Authentication environment.
54
- * @param accessToken - Primary profile access token.
55
- * @param body - Enrollment request.
56
- * @returns Validated enrollment flow data.
57
- */
58
- export declare function mfaEnroll(env: Env, accessToken: string, body: MfaEnrollRequest): Promise<EnrollmentServiceResult>;
59
- /**
60
- * Completes enrollment of an MFA credential.
61
- *
62
- * @param env - Authentication environment.
63
- * @param accessToken - Primary profile access token.
64
- * @param params - Flow identifier and enrollment proof.
65
- */
66
- export declare function mfaEnrollComplete(env: Env, accessToken: string, params: EnrollmentCompletionParams): Promise<void>;
67
- /**
68
- * Begins step-up verification with an enrolled credential.
69
- *
70
- * @param env - Authentication environment.
71
- * @param accessToken - Primary profile access token.
72
- * @param body - Verification request.
73
- * @returns Validated verification flow data.
74
- */
75
- export declare function mfaVerify(env: Env, accessToken: string, body: MfaVerifyRequest): Promise<VerificationServiceResult>;
76
- /**
77
- * Completes step-up verification with an enrolled credential.
78
- *
79
- * @param env - Authentication environment.
80
- * @param accessToken - Primary profile access token.
81
- * @param params - Flow identifier and verification proof.
82
- * @returns The AAL2 assertion JWT and its lifetime in seconds.
83
- */
84
- export declare function mfaVerifyComplete(env: Env, accessToken: string, params: VerificationCompletionParams): Promise<MfaStepUpAssertion>;
85
- /**
86
- * Maps a server credential to its public controller representation.
87
- *
88
- * Unknown credential types or statuses are dropped so the server can extend
89
- * either without invalidating the whole list.
90
- *
91
- * @param credential - Validated server credential.
92
- * @returns A supported credential, or null when it cannot be represented.
93
- */
94
- export declare function toEnrolledCredential(credential: MfaCredential): EnrolledCredential | null;
95
- /**
96
- * Gets the credentials enrolled on the canonical profile.
97
- *
98
- * @param env - Authentication environment.
99
- * @param accessToken - Primary profile access token.
100
- * @returns Supported enrolled credentials.
101
- */
102
- export declare function getMfaCredentials(env: Env, accessToken: string): Promise<EnrolledCredential[]>;
103
- export {};
104
- //# sourceMappingURL=services.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/sdk/authentication-jwt-bearer/mfa/services.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAiClD,OAAO,KAAK,EACV,0BAA0B,EAC1B,kBAAkB,EAClB,aAAa,EAEb,iBAAiB,EAEjB,gBAAgB,EAEhB,gBAAgB,EAChB,sCAAsC,IAAI,sBAAsB,EAChE,qCAAqC,IAAI,qBAAqB,EAC9D,wBAAwB,EACzB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,cAAc,QAAS,GAAG,KAAG,MACS,CAAC;AAEpD,eAAO,MAAM,uBAAuB,QAAS,GAAG,KAAG,MACS,CAAC;AAE7D,eAAO,MAAM,cAAc,QAAS,GAAG,KAAG,MACS,CAAC;AAEpD,eAAO,MAAM,uBAAuB,QAAS,GAAG,KAAG,MACS,CAAC;AAE7D,eAAO,MAAM,mBAAmB,QAAS,GAAG,KAAG,MACS,CAAC;AAEzD,KAAK,uBAAuB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACpC,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,MAAM,EAAE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