@pithy-sh/core 0.4.0 → 0.5.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/dist/error/http.d.ts +12 -0
- package/dist/error/http.d.ts.map +1 -1
- package/dist/error/payload.d.ts +24 -0
- package/dist/error/payload.d.ts.map +1 -1
- package/dist/error/payload.js +8 -0
- package/dist/http/authContext.d.ts +1 -0
- package/dist/http/authContext.d.ts.map +1 -1
- package/dist/http/authContext.js +2 -1
- package/dist/logger/record.d.ts +7 -0
- package/dist/logger/record.d.ts.map +1 -1
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/package.json +1 -1
- package/src/error/payload.ts +21 -0
- package/src/http/authContext.ts +6 -0
- package/src/version.generated.ts +1 -1
package/dist/error/http.d.ts
CHANGED
|
@@ -46,6 +46,11 @@ export declare const HttpError: z.ZodCodec<z.ZodUnion<readonly [z.ZodDiscriminat
|
|
|
46
46
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
47
47
|
code: z.ZodLiteral<"auth/provider_unavailable">;
|
|
48
48
|
status: z.ZodLiteral<503>;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
message: z.ZodString;
|
|
51
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
52
|
+
code: z.ZodLiteral<"auth/session_not_fresh">;
|
|
53
|
+
status: z.ZodLiteral<403>;
|
|
49
54
|
}, z.core.$strip>, z.ZodObject<{
|
|
50
55
|
message: z.ZodString;
|
|
51
56
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -674,6 +679,13 @@ export declare const HttpError: z.ZodCodec<z.ZodUnion<readonly [z.ZodDiscriminat
|
|
|
674
679
|
detail: z.ZodOptional<z.ZodString>;
|
|
675
680
|
code: z.ZodLiteral<"auth/provider_unavailable">;
|
|
676
681
|
status: z.ZodLiteral<503>;
|
|
682
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
683
|
+
message: z.ZodString;
|
|
684
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
685
|
+
action: z.ZodOptional<z.ZodString>;
|
|
686
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
687
|
+
code: z.ZodLiteral<"auth/session_not_fresh">;
|
|
688
|
+
status: z.ZodLiteral<403>;
|
|
677
689
|
}, z.core.$strip>, z.ZodObject<{
|
|
678
690
|
message: z.ZodString;
|
|
679
691
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
package/dist/error/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/error/http.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAA4B,UAAU,EAAmB,MAAM,cAAc,CAAC;AAErF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/error/http.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAA4B,UAAU,EAAmB,MAAM,cAAc,CAAC;AAErF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA8BpB,CAAC;AAeH;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,KAAK,GAAG,UAAU,CAInD;AAED,gGAAgG;AAChG,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,GAAG,QAAQ,CAKxE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,GAAG,QAAQ,CAElE"}
|
package/dist/error/payload.d.ts
CHANGED
|
@@ -48,6 +48,11 @@ export declare const KitPublicErrorPayload: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
48
48
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
49
49
|
code: z.ZodLiteral<"auth/provider_unavailable">;
|
|
50
50
|
status: z.ZodLiteral<503>;
|
|
51
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
52
|
+
message: z.ZodString;
|
|
53
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
54
|
+
code: z.ZodLiteral<"auth/session_not_fresh">;
|
|
55
|
+
status: z.ZodLiteral<403>;
|
|
51
56
|
}, z.core.$strip>, z.ZodObject<{
|
|
52
57
|
message: z.ZodString;
|
|
53
58
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -677,6 +682,13 @@ export declare const KitErrorPayload: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
677
682
|
detail: z.ZodOptional<z.ZodString>;
|
|
678
683
|
code: z.ZodLiteral<"auth/provider_unavailable">;
|
|
679
684
|
status: z.ZodLiteral<503>;
|
|
685
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
686
|
+
message: z.ZodString;
|
|
687
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
688
|
+
action: z.ZodOptional<z.ZodString>;
|
|
689
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
690
|
+
code: z.ZodLiteral<"auth/session_not_fresh">;
|
|
691
|
+
status: z.ZodLiteral<403>;
|
|
680
692
|
}, z.core.$strip>, z.ZodObject<{
|
|
681
693
|
message: z.ZodString;
|
|
682
694
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -1551,6 +1563,11 @@ export declare const PublicErrorPayload: z.ZodUnion<readonly [z.ZodDiscriminated
|
|
|
1551
1563
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1552
1564
|
code: z.ZodLiteral<"auth/provider_unavailable">;
|
|
1553
1565
|
status: z.ZodLiteral<503>;
|
|
1566
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1567
|
+
message: z.ZodString;
|
|
1568
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1569
|
+
code: z.ZodLiteral<"auth/session_not_fresh">;
|
|
1570
|
+
status: z.ZodLiteral<403>;
|
|
1554
1571
|
}, z.core.$strip>, z.ZodObject<{
|
|
1555
1572
|
message: z.ZodString;
|
|
1556
1573
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -2196,6 +2213,13 @@ export declare const ErrorPayload: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<
|
|
|
2196
2213
|
detail: z.ZodOptional<z.ZodString>;
|
|
2197
2214
|
code: z.ZodLiteral<"auth/provider_unavailable">;
|
|
2198
2215
|
status: z.ZodLiteral<503>;
|
|
2216
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2217
|
+
message: z.ZodString;
|
|
2218
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
2219
|
+
action: z.ZodOptional<z.ZodString>;
|
|
2220
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
2221
|
+
code: z.ZodLiteral<"auth/session_not_fresh">;
|
|
2222
|
+
status: z.ZodLiteral<403>;
|
|
2199
2223
|
}, z.core.$strip>, z.ZodObject<{
|
|
2200
2224
|
message: z.ZodString;
|
|
2201
2225
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/error/payload.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;GAQG;AAEH,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;;;;;;;;;;;;;;;;mBAItB,CAAC;AACJ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,mGAAmG;AACnG,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/error/payload.js
CHANGED
|
@@ -75,6 +75,11 @@ const AuthProviderUnavailablePublic = z.object({
|
|
|
75
75
|
status: z.literal(503).describe("Service Unavailable — one of this service's own dependencies, the provider's credential, could not be read. Not 502/504: nothing was asked of the provider, so no hop failed or timed out."),
|
|
76
76
|
...publicFields
|
|
77
77
|
}).describe("An enabled social sign-in provider could not be served (503).");
|
|
78
|
+
const AuthSessionNotFreshPublic = z.object({
|
|
79
|
+
code: z.literal("auth/session_not_fresh").describe("The caller is signed in, but has not authenticated recently enough to attach a social provider to their account. Attaching one grants permanent access — after it, sign-in resolves by account id and the email stops mattering — so it is gated on a recent authentication the way unlinking already is. A separate code from `auth/forbidden` because the remedy is specific and cheap: sign in again, then retry. Nothing was changed."),
|
|
80
|
+
status: z.literal(403).describe("Forbidden — a real, current credential was presented and is not sufficient for this particular decision. Not 401, which is what a caller with no credential gets: a client that cannot tell the two apart does not know whether to re-authenticate or to retry."),
|
|
81
|
+
...publicFields
|
|
82
|
+
}).describe("The session is authentic but the holder authenticated too long ago to attach a provider (403).");
|
|
78
83
|
const NotFoundPublic = z.object({
|
|
79
84
|
code: z.literal("core/not_found").describe("The requested resource does not exist."),
|
|
80
85
|
status: z.literal(404).describe("Not Found."),
|
|
@@ -676,6 +681,7 @@ const KitPublicErrorPayload = z.discriminatedUnion("code", [
|
|
|
676
681
|
InvalidTokenPublic,
|
|
677
682
|
ForbiddenPublic,
|
|
678
683
|
AuthProviderUnavailablePublic,
|
|
684
|
+
AuthSessionNotFreshPublic,
|
|
679
685
|
NotFoundPublic,
|
|
680
686
|
ConflictPublic,
|
|
681
687
|
RateLimitPublic,
|
|
@@ -799,6 +805,7 @@ const InvalidInput = InvalidInputPublic.extend(internalFields).describe(InvalidI
|
|
|
799
805
|
const InvalidToken = InvalidTokenPublic.extend(internalFields).describe(InvalidTokenPublic.description ?? "");
|
|
800
806
|
const Forbidden = ForbiddenPublic.extend(internalFields).describe(ForbiddenPublic.description ?? "");
|
|
801
807
|
const AuthProviderUnavailable = AuthProviderUnavailablePublic.extend(internalFields).describe(AuthProviderUnavailablePublic.description ?? "");
|
|
808
|
+
const AuthSessionNotFresh = AuthSessionNotFreshPublic.extend(internalFields).describe(AuthSessionNotFreshPublic.description ?? "");
|
|
802
809
|
const NotFound = NotFoundPublic.extend(internalFields).describe(NotFoundPublic.description ?? "");
|
|
803
810
|
const Conflict = ConflictPublic.extend(internalFields).describe(ConflictPublic.description ?? "");
|
|
804
811
|
const RateLimit = RateLimitPublic.extend(internalFields).describe(RateLimitPublic.description ?? "");
|
|
@@ -927,6 +934,7 @@ const KitErrorPayload = z.discriminatedUnion("code", [
|
|
|
927
934
|
InvalidToken,
|
|
928
935
|
Forbidden,
|
|
929
936
|
AuthProviderUnavailable,
|
|
937
|
+
AuthSessionNotFresh,
|
|
930
938
|
NotFound,
|
|
931
939
|
Conflict,
|
|
932
940
|
RateLimit,
|
|
@@ -18,6 +18,7 @@ export declare const AuthContext: z.ZodObject<{
|
|
|
18
18
|
sessionId: z.ZodString;
|
|
19
19
|
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
20
20
|
locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
authenticatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
21
22
|
}, z.core.$strip>;
|
|
22
23
|
export type AuthContext = z.infer<typeof AuthContext>;
|
|
23
24
|
//# sourceMappingURL=authContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authContext.d.ts","sourceRoot":"","sources":["../../src/http/authContext.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"authContext.d.ts","sourceRoot":"","sources":["../../src/http/authContext.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW;;;;;;iBAeiE,CAAC;AAC1F,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
package/dist/http/authContext.js
CHANGED
|
@@ -19,7 +19,8 @@ const AuthContext = z.object({
|
|
|
19
19
|
userId: z.string().describe("ID of the authenticated user (populated by @pithy-sh/auth)."),
|
|
20
20
|
sessionId: z.string().describe("ID of the active session this request belongs to."),
|
|
21
21
|
scopes: z.array(z.string()).default([]).describe("Permission scopes granted to this session."),
|
|
22
|
-
locale: Locale.nullish().describe("The reader's own stored language, from `pithy_auth_users.locale`; null or absent when they have never chosen.")
|
|
22
|
+
locale: Locale.nullish().describe("The reader's own stored language, from `pithy_auth_users.locale`; null or absent when they have never chosen."),
|
|
23
|
+
authenticatedAt: z.date().nullish().describe("When the holder of this session last actually authenticated — a sign-in, never a rotation, which carries the value forward unchanged. It rides here for the same reason `locale` does: the session lookup has already loaded the row, so a gate that needs it should not pay for a second read. Distinct from the session's own `createdAt`, which `/token/rotate` stamps fresh and is therefore resettable by anyone holding a stolen refresh token. Null or absent for a session written before the column existed, and for a Worker whose auth capability predates it.")
|
|
23
24
|
}).describe("Per-request authenticated identity; the seam other capabilities depend on.");
|
|
24
25
|
//#endregion
|
|
25
26
|
export { AuthContext };
|
package/dist/logger/record.d.ts
CHANGED
|
@@ -77,6 +77,13 @@ export declare const LogRecord: z.ZodObject<{
|
|
|
77
77
|
detail: z.ZodOptional<z.ZodString>;
|
|
78
78
|
code: z.ZodLiteral<"auth/provider_unavailable">;
|
|
79
79
|
status: z.ZodLiteral<503>;
|
|
80
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
81
|
+
message: z.ZodString;
|
|
82
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
83
|
+
action: z.ZodOptional<z.ZodString>;
|
|
84
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
85
|
+
code: z.ZodLiteral<"auth/session_not_fresh">;
|
|
86
|
+
status: z.ZodLiteral<403>;
|
|
80
87
|
}, z.core.$strip>, z.ZodObject<{
|
|
81
88
|
message: z.ZodString;
|
|
82
89
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../src/logger/record.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;GAKG;AAEH,4GAA4G;AAC5G,eAAO,MAAM,QAAQ;;;;;EAE4F,CAAC;AAClH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAgD,CAAC;AAEtG;;;;GAIG;AACH,eAAO,MAAM,SAAS,wCAEsF,CAAC;AAC7G,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../src/logger/record.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;GAKG;AAEH,4GAA4G;AAC5G,eAAO,MAAM,QAAQ;;;;;EAE4F,CAAC;AAClH,MAAM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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW+E,CAAC;AACtG,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC;AAmBnD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAMzD"}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
/** This package's npm name — the join key against a release feed. */
|
|
4
4
|
export declare const PACKAGE_NAME = "@pithy-sh/core";
|
|
5
5
|
/** This package's version, stamped from its own package.json at generation time. */
|
|
6
|
-
export declare const PACKAGE_VERSION = "0.
|
|
6
|
+
export declare const PACKAGE_VERSION = "0.5.0";
|
|
7
7
|
//# sourceMappingURL=version.generated.d.ts.map
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
/** This package's npm name — the join key against a release feed. */
|
|
5
5
|
const PACKAGE_NAME = "@pithy-sh/core";
|
|
6
6
|
/** This package's version, stamped from its own package.json at generation time. */
|
|
7
|
-
const PACKAGE_VERSION = "0.
|
|
7
|
+
const PACKAGE_VERSION = "0.5.0";
|
|
8
8
|
//#endregion
|
|
9
9
|
export { PACKAGE_NAME, PACKAGE_VERSION };
|
package/package.json
CHANGED
package/src/error/payload.ts
CHANGED
|
@@ -117,6 +117,22 @@ const AuthProviderUnavailablePublic = z
|
|
|
117
117
|
})
|
|
118
118
|
.describe("An enabled social sign-in provider could not be served (503).");
|
|
119
119
|
|
|
120
|
+
const AuthSessionNotFreshPublic = z
|
|
121
|
+
.object({
|
|
122
|
+
code: z
|
|
123
|
+
.literal("auth/session_not_fresh")
|
|
124
|
+
.describe(
|
|
125
|
+
"The caller is signed in, but has not authenticated recently enough to attach a social provider to their account. Attaching one grants permanent access — after it, sign-in resolves by account id and the email stops mattering — so it is gated on a recent authentication the way unlinking already is. A separate code from `auth/forbidden` because the remedy is specific and cheap: sign in again, then retry. Nothing was changed.",
|
|
126
|
+
),
|
|
127
|
+
status: z
|
|
128
|
+
.literal(403)
|
|
129
|
+
.describe(
|
|
130
|
+
"Forbidden — a real, current credential was presented and is not sufficient for this particular decision. Not 401, which is what a caller with no credential gets: a client that cannot tell the two apart does not know whether to re-authenticate or to retry.",
|
|
131
|
+
),
|
|
132
|
+
...publicFields,
|
|
133
|
+
})
|
|
134
|
+
.describe("The session is authentic but the holder authenticated too long ago to attach a provider (403).");
|
|
135
|
+
|
|
120
136
|
const NotFoundPublic = z
|
|
121
137
|
.object({
|
|
122
138
|
code: z.literal("core/not_found").describe("The requested resource does not exist."),
|
|
@@ -1458,6 +1474,7 @@ export const KitPublicErrorPayload = z
|
|
|
1458
1474
|
InvalidTokenPublic,
|
|
1459
1475
|
ForbiddenPublic,
|
|
1460
1476
|
AuthProviderUnavailablePublic,
|
|
1477
|
+
AuthSessionNotFreshPublic,
|
|
1461
1478
|
NotFoundPublic,
|
|
1462
1479
|
ConflictPublic,
|
|
1463
1480
|
RateLimitPublic,
|
|
@@ -1587,6 +1604,9 @@ const Forbidden = ForbiddenPublic.extend(internalFields).describe(ForbiddenPubli
|
|
|
1587
1604
|
const AuthProviderUnavailable = AuthProviderUnavailablePublic.extend(internalFields).describe(
|
|
1588
1605
|
AuthProviderUnavailablePublic.description ?? "",
|
|
1589
1606
|
);
|
|
1607
|
+
const AuthSessionNotFresh = AuthSessionNotFreshPublic.extend(internalFields).describe(
|
|
1608
|
+
AuthSessionNotFreshPublic.description ?? "",
|
|
1609
|
+
);
|
|
1590
1610
|
const NotFound = NotFoundPublic.extend(internalFields).describe(NotFoundPublic.description ?? "");
|
|
1591
1611
|
const Conflict = ConflictPublic.extend(internalFields).describe(ConflictPublic.description ?? "");
|
|
1592
1612
|
const RateLimit = RateLimitPublic.extend(internalFields).describe(RateLimitPublic.description ?? "");
|
|
@@ -1923,6 +1943,7 @@ export const KitErrorPayload = z
|
|
|
1923
1943
|
InvalidToken,
|
|
1924
1944
|
Forbidden,
|
|
1925
1945
|
AuthProviderUnavailable,
|
|
1946
|
+
AuthSessionNotFresh,
|
|
1926
1947
|
NotFound,
|
|
1927
1948
|
Conflict,
|
|
1928
1949
|
RateLimit,
|
package/src/http/authContext.ts
CHANGED
|
@@ -24,6 +24,12 @@ export const AuthContext = z
|
|
|
24
24
|
locale: Locale.nullish().describe(
|
|
25
25
|
"The reader's own stored language, from `pithy_auth_users.locale`; null or absent when they have never chosen.",
|
|
26
26
|
),
|
|
27
|
+
authenticatedAt: z
|
|
28
|
+
.date()
|
|
29
|
+
.nullish()
|
|
30
|
+
.describe(
|
|
31
|
+
"When the holder of this session last actually authenticated — a sign-in, never a rotation, which carries the value forward unchanged. It rides here for the same reason `locale` does: the session lookup has already loaded the row, so a gate that needs it should not pay for a second read. Distinct from the session's own `createdAt`, which `/token/rotate` stamps fresh and is therefore resettable by anyone holding a stolen refresh token. Null or absent for a session written before the column existed, and for a Worker whose auth capability predates it.",
|
|
32
|
+
),
|
|
27
33
|
})
|
|
28
34
|
.describe("Per-request authenticated identity; the seam other capabilities depend on.");
|
|
29
35
|
export type AuthContext = z.infer<typeof AuthContext>;
|
package/src/version.generated.ts
CHANGED