@fabrika/iam-contract 0.9.0-dev.4 → 0.9.0-dev.41

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.
@@ -0,0 +1,34 @@
1
+ /** The minimum of an installation that never set one: NIST SP 800-63B's for a password that is the only factor. */
2
+ export declare const PASSWORD_DEFAULT_MIN_LENGTH = 15;
3
+ /**
4
+ * The lowest minimum IAM accepts on a runtime whose verifiers meet OWASP's PBKDF2 cost. Below it a password is a PIN, and
5
+ * no throttle makes it one a person can be trusted with.
6
+ */
7
+ export declare const PASSWORD_MIN_LENGTH_FLOOR = 4;
8
+ /** The most code points a password may have, whatever the minimum. */
9
+ export declare const PASSWORD_MAX_LENGTH = 256;
10
+ /** Below this NIST asks for a second factor, which IAM gives only an enrolled administrator; the console says so. */
11
+ export declare const PASSWORD_SINGLE_FACTOR_FLOOR = 8;
12
+ /** The password policy as IAM applies it now. */
13
+ export interface PasswordPolicyDto {
14
+ /** The minimum length in Unicode code points that IAM applies to every new password. */
15
+ minLength: number;
16
+ /** The minimum of an installation that never set one, `PASSWORD_DEFAULT_MIN_LENGTH`. */
17
+ defaultMinLength: number;
18
+ /**
19
+ * The lowest minimum this IAM accepts. `PASSWORD_MIN_LENGTH_FLOOR` where verifiers meet OWASP's PBKDF2 cost; the
20
+ * default on a runtime whose cost is lower (a Cloudflare Worker, backlog 201), where a short password is cheap to
21
+ * crack offline.
22
+ */
23
+ minLengthFloor: number;
24
+ /** The most code points a password may have. */
25
+ maxLength: number;
26
+ /** Whether the installation enables password sign-in at all; the minimum waits for it when it does not. */
27
+ passwordEnabled: boolean;
28
+ /** When an administrator last changed the minimum, in epoch seconds; null when nobody ever did. */
29
+ updatedAt: number | null;
30
+ }
31
+ export interface SetPasswordPolicyRequest {
32
+ /** A whole number from `minLengthFloor` to `maxLength`. */
33
+ minLength: number;
34
+ }