@schemavaults/auth-common 0.10.15 → 0.12.1

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.
@@ -1,15 +1,125 @@
1
1
  import { z } from "zod";
2
- export declare const authenticateResultSchema: z.ZodObject<{
2
+ export declare const authenticatedAuthenticateResultSchema: z.ZodObject<{
3
+ kind: z.ZodLiteral<"authenticated">;
4
+ success: z.ZodBoolean;
5
+ message: z.ZodString;
6
+ authorization_code: z.ZodString;
7
+ }, "strict", z.ZodTypeAny, {
8
+ message: string;
9
+ authorization_code: string;
10
+ kind: "authenticated";
11
+ success: boolean;
12
+ }, {
13
+ message: string;
14
+ authorization_code: string;
15
+ kind: "authenticated";
16
+ success: boolean;
17
+ }>;
18
+ export type AuthenticatedAuthenticateResult = z.infer<typeof authenticatedAuthenticateResultSchema>;
19
+ export declare const mfaRequiredAuthenticateResultSchema: z.ZodObject<{
20
+ kind: z.ZodLiteral<"mfa_required">;
21
+ success: z.ZodBoolean;
22
+ message: z.ZodString;
23
+ challenge_id: z.ZodString;
24
+ expires_at: z.ZodNumber;
25
+ }, "strict", z.ZodTypeAny, {
26
+ message: string;
27
+ expires_at: number;
28
+ kind: "mfa_required";
29
+ success: boolean;
30
+ challenge_id: string;
31
+ }, {
32
+ message: string;
33
+ expires_at: number;
34
+ kind: "mfa_required";
35
+ success: boolean;
36
+ challenge_id: string;
37
+ }>;
38
+ export type MfaRequiredAuthenticateResult = z.infer<typeof mfaRequiredAuthenticateResultSchema>;
39
+ export declare const authenticateFailureResultSchema: z.ZodObject<{
40
+ kind: z.ZodLiteral<"failure">;
41
+ success: z.ZodBoolean;
3
42
  message: z.ZodString;
4
- authorization_code: z.ZodOptional<z.ZodString>;
43
+ }, "strict", z.ZodTypeAny, {
44
+ message: string;
45
+ kind: "failure";
46
+ success: boolean;
47
+ }, {
48
+ message: string;
49
+ kind: "failure";
50
+ success: boolean;
51
+ }>;
52
+ export type AuthenticateFailureResult = z.infer<typeof authenticateFailureResultSchema>;
53
+ export declare const challengeExpiredAuthenticateResultSchema: z.ZodObject<{
54
+ kind: z.ZodLiteral<"challenge_expired">;
5
55
  success: z.ZodBoolean;
56
+ message: z.ZodString;
6
57
  }, "strict", z.ZodTypeAny, {
7
58
  message: string;
59
+ kind: "challenge_expired";
8
60
  success: boolean;
9
- authorization_code?: string | undefined;
10
61
  }, {
11
62
  message: string;
63
+ kind: "challenge_expired";
12
64
  success: boolean;
13
- authorization_code?: string | undefined;
14
65
  }>;
66
+ export type ChallengeExpiredAuthenticateResult = z.infer<typeof challengeExpiredAuthenticateResultSchema>;
67
+ export declare const authenticateResultSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
68
+ kind: z.ZodLiteral<"authenticated">;
69
+ success: z.ZodBoolean;
70
+ message: z.ZodString;
71
+ authorization_code: z.ZodString;
72
+ }, "strict", z.ZodTypeAny, {
73
+ message: string;
74
+ authorization_code: string;
75
+ kind: "authenticated";
76
+ success: boolean;
77
+ }, {
78
+ message: string;
79
+ authorization_code: string;
80
+ kind: "authenticated";
81
+ success: boolean;
82
+ }>, z.ZodObject<{
83
+ kind: z.ZodLiteral<"mfa_required">;
84
+ success: z.ZodBoolean;
85
+ message: z.ZodString;
86
+ challenge_id: z.ZodString;
87
+ expires_at: z.ZodNumber;
88
+ }, "strict", z.ZodTypeAny, {
89
+ message: string;
90
+ expires_at: number;
91
+ kind: "mfa_required";
92
+ success: boolean;
93
+ challenge_id: string;
94
+ }, {
95
+ message: string;
96
+ expires_at: number;
97
+ kind: "mfa_required";
98
+ success: boolean;
99
+ challenge_id: string;
100
+ }>, z.ZodObject<{
101
+ kind: z.ZodLiteral<"failure">;
102
+ success: z.ZodBoolean;
103
+ message: z.ZodString;
104
+ }, "strict", z.ZodTypeAny, {
105
+ message: string;
106
+ kind: "failure";
107
+ success: boolean;
108
+ }, {
109
+ message: string;
110
+ kind: "failure";
111
+ success: boolean;
112
+ }>, z.ZodObject<{
113
+ kind: z.ZodLiteral<"challenge_expired">;
114
+ success: z.ZodBoolean;
115
+ message: z.ZodString;
116
+ }, "strict", z.ZodTypeAny, {
117
+ message: string;
118
+ kind: "challenge_expired";
119
+ success: boolean;
120
+ }, {
121
+ message: string;
122
+ kind: "challenge_expired";
123
+ success: boolean;
124
+ }>]>;
15
125
  export type AuthenticateResult = z.infer<typeof authenticateResultSchema>;
