@hadoku/service-kernel 0.1.143 → 0.1.144

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.
@@ -18,15 +18,9 @@
18
18
  */
19
19
  import type { IncomingHttpHeaders } from 'node:http';
20
20
  import type { NextFunction, Request, Response } from 'express';
21
- /**
22
- * The platform tier ladder, complete. `wife` sits above `service` and below
23
- * `admin` deliberately: full reach across the apps, none of the
24
- * credential-management surface. `guest` is an account a visitor made
25
- * themselves (or the edge made on arrival): a passkey and a name, no key
26
- * anyone handed out. `member` is a guest the operator has verified.
27
- */
28
- export declare const TIER_ORDER: readonly ["public", "guest", "member", "friend", "service", "wife", "admin"];
29
- export type Tier = (typeof TIER_ORDER)[number];
21
+ import { TIER_ORDER, rankOf, type Tier } from '@wolffm/platform-wire/tiers';
22
+ /** The platform tier ladder: `@hadoku/platform-wire/tiers`, re-exported so every server gate reads it from here. */
23
+ export { TIER_ORDER, rankOf, type Tier };
30
24
  export interface AssertFloorOptions {
31
25
  /** Named in the refusal message, e.g. `CARDTABLE` for `CARDTABLE_MIN_TIER=…`. */
32
26
  envPrefix: string;
@@ -47,7 +41,6 @@ export interface AssertFloorOptions {
47
41
  * gate.
48
42
  */
49
43
  export declare function assertFloor(tier: string, opts: AssertFloorOptions): Tier;
50
- export declare function rankOf(tier: string): number;
51
44
  /**
52
45
  * The app's own edge-auth binding: its shared secret and its bare-local dev
53
46
  * hatch. Read live (as functions, not snapshotted values) so an app that
@@ -16,14 +16,9 @@
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
- /**
20
- * The platform tier ladder, complete. `wife` sits above `service` and below
21
- * `admin` deliberately: full reach across the apps, none of the
22
- * credential-management surface. `guest` is an account a visitor made
23
- * themselves (or the edge made on arrival): a passkey and a name, no key
24
- * anyone handed out. `member` is a guest the operator has verified.
25
- */
26
- export const TIER_ORDER = ['public', 'guest', 'member', 'friend', 'service', 'wife', 'admin'];
19
+ import { TIER_ORDER, rankOf } from '@wolffm/platform-wire/tiers';
20
+ /** The platform tier ladder: `@hadoku/platform-wire/tiers`, re-exported so every server gate reads it from here. */
21
+ export { TIER_ORDER, rankOf };
27
22
  /**
28
23
  * The floor must be a tier this build knows. An unknown name ranks as public
29
24
  * in {@link rankOf}, so a floor this build has not heard of would silently
@@ -39,12 +34,6 @@ export function assertFloor(tier, opts) {
39
34
  }
40
35
  return tier;
41
36
  }
42
- export function rankOf(tier) {
43
- const i = TIER_ORDER.indexOf(tier);
44
- // An unknown tier is not a high one. A future tier name this build has never
45
- // heard of must not out-rank the floor by accident.
46
- return i === -1 ? 0 : i;
47
- }
48
37
  /** Constant-time compare. Length is not secret (the token is fixed-length). */
49
38
  function ctEqual(a, b) {
50
39
  if (a.length !== b.length)
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@hadoku/service-kernel",
3
- "version": "0.1.143",
4
- "gitHead": "6b70aca798222f2a7c688c1782e823e1aea2e6ce",
3
+ "version": "0.1.144",
4
+ "gitHead": "c797d505b0379e058a03bf7d63668064af060ed5",
5
5
  "type": "module",
6
6
  "license": "MIT",
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 and @wolffm/*.",
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/*.",
8
8
  "exports": {
9
9
  "./auth": {
10
10
  "types": "./dist/auth/index.d.ts",
@@ -56,6 +56,7 @@
56
56
  }
57
57
  },
58
58
  "dependencies": {
59
+ "@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.111",
59
60
  "express": "^5.1.0",
60
61
  "socket.io": "^4.8.3"
61
62
  },