@hadoku/service-kernel 0.1.235 → 0.1.237

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.
@@ -70,15 +70,7 @@ export interface EdgeAuth {
70
70
  }
71
71
  /** Build the three functions that need the app's own edge-auth secret and dev hatch. */
72
72
  export declare function createEdgeAuth(config: EdgeAuthConfig): EdgeAuth;
73
- /**
74
- * The caller's tier as the app's headers carry it, except that a member IS a
75
- * friend here: `member` is a guest the operator has verified, and an app that
76
- * admits members alongside the tiers it hands out may treat that verification
77
- * the same as a vouch. Never above friend: admin stays admin's, and a guest is
78
- * never promoted. Read from the tier alone; the edge's `X-Hadoku-Verified` says
79
- * nothing the tier does not. Pure — only `sanitizeHeaders` decides whether a
80
- * header is trustworthy in the first place.
81
- */
73
+ /** The caller's tier as a gate reads it (`effectiveTier`). Pure: only `sanitizeHeaders` decides whether a header is trusted. */
82
74
  export declare function tierOf(req: Request): string;
83
75
  /**
84
76
  * The caller's tier exactly as the edge named it — `member` stays `member`. For telemetry and
@@ -16,7 +16,7 @@
16
16
  * by the app that binds this module (its edge-auth secret, its bare-local
17
17
  * dev hatch, its dev tier).
18
18
  */
19
- import { TIER_ORDER, rankOf } from '@wolffm/platform-wire/tiers';
19
+ import { TIER_ORDER, effectiveTier, rankOf } from '@wolffm/platform-wire/tiers';
20
20
  /** The platform tier ladder: `@hadoku/platform-wire/tiers`, re-exported so every server gate reads it from here. */
21
21
  export { TIER_ORDER, rankOf };
22
22
  /**
@@ -109,19 +109,9 @@ export function createEdgeAuth(config) {
109
109
  }
110
110
  return { sanitizeHeaders, edgeSealed, edgeProvenance };
111
111
  }
112
- /**
113
- * The caller's tier as the app's headers carry it, except that a member IS a
114
- * friend here: `member` is a guest the operator has verified, and an app that
115
- * admits members alongside the tiers it hands out may treat that verification
116
- * the same as a vouch. Never above friend: admin stays admin's, and a guest is
117
- * never promoted. Read from the tier alone; the edge's `X-Hadoku-Verified` says
118
- * nothing the tier does not. Pure — only `sanitizeHeaders` decides whether a
119
- * header is trustworthy in the first place.
120
- */
112
+ /** The caller's tier as a gate reads it (`effectiveTier`). Pure: only `sanitizeHeaders` decides whether a header is trusted. */
121
113
  export function tierOf(req) {
122
- const t = req.headers['x-hadoku-tier'];
123
- const tier = typeof t === 'string' && t !== '' ? t : 'public';
124
- return tier === 'member' ? 'friend' : tier;
114
+ return effectiveTier(edgeTierOf(req));
125
115
  }
126
116
  /**
127
117
  * The caller's tier exactly as the edge named it — `member` stays `member`. For telemetry and
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hadoku/service-kernel",
3
- "version": "0.1.235",
4
- "gitHead": "4ba2350938ced47e5519c9acf331d81ff6f6235c",
3
+ "version": "0.1.237",
4
+ "gitHead": "6212ef2571050bce6d2e17cfccd0bb5d14ef966e",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "description": "The server parts any game keeps: edge auth and the tier gate, base path and bundle check, health and the busy probe, lifecycle, the JSON logger, the state directory, telemetry and capacity, per-caller limits, the browser relays, the erase registry, and createGameServer, which boots a game from its config and plugins. Knows no game; the app binds its service id, prefix and env names. MIT; imports only node built-ins, express, socket.io, platform-wire and @wolffm/*.",
@@ -56,7 +56,7 @@
56
56
  }
57
57
  },
58
58
  "dependencies": {
59
- "@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.202",
59
+ "@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.204",
60
60
  "express": "^5.1.0",
61
61
  "socket.io": "^4.8.3"
62
62
  },