@@ -1,12 +1,46 @@
1
1
  import { z } from "zod";
2
- export const authenticateResultSchema = z.object({
2
+ export const authenticatedAuthenticateResultSchema = z
3
+ .object({
4
+ kind: z.literal("authenticated"),
3
5
  success: z.boolean(),
4
6
  message: z.string(),
5
- authorization_code: z.string()
6
- .min(43, 'Authorization code must be at least 43 characters long')
7
- .optional()
8
- }).required({
9
- success: true,
10
- message: true
11
- }).strict();
7
+ authorization_code: z
8
+ .string()
9
+ .min(43, "Authorization code must be at least 43 characters long"),
10
+ })
11
+ .strict();
12
+ export const mfaRequiredAuthenticateResultSchema = z
13
+ .object({
14
+ kind: z.literal("mfa_required"),
15
+ success: z.boolean(),
16
+ message: z.string(),
17
+ challenge_id: z.string().uuid(),
18
+ expires_at: z.number().int().positive(),
19
+ })
20
+ .strict();
21
+ export const authenticateFailureResultSchema = z
22
+ .object({
23
+ kind: z.literal("failure"),
24
+ success: z.boolean(),
25
+ message: z.string(),
26
+ })
27
+ .strict();
28
+ // Returned by /api/auth/mfa/verify with HTTP 410 when an in-flight MFA
29
+ // challenge has been invalidated — either by exhausting the per-challenge
30
+ // attempt cap or by expiring (TTL elapsed). Distinct from `failure` so
31
+ // clients can navigate the user back to the login page rather than letting
32
+ // them retry against a key that no longer exists in Redis.
33
+ export const challengeExpiredAuthenticateResultSchema = z
34
+ .object({
35
+ kind: z.literal("challenge_expired"),
36
+ success: z.boolean(),
37
+ message: z.string(),
38
+ })
39
+ .strict();
40
+ export const authenticateResultSchema = z.discriminatedUnion("kind", [
41
+ authenticatedAuthenticateResultSchema,
42
+ mfaRequiredAuthenticateResultSchema,
43
+ authenticateFailureResultSchema,
44
+ challengeExpiredAuthenticateResultSchema,
45
+ ]);
12
46
  //# sourceMappingURL=authenticate_result.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"authenticate_result.js","sourceRoot":"","sources":["../src/authenticate_result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;SAC3B,GAAG,CAAC,EAAE,EAAE,wDAAwD,CAAC;SACjE,QAAQ,EAAE;CACd,CAAC,CAAC,QAAQ,CAAC;IACV,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;CACd,CAAC,CAAC,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"authenticate_result.js","sourceRoot":"","sources":["../src/authenticate_result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC;KACnD,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;IAChC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,kBAAkB,EAAE,CAAC;SAClB,MAAM,EAAE;SACR,GAAG,CAAC,EAAE,EAAE,wDAAwD,CAAC;CACrE,CAAC;KACD,MAAM,EAAE,CAAC;AAMZ,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC;KACjD,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC;IAC/B,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC/B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC;KACD,MAAM,EAAE,CAAC;AAMZ,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC;KAC7C,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC;KACD,MAAM,EAAE,CAAC;AAMZ,uEAAuE;AACvE,0EAA0E;AAC1E,uEAAuE;AACvE,2EAA2E;AAC3E,2DAA2D;AAC3D,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC;KACtD,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC;IACpC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC;KACD,MAAM,EAAE,CAAC;AAMZ,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACnE,qCAAqC;IACrC,mCAAmC;IACnC,+BAA+B;IAC/B,wCAAwC;CACzC,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -10,7 +10,8 @@ export * from "./middleware";
