@cosmicdrift/kumiko-types 0.299.0 → 0.304.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-types",
3
- "version": "0.299.0",
3
+ "version": "0.304.0",
4
4
  "description": "Framework-Type-Definitions für Kumiko — FeatureDefinition, BootCheck-Types und die reinen Engine-Types. Erlaubt Downstream-Konsumenten, gegen die Type-Contracts zu bauen, ohne das ganze Framework-Package zu importieren. Enthaelt keine identitaets-sensitiven Runtime-Werte mehr (Error-Klassen leben seit #1629 in kumiko-framework, Brand-Symbole nutzen Symbol.for) und ist deshalb eine plain dependency, keine peerDependency.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
package/src/handlers.ts CHANGED
@@ -28,11 +28,19 @@ export type OpenToAllAccessRule = {
28
28
  readonly openToAll: OpenToAllDeclaration;
29
29
  };
30
30
 
31
+ // "public-intake": anonymous callers may write personal data; the required rateLimit is the only protection.
32
+ export type RoleAccessPersonalData = "public-intake";
33
+
34
+ export type RoleAccessRule = {
35
+ readonly roles: readonly string[];
36
+ readonly personalData?: RoleAccessPersonalData;
37
+ };
38
+
31
39
  // AccessRule is DEFAULT-DENY: a handler without an access rule is not reachable.
32
40
  // To grant access, set one of:
33
41
  // - { roles: ["Admin", ...] } — role-based allowlist (empty array denies everyone)
34
42
  // - { openToAll: { reason: "..." } } — any authenticated user may call (still requires a valid JWT)
35
- export type AccessRule = { readonly roles: readonly string[] } | OpenToAllAccessRule;
43
+ export type AccessRule = RoleAccessRule | OpenToAllAccessRule;
36
44
 
37
45
  export type EscapeHatchDeclaration = { readonly reason: string };
38
46
 
package/src/http-route.ts CHANGED
@@ -61,11 +61,11 @@ export type HttpRouteDefinition = {
61
61
  readonly method: HttpRouteMethod;
62
62
  /** URL-Pfad (Hono-Pattern, z.B. "/feed.xml" oder "/og/:tenantId.png"). */
63
63
  readonly path: string;
64
- /** Wenn true, bypasses die /api/*-Auth-Middleware. Default false —
65
- * Routes liegen außerhalb /api/* und sehen die Auth-Middleware
66
- * ohnehin nicht; das Flag ist semantisch (= "diese Route ist
67
- * bewusst öffentlich") für Boot-Validator + Doku. */
68
- readonly anonymous?: boolean;
64
+ /** true = public, no session required. false = mounted behind the
65
+ * session auth chain (no anonymous fallthrough, PAT rate limit,
66
+ * origin + CSRF guards) — a request without a session gets 401. The
67
+ * handler reads the caller via getUser(c). */
68
+ readonly anonymous: boolean;
69
69
  /** Hono-Handler. Bekommt Hono-Context + Framework-Deps; returnt
70
70
  * Response (sync oder async). */
71
71
  readonly handler: HttpRouteHandler;