@cat-factory/contracts 0.43.0 → 0.43.2
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,11 +1,11 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
2
|
/**
|
|
3
|
-
* The personal password that gates the second encryption layer (
|
|
3
|
+
* The personal password that gates the second encryption layer (6–256 chars). Restricted
|
|
4
4
|
* to printable ASCII so the same value can ride **raw** in the `X-Personal-Password`
|
|
5
5
|
* request header (see below) when unlocking a run — HTTP header values must be Latin-1, so
|
|
6
6
|
* a non-ASCII password could not be sent without encoding. Never stored server-side.
|
|
7
7
|
*/
|
|
8
|
-
export declare const personalPasswordSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string,
|
|
8
|
+
export declare const personalPasswordSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 6, undefined>, v.MaxLengthAction<string, 256, undefined>, v.RegexAction<string, "Password must use printable ASCII characters (no tabs/newlines).">]>;
|
|
9
9
|
/**
|
|
10
10
|
* HTTP header carrying the personal password to unlock a run's individual-usage
|
|
11
11
|
* credential(s). It is an AMBIENT credential — like the bearer token, the client attaches
|
|
@@ -22,7 +22,7 @@ export declare const storePersonalSubscriptionSchema: v.ObjectSchema<{
|
|
|
22
22
|
/** The raw secret (write-only): the `claude setup-token` OAuth token for `claude`. */
|
|
23
23
|
readonly token: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
24
24
|
/** Personal password that gates the second encryption layer. Never stored. */
|
|
25
|
-
readonly password: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string,
|
|
25
|
+
readonly password: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 6, undefined>, v.MaxLengthAction<string, 256, undefined>, v.RegexAction<string, "Password must use printable ASCII characters (no tabs/newlines).">]>;
|
|
26
26
|
/**
|
|
27
27
|
* Epoch ms the subscription itself expires (so we can warn well in advance and
|
|
28
28
|
* block runs once lapsed). Optional — omit if the plan has no fixed end date.
|
|
@@ -21,12 +21,12 @@ import { subscriptionVendorSchema } from './vendor-credentials.js';
|
|
|
21
21
|
// honest threat model + the full safeguards.
|
|
22
22
|
// ---------------------------------------------------------------------------
|
|
23
23
|
/**
|
|
24
|
-
* The personal password that gates the second encryption layer (
|
|
24
|
+
* The personal password that gates the second encryption layer (6–256 chars). Restricted
|
|
25
25
|
* to printable ASCII so the same value can ride **raw** in the `X-Personal-Password`
|
|
26
26
|
* request header (see below) when unlocking a run — HTTP header values must be Latin-1, so
|
|
27
27
|
* a non-ASCII password could not be sent without encoding. Never stored server-side.
|
|
28
28
|
*/
|
|
29
|
-
export const personalPasswordSchema = v.pipe(v.string(), v.minLength(
|
|
29
|
+
export const personalPasswordSchema = v.pipe(v.string(), v.minLength(6), v.maxLength(256), v.regex(/^[\x20-\x7e]+$/, 'Password must use printable ASCII characters (no tabs/newlines).'));
|
|
30
30
|
/**
|
|
31
31
|
* HTTP header carrying the personal password to unlock a run's individual-usage
|
|
32
32
|
* credential(s). It is an AMBIENT credential — like the bearer token, the client attaches
|
|
@@ -48,7 +48,7 @@ export declare const storePersonalSubscriptionContract: {
|
|
|
48
48
|
readonly vendor: v.PicklistSchema<["claude", "codex", "glm", "kimi", "deepseek"], undefined>;
|
|
49
49
|
readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
|
|
50
50
|
readonly token: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
51
|
-
readonly password: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string,
|
|
51
|
+
readonly password: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 6, undefined>, v.MaxLengthAction<string, 256, undefined>, v.RegexAction<string, "Password must use printable ASCII characters (no tabs/newlines).">]>;
|
|
52
52
|
readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
|
|
53
53
|
}, undefined>;
|
|
54
54
|
readonly responsesByStatusCode: {
|