10
10
  export type * from "./middleware";
11
11
  export * from "./pkce";
12
12
  export type * from "./pkce";
13
- export { authenticateResultSchema, type AuthenticateResult, } from "./authenticate_result";
13
+ export { authenticateResultSchema, authenticatedAuthenticateResultSchema, mfaRequiredAuthenticateResultSchema, authenticateFailureResultSchema, challengeExpiredAuthenticateResultSchema, type AuthenticateResult, type AuthenticatedAuthenticateResult, type MfaRequiredAuthenticateResult, type AuthenticateFailureResult, type ChallengeExpiredAuthenticateResult, } from "./authenticate_result";
14
+ export * from "./mfa";
14
15
  export { requestTokensResultSchema, type RequestTokensResult, successfullyGeneratedTokensRecordSchema, type SuccessfullyGeneratedTokensRecord, } from "./request_tokens_result";
15
16
  export * from "./auth_acquire_tokens_grant_types";
16
17
  export type * from "./auth_acquire_tokens_grant_types";
package/dist/index.js CHANGED
@@ -5,7 +5,8 @@ export * from "./credentials";
5
5
  export * from "./token-data";
6
6
  export * from "./middleware";
7
7
  export * from "./pkce";
8
- export { authenticateResultSchema, } from "./authenticate_result";
8
+ export { authenticateResultSchema, authenticatedAuthenticateResultSchema, mfaRequiredAuthenticateResultSchema, authenticateFailureResultSchema, challengeExpiredAuthenticateResultSchema, } from "./authenticate_result";
9
+ export * from "./mfa";
9
10
  export { requestTokensResultSchema, successfullyGeneratedTokensRecordSchema, } from "./request_tokens_result";
10
11
  export * from "./auth_acquire_tokens_grant_types";
11
12
  export { PRODUCTION_AUTH_SERVER_URL } from "@schemavaults/app-definitions";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,cAAc,GACf,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,cAAc,EAAiB,MAAM,aAAa,CAAC;AAE5D,cAAc,eAAe,CAAC;AAG9B,mBAAmB;AACnB,cAAc,cAAc,CAAC;AAM7B,cAAc,cAAc,CAAC;AAG7B,cAAc,QAAQ,CAAC;AAGvB,OAAO,EACL,wBAAwB,GAEzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,yBAAyB,EAEzB,uCAAuC,GAExC,MAAM,yBAAyB,CAAC;AAEjC,cAAc,mCAAmC,CAAC;AAGlD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAA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,EACzB,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { mfaFactorTypes, mfaFactorTypeSchema, isValidMfaFactorType, type MfaFactorType, } from "./mfa-factor-type";
