@astram/guard 0.4.0 → 0.4.1

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.
@@ -147,12 +147,11 @@ export declare const SCHEMA_SVC_POOL_HARD_CAP = 2;
147
147
  * Build the {@link PoolBudgetConfig} from env with documented defaults.
148
148
  * Field ↔ env name:
149
149
  * workers ← POOL_WORKERS
150
- * maxConnections ← DB_MAX_CONNECTIONS
150
+ * maxConnections ← APP_DB_MAX_CONNECTIONS
151
151
  * headroom ← POOL_HEADROOM
152
152
  * perAccountMax.shield_core ← POOL_MAX_CORE
153
153
  * perAccountMax.shield_app_crud ← POOL_MAX_APP_CRUD
154
154
  * perAccountMax.shield_schema_svc ← POOL_MAX_SCHEMA_SVC
155
- * (Legacy `SHIELD_`-prefixed names are still read as a fallback — see {@link readEnv}.)
156
155
  */
157
156
  export declare function loadPoolBudget(env?: NodeJS.ProcessEnv): PoolBudgetConfig;
158
157
  /** Documented defaults for the runtime MariaDB descriptor (local docker substrate). */
@@ -162,9 +161,9 @@ export declare const DEFAULT_REDIS_URL = "redis://localhost:6379";
162
161
  /**
163
162
  * Build the runtime {@link DbConfig} from env with documented defaults.
164
163
  * Field ↔ env name:
165
- * host ← DB_HOST port ← DB_PORT
166
- * user ← DB_USER password ← DB_PASSWORD (secret)
167
- * database ← DB_NAME (legacy SHIELD_DB_* still read as a fallback)
164
+ * host ← APP_DB_HOST port ← APP_DB_PORT
165
+ * user ← APP_DB_USER password ← APP_DB_PASSWORD (secret)
166
+ * database ← APP_DB_NAME
168
167
  * The password defaults to '' when absent — a live connection then fails at
169
168
  * connect time (loud), which is correct for a runtime that needs real creds; the
170
169
  * secret is deliberately NOT hard-required at config load (unlike the HMAC key,
@@ -174,7 +173,7 @@ export declare function loadDbConfig(env?: NodeJS.ProcessEnv): DbConfig;
174
173
  /**
175
174
  * Build the {@link RedisConfig} from env. Prefers `REDIS_URL`; falls back
176
175
  * to composing `redis://host:port` from `REDIS_HOST`/`REDIS_PORT`, else the
177
- * documented default. (Legacy `SHIELD_REDIS_*` names still read as a fallback.)
176
+ * documented default.
178
177
  */
179
178
  export declare function loadRedisConfig(env?: NodeJS.ProcessEnv): RedisConfig;
180
179
  /**
@@ -186,7 +185,6 @@ export declare function loadRedisConfig(env?: NodeJS.ProcessEnv): RedisConfig;
186
185
  * accessTtlMs ← ACCESS_TTL_MS
187
186
  * refreshIdleMs ← REFRESH_IDLE_MS
188
187
  * refreshAbsoluteCapMs ← REFRESH_ABSOLUTE_CAP_MS
189
- * (Legacy `SHIELD_`-prefixed names still read as a fallback.)
190
188
  */
191
189
  export declare function loadSessionLifetimes(env?: NodeJS.ProcessEnv): SessionLifetimeOverrides;
