@cosmicdrift/kumiko-types 0.269.2 → 0.270.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/handlers.ts +1 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-types",
3
- "version": "0.269.2",
3
+ "version": "0.270.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
@@ -25,15 +25,13 @@ export type OpenToAllDeclaration = {
25
25
  };
26
26
 
27
27
  export type OpenToAllAccessRule = {
28
- // `true` is the deprecated pre-#2855 form, kept until the call-site migration (fw#2854).
29
- readonly openToAll: OpenToAllDeclaration | true;
28
+ readonly openToAll: OpenToAllDeclaration;
30
29
  };
31
30
 
32
31
  // AccessRule is DEFAULT-DENY: a handler without an access rule is not reachable.
33
32
  // To grant access, set one of:
34
33
  // - { roles: ["Admin", ...] } — role-based allowlist (empty array denies everyone)
35
34
  // - { openToAll: { reason: "..." } } — any authenticated user may call (still requires a valid JWT)
36
- // - { openToAll: true } — deprecated pre-#2855 form, still accepted
37
35
  export type AccessRule = { readonly roles: readonly string[] } | OpenToAllAccessRule;
38
36
 
39
37
  export type EscapeHatchDeclaration = { readonly reason: string };
@@ -44,7 +42,6 @@ export type EscapeHatchDeclaration = { readonly reason: string };
44
42
  export function isOpenToAllGranted(rule: AccessRule): boolean {
45
43
  if (!("openToAll" in rule)) return false;
46
44
  const openToAll: unknown = rule.openToAll;
47
- if (openToAll === true) return true;
48
45
  if (typeof openToAll !== "object" || openToAll === null) return false;
49
46
  if (!("reason" in openToAll) || typeof openToAll.reason !== "string") return false;
50
47
  return openToAll.reason.trim().length > 0;