@seamless-auth/types 0.15.0 → 0.16.0
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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @seamless-auth/types
|
|
2
2
|
|
|
3
|
+
## 0.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 880e1d5: Publish a union for the WebAuthn error codes.
|
|
8
|
+
|
|
9
|
+
`WEBAUTHN_ERROR_CODES`, `WebAuthnErrorCodeSchema` and `WebAuthnErrorCode` cover
|
|
10
|
+
the machine-readable codes the auth API returns as the whole of an error body's
|
|
11
|
+
`error` field: `attachment_not_allowed`, `synced_passkey_not_allowed`,
|
|
12
|
+
`authenticator_not_allowed`, `prf_required` and `prf_output_not_allowed`.
|
|
13
|
+
|
|
14
|
+
This mirrors `OAUTH_ERROR_CODES` and exists for the same reason. A consumer that
|
|
15
|
+
declares its own copy of the list has no way to find out when the API adds a
|
|
16
|
+
code: it degrades to generic messaging and nothing fails anywhere. Checking a
|
|
17
|
+
local map against this union with `Record<WebAuthnErrorCode, true>` turns that
|
|
18
|
+
silent drift into a compile error.
|
|
19
|
+
|
|
20
|
+
The remaining WebAuthn failures answer with prose rather than a code, so they are
|
|
21
|
+
deliberately absent.
|
|
22
|
+
|
|
23
|
+
Additive. Nothing changes for a consumer that does not import it.
|
|
24
|
+
|
|
3
25
|
## 0.15.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
|
@@ -63,4 +63,30 @@ export declare const WebAuthnTokenSuccessSchema: z.ZodObject<{
|
|
|
63
63
|
refreshTtl: z.ZodOptional<z.ZodNumber>;
|
|
64
64
|
}, z.core.$strip>;
|
|
65
65
|
export type WebAuthnTokenSuccessResponse = z.infer<typeof WebAuthnTokenSuccessSchema>;
|
|
66
|
+
/**
|
|
67
|
+
* Machine-readable codes the auth API returns as the whole of an error body's
|
|
68
|
+
* `error` field, for WebAuthn failures a client can act on.
|
|
69
|
+
*
|
|
70
|
+
* Published here for the same reason as `OAUTH_ERROR_CODES`: a consumer that
|
|
71
|
+
* declares its own copy has no way to find out when the API adds a code, and
|
|
72
|
+
* degrades to generic messaging with nothing failing anywhere. Checking a local
|
|
73
|
+
* map against this union with `Record<WebAuthnErrorCode, true>` turns that into
|
|
74
|
+
* a compile error.
|
|
75
|
+
*
|
|
76
|
+
* The remaining WebAuthn failures answer with prose rather than a code, so they
|
|
77
|
+
* are deliberately absent rather than forgotten.
|
|
78
|
+
*/
|
|
79
|
+
export declare const WEBAUTHN_ERROR_CODES: readonly ["attachment_not_allowed", "synced_passkey_not_allowed", "authenticator_not_allowed", "prf_required", "prf_output_not_allowed"];
|
|
80
|
+
export declare const WebAuthnErrorCodeSchema: z.ZodEnum<{
|
|
81
|
+
attachment_not_allowed: "attachment_not_allowed";
|
|
82
|
+
synced_passkey_not_allowed: "synced_passkey_not_allowed";
|
|
83
|
+
authenticator_not_allowed: "authenticator_not_allowed";
|
|
84
|
+
prf_required: "prf_required";
|
|
85
|
+
prf_output_not_allowed: "prf_output_not_allowed";
|
|
86
|
+
}>;
|
|
87
|
+
export type WebAuthnErrorCode = z.infer<typeof WebAuthnErrorCodeSchema>;
|
|
88
|
+
export declare const WebAuthnErrorResponseSchema: z.ZodObject<{
|
|
89
|
+
error: z.ZodString;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
export type WebAuthnErrorResponse = z.infer<typeof WebAuthnErrorResponseSchema>;
|
|
66
92
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/webauthn/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;iBAGnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAA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C,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -55,4 +55,33 @@ export const WebAuthnTokenSuccessSchema = z.object({
|
|
|
55
55
|
ttl: z.number().optional(),
|
|
56
56
|
refreshTtl: z.number().optional(),
|
|
57
57
|
});
|
|
58
|
+
/**
|
|
59
|
+
* Machine-readable codes the auth API returns as the whole of an error body's
|
|
60
|
+
* `error` field, for WebAuthn failures a client can act on.
|
|
61
|
+
*
|
|
62
|
+
* Published here for the same reason as `OAUTH_ERROR_CODES`: a consumer that
|
|
63
|
+
* declares its own copy has no way to find out when the API adds a code, and
|
|
64
|
+
* degrades to generic messaging with nothing failing anywhere. Checking a local
|
|
65
|
+
* map against this union with `Record<WebAuthnErrorCode, true>` turns that into
|
|
66
|
+
* a compile error.
|
|
67
|
+
*
|
|
68
|
+
* The remaining WebAuthn failures answer with prose rather than a code, so they
|
|
69
|
+
* are deliberately absent rather than forgotten.
|
|
70
|
+
*/
|
|
71
|
+
export const WEBAUTHN_ERROR_CODES = [
|
|
72
|
+
/** Registration asked for an attachment the deployment's policy does not allow. */
|
|
73
|
+
'attachment_not_allowed',
|
|
74
|
+
/** The credential is backup eligible and the deployment blocks synced passkeys. */
|
|
75
|
+
'synced_passkey_not_allowed',
|
|
76
|
+
/** The authenticator model is denied, or absent from a non-empty allow list. */
|
|
77
|
+
'authenticator_not_allowed',
|
|
78
|
+
/** Registration required a PRF-capable credential and the one offered was not. */
|
|
79
|
+
'prf_required',
|
|
80
|
+
/** An assertion carried PRF output, which must never leave the client. */
|
|
81
|
+
'prf_output_not_allowed',
|
|
82
|
+
];
|
|
83
|
+
export const WebAuthnErrorCodeSchema = z.enum(WEBAUTHN_ERROR_CODES);
|
|
84
|
+
export const WebAuthnErrorResponseSchema = z.object({
|
|
85
|
+
error: z.string(),
|
|
86
|
+
});
|
|
58
87
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/schemas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EAAE,CAAC,CAAC,QAAQ,EAAE;IACrC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAEvC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC;AAIH;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,mFAAmF;IACnF,wBAAwB;IACxB,mFAAmF;IACnF,4BAA4B;IAC5B,gFAAgF;IAChF,2BAA2B;IAC3B,kFAAkF;IAClF,cAAc;IACd,0EAA0E;IAC1E,wBAAwB;CAChB,CAAC;AAEX,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAIpE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -80,3 +80,39 @@ export const WebAuthnTokenSuccessSchema = z.object({
|
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
export type WebAuthnTokenSuccessResponse = z.infer<typeof WebAuthnTokenSuccessSchema>;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Machine-readable codes the auth API returns as the whole of an error body's
|
|
86
|
+
* `error` field, for WebAuthn failures a client can act on.
|
|
87
|
+
*
|
|
88
|
+
* Published here for the same reason as `OAUTH_ERROR_CODES`: a consumer that
|
|
89
|
+
* declares its own copy has no way to find out when the API adds a code, and
|
|
90
|
+
* degrades to generic messaging with nothing failing anywhere. Checking a local
|
|
91
|
+
* map against this union with `Record<WebAuthnErrorCode, true>` turns that into
|
|
92
|
+
* a compile error.
|
|
93
|
+
*
|
|
94
|
+
* The remaining WebAuthn failures answer with prose rather than a code, so they
|
|
95
|
+
* are deliberately absent rather than forgotten.
|
|
96
|
+
*/
|
|
97
|
+
export const WEBAUTHN_ERROR_CODES = [
|
|
98
|
+
/** Registration asked for an attachment the deployment's policy does not allow. */
|
|
99
|
+
'attachment_not_allowed',
|
|
100
|
+
/** The credential is backup eligible and the deployment blocks synced passkeys. */
|
|
101
|
+
'synced_passkey_not_allowed',
|
|
102
|
+
/** The authenticator model is denied, or absent from a non-empty allow list. */
|
|
103
|
+
'authenticator_not_allowed',
|
|
104
|
+
/** Registration required a PRF-capable credential and the one offered was not. */
|
|
105
|
+
'prf_required',
|
|
106
|
+
/** An assertion carried PRF output, which must never leave the client. */
|
|
107
|
+
'prf_output_not_allowed',
|
|
108
|
+
] as const;
|
|
109
|
+
|
|
110
|
+
export const WebAuthnErrorCodeSchema = z.enum(WEBAUTHN_ERROR_CODES);
|
|
111
|
+
|
|
112
|
+
export type WebAuthnErrorCode = z.infer<typeof WebAuthnErrorCodeSchema>;
|
|
113
|
+
|
|
114
|
+
export const WebAuthnErrorResponseSchema = z.object({
|
|
115
|
+
error: z.string(),
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export type WebAuthnErrorResponse = z.infer<typeof WebAuthnErrorResponseSchema>;
|