@astram/guide 0.2.0 → 0.2.2
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/CAPABILITIES.md +9 -9
- package/FRAMEWORK_RULES.md +7 -4
- package/index.js +0 -1
- package/package.json +1 -1
package/CAPABILITIES.md
CHANGED
|
@@ -20,11 +20,9 @@ below is wired by the two `forRoot` calls in your `app.module.ts`; you write no
|
|
|
20
20
|
import { ShieldModule } from '@astram/guard';
|
|
21
21
|
import {
|
|
22
22
|
IdentityFeatureModule, identityAuthActionKeys, identityControlPlaneKeys,
|
|
23
|
-
createIdentityAuthzPool, buildIdentityRecordAuthorization,
|
|
24
23
|
} from '@astram/identity';
|
|
25
24
|
|
|
26
25
|
const rootIds = ['<platform-admin user uuid>']; // from config, never from a request
|
|
27
|
-
const authzPool = createIdentityAuthzPool();
|
|
28
26
|
|
|
29
27
|
imports: [
|
|
30
28
|
ShieldModule.forRoot({
|
|
@@ -33,14 +31,15 @@ imports: [
|
|
|
33
31
|
rootIds,
|
|
34
32
|
identityActionKeys: identityAuthActionKeys,
|
|
35
33
|
identityControlPlaneKeys,
|
|
36
|
-
recordAuthorization:
|
|
34
|
+
// no recordAuthorization: IdentityFeatureModule provides it
|
|
37
35
|
}),
|
|
38
36
|
IdentityFeatureModule.forRoot({ rootIds, extraObjects: [/* YourType */] }),
|
|
39
37
|
],
|
|
40
38
|
```
|
|
41
39
|
|
|
42
40
|
- **`ShieldModule.forRoot(options?)`** (`@astram/guard`; `forRootAsync` for DI-computed options).
|
|
43
|
-
Options: `auth?`, `recordAuthorization?` (or a pre-built `decisionAuthority
|
|
41
|
+
Options: `auth?`, `recordAuthorization?` (or a pre-built `decisionAuthority?`; only for an app
|
|
42
|
+
WITHOUT `IdentityFeatureModule`, never both),
|
|
44
43
|
`emailSender?: EmailSender | 'disabled'`, `rootIds?`, `identityActionKeys?`,
|
|
45
44
|
`identityControlPlaneKeys?`, `config?`, and optional overrides `credentialResolver?`,
|
|
46
45
|
`profileResolver?`, `credentialWriter?`, `resetTokenStore?`, `recoveryCodeStore?`,
|
|
@@ -48,11 +47,12 @@ imports: [
|
|
|
48
47
|
`sessionFactsProjector?`, `scopeSubtreeResolver?`, `membershipChecker?`. With `auth: true` every
|
|
49
48
|
override has a MariaDB/Redis default; leave them out unless you have a reason.
|
|
50
49
|
- **`IdentityFeatureModule.forRoot({ rootIds?, extraObjects? })`** (`@astram/identity`). Pass the
|
|
51
|
-
SAME `rootIds` as `ShieldModule
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
SAME `rootIds` as `ShieldModule`. `extraObjects` (your own registered object types) are given
|
|
51
|
+
HERE ONLY: the module builds the record authorization from them and `ShieldModule` decides with
|
|
52
|
+
it. Passing `recordAuthorization`/`decisionAuthority` to `ShieldModule` as well fails the boot.
|
|
53
|
+
Without `rootIds` it logs a boot warning.
|
|
54
|
+
- `ShieldModule.forRoot()` with no options and no identity module = enforcement only (no DB, no
|
|
55
|
+
Redis, boots without `.env`); it binds a stub that denies every `@Classified` route.
|
|
56
56
|
|
|
57
57
|
## Enforcement (`@astram/guard`)
|
|
58
58
|
- **Global deny-by-default guard** — every route is denied unless `@Public()` or
|
package/FRAMEWORK_RULES.md
CHANGED
|
@@ -50,10 +50,13 @@ the permission gate, validation, audit, and cross-tenant isolation on every writ
|
|
|
50
50
|
by construction.
|
|
51
51
|
|
|
52
52
|
This is enforced two ways: the raw DB pool is **sealed inside the engine module** (you
|
|
53
|
-
cannot inject what you are not given)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
cannot inject what you are not given) and no package entry point exports a raw pool or
|
|
54
|
+
unit of work (they live on `@astram/*/internal` subpaths for `app.module.ts` wiring only);
|
|
55
|
+
and the app's `server/eslint.config.mjs` **fails lint** on off-road DB access anywhere in
|
|
56
|
+
`src/**` (only `app.module.ts` and `main.ts` may import `@astram/*/internal` and wire
|
|
57
|
+
infrastructure, and they may not re-export it). The lint wall is a backstop, not a
|
|
58
|
+
sandbox: code that slips past it is still a Rule 2 violation. If you find yourself
|
|
59
|
+
wanting a raw query, see Rule 4.
|
|
57
60
|
|
|
58
61
|
## 3. Classify every route (deny-by-default)
|
|
59
62
|
|
package/index.js
CHANGED
|
@@ -18,7 +18,6 @@ const FRAMEWORK_RULES_PATH = join(__dirname, 'FRAMEWORK_RULES.md');
|
|
|
18
18
|
const CAPABILITIES_PATH = join(__dirname, 'CAPABILITIES.md');
|
|
19
19
|
|
|
20
20
|
/** The guide version (== the framework release it ships with). */
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
22
21
|
const { version } = require('./package.json');
|
|
23
22
|
|
|
24
23
|
module.exports = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astram/guide",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Astram framework — the AI/dev GUIDE layer (ADR-0025). Ships the framework's hard rules + capabilities manifest as installed, upgrade-refreshed docs. A consumer app's CLAUDE.md references FRAMEWORK_RULES.md from this package; `npm update` replaces it wholesale so new rules arrive cleanly, while the app's own .astram/guide/ layer is never touched. This is the framework-owned FLOOR: an app rule may tighten it, never weaken it.",
|
|
6
6
|
"type": "commonjs",
|