192
190
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"app-config.d.ts","sourceRoot":"","sources":["../../src/config/app-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,SAAS;IACxB,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,QAAQ,CAAC,WAAW,EAAE,aAAa,GAAG,MAAM,GAAG,YAAY,CAAC;IAC5D,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAGhC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,wBAAwB,CAAC;CAC9C;AAED;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACt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AAC,GAAG,EAAE,MAAM,GAAG,MAAM,CASxD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,SAAS,CAU7E;AAMD,mFAAmF;AACnF,MAAM,WAAW,oBAAoB;IACnC,2DAA2D;IAC3D,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,+EAA+E;IAC/E,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,0EAA0E;IAC1E,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,qEAAqE;IACrE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qDAAqD;IACrD,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,0EAA0E;IAC1E,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAC;CAC1C;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,gBAAgB,GAAG,oBAAoB,CAgB9E"}
@@ -48,22 +48,21 @@ function parsePositiveInt(raw, fallback) {
48
48
  * Build the {@link PoolBudgetConfig} from env with documented defaults.
49
49
  * Field ↔ env name:
50
50
  * workers ← POOL_WORKERS
51
- * maxConnections ← DB_MAX_CONNECTIONS
51
+ * maxConnections ← APP_DB_MAX_CONNECTIONS
52
52
  * headroom ← POOL_HEADROOM
53
53
  * perAccountMax.shield_core ← POOL_MAX_CORE
54
54
  * perAccountMax.shield_app_crud ← POOL_MAX_APP_CRUD
55
55
  * perAccountMax.shield_schema_svc ← POOL_MAX_SCHEMA_SVC
56
- * (Legacy `SHIELD_`-prefixed names are still read as a fallback — see {@link readEnv}.)
57
56
  */
58
57
  function loadPoolBudget(env = process.env) {
59
58
  return {
60
- workers: parsePositiveInt(readEnv(env, 'POOL_WORKERS'), exports.DEFAULT_POOL_BUDGET.workers),
61
- maxConnections: parsePositiveInt(readEnv(env, 'DB_MAX_CONNECTIONS'), exports.DEFAULT_POOL_BUDGET.maxConnections),
62
- headroom: parsePositiveInt(readEnv(env, 'POOL_HEADROOM'), exports.DEFAULT_POOL_BUDGET.headroom),
59
+ workers: parsePositiveInt(env.POOL_WORKERS, exports.DEFAULT_POOL_BUDGET.workers),
60
+ maxConnections: parsePositiveInt(env.APP_DB_MAX_CONNECTIONS, exports.DEFAULT_POOL_BUDGET.maxConnections),
61
+ headroom: parsePositiveInt(env.POOL_HEADROOM, exports.DEFAULT_POOL_BUDGET.headroom),
63
62
  perAccountMax: {
64
- shield_core: parsePositiveInt(readEnv(env, 'POOL_MAX_CORE'), exports.DEFAULT_POOL_BUDGET.perAccountMax.shield_core),
65
- shield_app_crud: parsePositiveInt(readEnv(env, 'POOL_MAX_APP_CRUD'), exports.DEFAULT_POOL_BUDGET.perAccountMax.shield_app_crud),
66
- shield_schema_svc: parsePositiveInt(readEnv(env, 'POOL_MAX_SCHEMA_SVC'), exports.DEFAULT_POOL_BUDGET.perAccountMax.shield_schema_svc),
63
+ shield_core: parsePositiveInt(env.POOL_MAX_CORE, exports.DEFAULT_POOL_BUDGET.perAccountMax.shield_core),
64
+ shield_app_crud: parsePositiveInt(env.POOL_MAX_APP_CRUD, exports.DEFAULT_POOL_BUDGET.perAccountMax.shield_app_crud),
65
+ shield_schema_svc: parsePositiveInt(env.POOL_MAX_SCHEMA_SVC, exports.DEFAULT_POOL_BUDGET.perAccountMax.shield_schema_svc),
67
66
  },
68
67
  };
69
68
  }
@@ -81,36 +80,6 @@ exports.DEFAULT_DB_CONFIG = {
81
80
  };
82
81
  /** Documented default Redis url (local docker substrate). */
83
82
  exports.DEFAULT_REDIS_URL = 'redis://localhost:6379';
84
- /**
85
- * Read a consumer-facing env var by its CURRENT (unprefixed) name, falling back to
86
- * the LEGACY `SHIELD_`-prefixed name for one deprecation window. The framework's
87
- * public config vars were debranded from `SHIELD_*` to bare names (e.g.
88
- * `SHIELD_DB_HOST` → `DB_HOST`); reading both keeps existing `.env` files (which may
89
- * still set `SHIELD_*`) working unchanged. The new name wins when both are set.
90
- * A non-blank legacy value emits a one-time deprecation warning (never logs secrets —
91
- * only the var NAME). Internal DI-token symbols (`Symbol('SHIELD_...')`) are unrelated
92
- * and unchanged.
93
- */
94
- const legacyEnvWarned = new Set();
95
- function readEnv(env, name) {
96
- const current = env[name];
97
- if (current !== undefined && current.trim() !== '')
98
- return current;
99
- const legacyName = `SHIELD_${name}`;
100
- const legacy = env[legacyName];
101
- if (legacy !== undefined && legacy.trim() !== '') {
102
- if (!legacyEnvWarned.has(legacyName)) {
103
- legacyEnvWarned.add(legacyName);
104
- // eslint-disable-next-line no-console
105
- console.warn(`[astram] env var '${legacyName}' is deprecated — rename it to '${name}'. ` +
106
- `The SHIELD_ prefix will be removed in a future release.`);
107
- }
108
- return legacy;
109
- }
110
- // Return whichever was present-but-blank (so parseString applies its own fallback),
111
- // preferring the current name.
112
- return current ?? legacy;
113
- }
114
83
  /** Read a string from env with a fallback (trims; blank ⇒ fallback). */
115
84
  function parseString(raw, fallback) {
116
85
  if (raw === undefined || raw.trim() === '')
@@ -132,9 +101,9 @@ function parseOptionalPositiveInt(raw) {
132
101
  /**
133
102
  * Build the runtime {@link DbConfig} from env with documented defaults.
134
103
  * Field ↔ env name:
135
- * host ← DB_HOST port ← DB_PORT
136
- * user ← DB_USER password ← DB_PASSWORD (secret)
137
- * database ← DB_NAME (legacy SHIELD_DB_* still read as a fallback)
104
+ * host ← APP_DB_HOST port ← APP_DB_PORT
105
+ * user ← APP_DB_USER password ← APP_DB_PASSWORD (secret)
106
+ * database ← APP_DB_NAME
138
107
  * The password defaults to '' when absent — a live connection then fails at
139
108
  * connect time (loud), which is correct for a runtime that needs real creds; the
140
109
  * secret is deliberately NOT hard-required at config load (unlike the HMAC key,
@@ -142,25 +111,25 @@ function parseOptionalPositiveInt(raw) {
142
111
  */
143
112
  function loadDbConfig(env = process.env) {
144
113
  return {
145
- host: parseString(readEnv(env, 'DB_HOST'), exports.DEFAULT_DB_CONFIG.host),
146
- port: parsePort(readEnv(env, 'DB_PORT'), exports.DEFAULT_DB_CONFIG.port),
147
- user: parseString(readEnv(env, 'DB_USER'), exports.DEFAULT_DB_CONFIG.user),
148
- password: parseString(readEnv(env, 'DB_PASSWORD'), ''),
149
- database: parseString(readEnv(env, 'DB_NAME'), exports.DEFAULT_DB_CONFIG.database),
114
+ host: parseString(env.APP_DB_HOST, exports.DEFAULT_DB_CONFIG.host),
115
+ port: parsePort(env.APP_DB_PORT, exports.DEFAULT_DB_CONFIG.port),
116
+ user: parseString(env.APP_DB_USER, exports.DEFAULT_DB_CONFIG.user),
117
+ password: parseString(env.APP_DB_PASSWORD, ''),
118
+ database: parseString(env.APP_DB_NAME, exports.DEFAULT_DB_CONFIG.database),
150
119
  };
151
120
  }
152
121
  /**
153
122
  * Build the {@link RedisConfig} from env. Prefers `REDIS_URL`; falls back
154
123
  * to composing `redis://host:port` from `REDIS_HOST`/`REDIS_PORT`, else the
155
- * documented default. (Legacy `SHIELD_REDIS_*` names still read as a fallback.)
124
+ * documented default.
156
125
  */
157
126
  function loadRedisConfig(env = process.env) {
158
- const explicit = readEnv(env, 'REDIS_URL');
127
+ const explicit = env.REDIS_URL;
159
128
  if (explicit !== undefined && explicit.trim() !== '') {
160
129
  return { url: explicit.trim() };
161
130
  }
162
- const host = readEnv(env, 'REDIS_HOST');
163
- const port = readEnv(env, 'REDIS_PORT');
131
+ const host = env.REDIS_HOST;
132
+ const port = env.REDIS_PORT;
164
133
  if ((host !== undefined && host.trim() !== '') || (port !== undefined && port.trim() !== '')) {
165
134
  const h = parseString(host, 'localhost');
166
135
  const p = parsePort(port, 6379);
@@ -177,13 +146,12 @@ function loadRedisConfig(env = process.env) {
177
146
  * accessTtlMs ← ACCESS_TTL_MS
178
147
  * refreshIdleMs ← REFRESH_IDLE_MS
179
148
  * refreshAbsoluteCapMs ← REFRESH_ABSOLUTE_CAP_MS
180
- * (Legacy `SHIELD_`-prefixed names still read as a fallback.)
181
149
  */
182
150
  function loadSessionLifetimes(env = process.env) {
183
151
  const overrides = {};
184
- const access = parseOptionalPositiveInt(readEnv(env, 'ACCESS_TTL_MS'));
185
- const idle = parseOptionalPositiveInt(readEnv(env, 'REFRESH_IDLE_MS'));
186
- const cap = parseOptionalPositiveInt(readEnv(env, 'REFRESH_ABSOLUTE_CAP_MS'));
152
+ const access = parseOptionalPositiveInt(env.ACCESS_TTL_MS);
153
+ const idle = parseOptionalPositiveInt(env.REFRESH_IDLE_MS);
154
+ const cap = parseOptionalPositiveInt(env.REFRESH_ABSOLUTE_CAP_MS);
187
155
  if (access !== undefined)
188
156
  overrides.accessTtlMs = access;
189
157
  if (idle !== undefined)
@@ -199,7 +167,7 @@ function loadSessionLifetimes(env = process.env) {
199
167
  * the key's value.
200
168
  */
201
169
  function loadRefreshHmacKey(env = process.env) {
202
- return parseString(readEnv(env, 'REFRESH_HMAC_KEY'), '');
170
+ return parseString(env.REFRESH_HMAC_KEY, '');
203
171
  }
204
172
  /**
205
173
  * ⛔ FAIL-CLOSED GATE for the refresh-token HMAC key. Called by the auth
@@ -220,8 +188,7 @@ function assertRefreshHmacKey(key) {
220
188
  if (typeof key !== 'string' || key.trim() === '') {
221
189
  throw new Error('Astram auth composition: REFRESH_HMAC_KEY is required and must be ' +
222
190
  'non-empty (fail-closed — refusing to compose auth with a blank refresh-token ' +
223
- 'HMAC key). Set it from your secrets manager; never commit the value. ' +
224
- '(The legacy env var name SHIELD_REFRESH_HMAC_KEY is still accepted.)');
191
+ 'HMAC key). Set it from your secrets manager; never commit the value.');
225
192
  }
226
193
  return key;
227
194
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astram/guard",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "license": "MIT",
5
5
  "description": "Astram framework — the enforcement guard + real-world adapters (the 'hands'). One global deny-by-default gate every request passes through (ADR-0002), classification decorators, boot-pool assertion (ADR-0018), the forRoot() registration seam, and the DB/Redis/crypto adapters that connect the sealed core to a real backend. Depends on @astram/core (ADR-0003, ADR-0023).",
6
6
  "type": "commonjs",