2
+ export { mfaChallengeSchema, type MfaChallengeDescriptor, } from "./mfa-challenge";
3
+ export { totpCodeSchema, recoveryCodeSchema, mfaVerifyBodySchema, mfaEnrollResponseSchema, mfaVerifyEnrollmentBodySchema, mfaVerifyEnrollmentResponseSchema, mfaStatusResponseSchema, mfaCodeOnlyBodySchema, type MfaVerifyBody, type MfaEnrollResponse, type MfaVerifyEnrollmentBody, type MfaVerifyEnrollmentResponse, type MfaStatusResponse, type MfaCodeOnlyBody, } from "./mfa-verify-body";
@@ -0,0 +1,4 @@
1
+ export { mfaFactorTypes, mfaFactorTypeSchema, isValidMfaFactorType, } from "./mfa-factor-type";
2
+ export { mfaChallengeSchema, } from "./mfa-challenge";
3
+ export { totpCodeSchema, recoveryCodeSchema, mfaVerifyBodySchema, mfaEnrollResponseSchema, mfaVerifyEnrollmentBodySchema, mfaVerifyEnrollmentResponseSchema, mfaStatusResponseSchema, mfaCodeOnlyBodySchema, } from "./mfa-verify-body";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mfa/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,oBAAoB,GAErB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,kBAAkB,GAEnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,6BAA6B,EAC7B,iCAAiC,EACjC,uBAAuB,EACvB,qBAAqB,GAOtB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ export declare const mfaChallengeSchema: z.ZodObject<{
3
+ challenge_id: z.ZodString;
4
+ expires_at: z.ZodNumber;
5
+ }, "strict", z.ZodTypeAny, {
6
+ expires_at: number;
7
+ challenge_id: string;
8
+ }, {
9
+ expires_at: number;
10
+ challenge_id: string;
11
+ }>;
12
+ export type MfaChallengeDescriptor = z.infer<typeof mfaChallengeSchema>;
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ export const mfaChallengeSchema = z
3
+ .object({
4
+ challenge_id: z.string().uuid(),
5
+ expires_at: z.number().int().positive(),
6
+ })
7
+ .strict();
8
+ //# sourceMappingURL=mfa-challenge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mfa-challenge.js","sourceRoot":"","sources":["../../src/mfa/mfa-challenge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,MAAM,CAAC;IACN,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC/B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC;KACD,MAAM,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { z } from "zod";
2
+ export declare const mfaFactorTypes: readonly ["totp"];
3
+ export declare const mfaFactorTypeSchema: z.ZodEnum<["totp"]>;
4
+ export type MfaFactorType = z.infer<typeof mfaFactorTypeSchema>;
5
+ export declare function isValidMfaFactorType(value: unknown): value is MfaFactorType;
@@ -0,0 +1,7 @@
1
+ import { z } from "zod";
2
+ export const mfaFactorTypes = ["totp"];
3
+ export const mfaFactorTypeSchema = z.enum(mfaFactorTypes);
4
+ export function isValidMfaFactorType(value) {
5
+ return mfaFactorTypeSchema.safeParse(value).success;
6
+ }
7
+ //# sourceMappingURL=mfa-factor-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mfa-factor-type.js","sourceRoot":"","sources":["../../src/mfa/mfa-factor-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAM,CAAU,CAAC;AAEhD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAI1D,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,OAAO,mBAAmB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACtD,CAAC"}
@@ -0,0 +1,117 @@
1
+ import { z } from "zod";
2
+ export declare const totpCodeSchema: z.ZodString;
3
+ export declare const recoveryCodeSchema: z.ZodString;
4
+ export declare const mfaVerifyBodySchema: z.ZodObject<{
5
+ challenge_id: z.ZodString;
6
+ client_app_id: z.ZodUnion<readonly [z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-web" | "schemavaults-cli", string>]>;
7
+ proof: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
8
+ type: z.ZodLiteral<"totp">;
9
+ code: z.ZodString;
10
+ }, "strict", z.ZodTypeAny, {
11
+ code: string;
12
+ type: "totp";
13
+ }, {
14
+ code: string;
15
+ type: "totp";
16
+ }>, z.ZodObject<{
17
+ type: z.ZodLiteral<"recovery_code">;
18
+ recovery_code: z.ZodString;
19
+ }, "strict", z.ZodTypeAny, {
20
+ type: "recovery_code";
21
+ recovery_code: string;
22
+ }, {
23
+ type: "recovery_code";
24
+ recovery_code: string;
25
+ }>]>;
26
+ }, "strict", z.ZodTypeAny, {
27
+ client_app_id: string;
28
+ challenge_id: string;
29
+ proof: {
30
+ code: string;
31
+ type: "totp";
32
+ } | {
33
+ type: "recovery_code";
34
+ recovery_code: string;
35
+ };
36
+ }, {
37
+ client_app_id: string;
38
+ challenge_id: string;
39
+ proof: {
40
+ code: string;
41
+ type: "totp";
42
+ } | {
43
+ type: "recovery_code";
44
+ recovery_code: string;
45
+ };
46
+ }>;
47
+ export type MfaVerifyBody = z.infer<typeof mfaVerifyBodySchema>;
48
+ export declare const mfaEnrollResponseSchema: z.ZodObject<{
49
+ factor_id: z.ZodString;
50
+ factor_type: z.ZodLiteral<"totp">;
51
+ otpauth_url: z.ZodString;
52
+ qr_code_data_url: z.ZodString;
53
+ secret: z.ZodString;
54
+ }, "strict", z.ZodTypeAny, {
55
+ factor_id: string;
56
+ factor_type: "totp";
57
+ otpauth_url: string;
58
+ qr_code_data_url: string;
59
+ secret: string;
60
+ }, {
61
+ factor_id: string;
62
+ factor_type: "totp";
63
+ otpauth_url: string;
64
+ qr_code_data_url: string;
65
+ secret: string;
66
+ }>;
67
+ export type MfaEnrollResponse = z.infer<typeof mfaEnrollResponseSchema>;
68
+ export declare const mfaVerifyEnrollmentBodySchema: z.ZodObject<{
69
+ factor_id: z.ZodString;
70
+ code: z.ZodString;
71
+ }, "strict", z.ZodTypeAny, {
72
+ code: string;
73
+ factor_id: string;
74
+ }, {
75
+ code: string;
76
+ factor_id: string;
77
+ }>;
78
+ export type MfaVerifyEnrollmentBody = z.infer<typeof mfaVerifyEnrollmentBodySchema>;
79
+ export declare const mfaVerifyEnrollmentResponseSchema: z.ZodObject<{
80
+ success: z.ZodLiteral<true>;
81
+ recovery_codes: z.ZodArray<z.ZodString, "many">;
82
+ }, "strict", z.ZodTypeAny, {
83
+ success: true;
84
+ recovery_codes: string[];
85
+ }, {
86
+ success: true;
87
+ recovery_codes: string[];
88
+ }>;
89
+ export type MfaVerifyEnrollmentResponse = z.infer<typeof mfaVerifyEnrollmentResponseSchema>;
90
+ export declare const mfaStatusResponseSchema: z.ZodObject<{
91
+ enabled: z.ZodBoolean;
92
+ factor_id: z.ZodOptional<z.ZodString>;
93
+ factor_type: z.ZodOptional<z.ZodLiteral<"totp">>;
94
+ verified_at: z.ZodOptional<z.ZodNumber>;
95
+ recovery_codes_remaining: z.ZodOptional<z.ZodNumber>;
96
+ }, "strict", z.ZodTypeAny, {
97
+ enabled: boolean;
98
+ factor_id?: string | undefined;
99
+ factor_type?: "totp" | undefined;
100
+ verified_at?: number | undefined;
101
+ recovery_codes_remaining?: number | undefined;
102
+ }, {
103
+ enabled: boolean;
104
+ factor_id?: string | undefined;
105
+ factor_type?: "totp" | undefined;
106
+ verified_at?: number | undefined;
107
+ recovery_codes_remaining?: number | undefined;
108
+ }>;
109
+ export type MfaStatusResponse = z.infer<typeof mfaStatusResponseSchema>;
110
+ export declare const mfaCodeOnlyBodySchema: z.ZodObject<{
111
+ code: z.ZodString;
112
+ }, "strict", z.ZodTypeAny, {
113
+ code: string;
114
+ }, {
115
+ code: string;
116
+ }>;
117
+ export type MfaCodeOnlyBody = z.infer<typeof mfaCodeOnlyBodySchema>;
@@ -0,0 +1,57 @@
1
+ import { z } from "zod";
2
+ import { appIdSchema } from "@schemavaults/app-definitions";
3
+ export const totpCodeSchema = z
4
+ .string()
5
+ .regex(/^\d{6}$/u, "TOTP code must be exactly 6 digits");
6
+ export const recoveryCodeSchema = z
7
+ .string()
8
+ .min(8)
9
+ .max(64);
10
+ export const mfaVerifyBodySchema = z
11
+ .object({
12
+ challenge_id: z.string().uuid(),
13
+ client_app_id: appIdSchema,
14
+ proof: z.discriminatedUnion("type", [
15
+ z.object({ type: z.literal("totp"), code: totpCodeSchema }).strict(),
16
+ z
17
+ .object({ type: z.literal("recovery_code"), recovery_code: recoveryCodeSchema })
18
+ .strict(),
19
+ ]),
20
+ })
21
+ .strict();
22
+ export const mfaEnrollResponseSchema = z
23
+ .object({
24
+ factor_id: z.string().uuid(),
25
+ factor_type: z.literal("totp"),
26
+ otpauth_url: z.string().url(),
27
+ qr_code_data_url: z.string().min(1),
28
+ secret: z.string().min(16),
29
+ })
30
+ .strict();
31
+ export const mfaVerifyEnrollmentBodySchema = z
32
+ .object({
33
+ factor_id: z.string().uuid(),
34
+ code: totpCodeSchema,
35
+ })
36
+ .strict();
37
+ export const mfaVerifyEnrollmentResponseSchema = z
38
+ .object({
39
+ success: z.literal(true),
40
+ recovery_codes: z.array(recoveryCodeSchema).min(1),
41
+ })
42
+ .strict();
43
+ export const mfaStatusResponseSchema = z
44
+ .object({
45
+ enabled: z.boolean(),
46
+ factor_id: z.string().uuid().optional(),
47
+ factor_type: z.literal("totp").optional(),
48
+ verified_at: z.number().int().positive().optional(),
49
+ recovery_codes_remaining: z.number().int().nonnegative().optional(),
50
+ })
51
+ .strict();
52
+ export const mfaCodeOnlyBodySchema = z
53
+ .object({
54
+ code: totpCodeSchema,
55
+ })
56
+ .strict();
57
+ //# sourceMappingURL=mfa-verify-body.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mfa-verify-body.js","sourceRoot":"","sources":["../../src/mfa/mfa-verify-body.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,MAAM,EAAE;KACR,KAAK,CAAC,UAAU,EAAE,oCAAoC,CAAC,CAAC;AAE3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC,CAAC;AAEX,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC;KACjC,MAAM,CAAC;IACN,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC/B,aAAa,EAAE,WAAW;IAC1B,KAAK,EAAE,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;QAClC,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;QACpE,CAAC;aACE,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,aAAa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,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACnD,wBAAwB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;CACpE,CAAC;KACD,MAAM,EAAE,CAAC;AAIZ,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC;KACnC,MAAM,CAAC;IACN,IAAI,EAAE,cAAc;CACrB,CAAC;KACD,MAAM,EAAE,CAAC"}
@@ -26,12 +26,41 @@ export async function decodeJWTs({ token_sources, decodeJWT, jwt_audience }, deb
26
26
  if (debug && successfulDecodeResult) {
27
27
  console.log(`[decodeJWTs] Decoded ${n_successful_decode_results}/${n_token_sources} tokens successfully.`);
28
28
  }
29
+ function describeTokenSource(source) {
30
+ const hint = typeof source.sourceHint === "string" && source.sourceHint.length > 0
31
+ ? source.sourceHint
32
+ : "(no source hint)";
33
+ return `source: '${hint}', type: '${source.type}'`;
34
+ }
29
35
  if (!successfulDecodeResult) {
36
+ const rejectedDescriptions = [];
37
+ const rejectionReasons = [];
38
+ decodeResults.forEach((result, index) => {
39
+ if (result.status !== "rejected")
40
+ return;
41
+ const source = token_sources[index];
42
+ const sourceDescription = source !== undefined
43
+ ? describeTokenSource(source)
44
+ : `source: '(unknown, index=${index})', type: '(unknown)'`;
45
+ const reason = result.reason;
46
+ const reasonMessage = reason instanceof Error
47
+ ? reason.message
48
+ : typeof reason === "string"
49
+ ? reason
50
+ : "Unknown error";
51
+ rejectedDescriptions.push(`{ ${sourceDescription}, error: ${reasonMessage} }`);
52
+ rejectionReasons.push(reason);
53
+ });
30
54
  const errorMessage = n_token_sources > 1
31
- ? `Failed to decode any of the ${n_token_sources} provided JWTs`
32
- : "Failed to decode the single JWT that was provided!";
55
+ ? `Failed to decode any of the ${n_token_sources} provided JWTs [${rejectedDescriptions.join("; ")}]`
56
+ : `Failed to decode the single JWT that was provided! [${rejectedDescriptions.join("; ")}]`;
33
57
  console.warn(errorMessage);
34
- throw new Error(errorMessage);
58
+ const cause = rejectionReasons.length === 0
59
+ ? undefined
60
+ : rejectionReasons.length === 1
61
+ ? rejectionReasons[0]
62
+ : new AggregateError(rejectionReasons, errorMessage);
63
+ throw new Error(errorMessage, cause === undefined ? undefined : { cause });
35
64
  }
36
65
  function validateSameInfoAcrossTokens() {
37
66
  const uids_set = new Set();
@@ -1 +1 @@
1
- {"version":3,"file":"decode-jwts.js","sourceRoot":"","sources":["../../src/middleware/decode-jwts.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAkC,EAC1E,QAAiB,KAAK;IAEtB,MAAM,eAAe,GAAW,aAAa,CAAC,MAAM,CAAC;IACrD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,eAAe,KAAK,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,CAAC,MAAM,CACZ,OAAO,eAAe,KAAK,QAAQ,IAAI,eAAe,GAAG,CAAC,EAC1D,oFAAoF,CACrF,CAAC;IAEF,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,mBAAmB,GAAwB,aAAa,CAAC,GAAG,CAAC,UACjE,KAAkC;QAElC,MAAM,IAAI,GAAmB,KAAK,CAAC,IAAI,CAAC;QAExC,MAAM,cAAc,GAAsB,SAAS,CAAC;YAClD,IAAI;YACJ,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,YAAY;SACb,CAAC,CAAC;QACH,OAAO,cAAc,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,MAAM,aAAa,GACjB,MAAM,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;IAEhD,MAAM,uBAAu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@@
1
1
  {
2
2
  "name": "@schemavaults/auth-common",
3
3
  "description": "Types and utility functions for authentication and authorization",
4
- "version": "0.10.15",
4
+ "version": "0.12.1",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
7
7
  "repository": {