@astram/guard 0.22.0 → 0.24.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.
- package/dist/auth/auth.module.d.ts +7 -0
- package/dist/auth/auth.module.d.ts.map +1 -1
- package/dist/auth/auth.module.js +43 -1
- package/dist/auth/tokens.d.ts +13 -0
- package/dist/auth/tokens.d.ts.map +1 -1
- package/dist/auth/tokens.js +14 -1
- package/dist/completeness/catalog-reconciler.d.ts +16 -1
- package/dist/completeness/catalog-reconciler.d.ts.map +1 -1
- package/dist/completeness/catalog-reconciler.js +70 -6
- package/dist/completeness/ports/catalog-store.d.ts +38 -3
- package/dist/completeness/ports/catalog-store.d.ts.map +1 -1
- package/dist/config/notification-config.d.ts +20 -0
- package/dist/config/notification-config.d.ts.map +1 -0
- package/dist/config/notification-config.js +33 -0
- package/dist/identity/module-registry.bridge.d.ts +9 -1
- package/dist/identity/module-registry.bridge.d.ts.map +1 -1
- package/dist/identity/module-registry.bridge.js +19 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -37
- package/dist/module/shield.module.d.ts +12 -0
- package/dist/module/shield.module.d.ts.map +1 -1
- package/dist/module/shield.module.js +11 -0
- package/dist/notifications/mariadb-notification-store.d.ts +38 -0
- package/dist/notifications/mariadb-notification-store.d.ts.map +1 -0
- package/dist/notifications/mariadb-notification-store.js +151 -0
- package/dist/notifications/notification-retention.job.d.ts +52 -0
- package/dist/notifications/notification-retention.job.d.ts.map +1 -0
- package/dist/notifications/notification-retention.job.js +97 -0
- package/dist/notifications/notification.service.d.ts +68 -0
- package/dist/notifications/notification.service.d.ts.map +1 -0
- package/dist/notifications/notification.service.js +247 -0
- package/dist/notifications/notifications.controller.d.ts +57 -0
- package/dist/notifications/notifications.controller.d.ts.map +1 -0
- package/dist/notifications/notifications.controller.js +257 -0
- package/dist/notifications/ports.d.ts +112 -0
- package/dist/notifications/ports.d.ts.map +1 -0
- package/dist/notifications/ports.js +63 -0
- package/migrations/1710000000107-AddPermissionTextAndFirstSeen.cjs +43 -0
- package/package.json +5 -5
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
*/
|
|
65
65
|
import { type DynamicModule, type Provider } from '@nestjs/common';
|
|
66
66
|
import type { CredentialResolver, HmacSha1, FactorVerifier } from '@astram/core';
|
|
67
|
+
import type { NotificationKindRegistration } from '../notifications/ports.js';
|
|
67
68
|
import { type SignInMethod } from '../authentication/sign-in-with.js';
|
|
68
69
|
import { type ShieldCaptchaOption } from '../captcha/captcha.providers.js';
|
|
69
70
|
import type { SessionFactsProjector } from './ports/session-facts-projector.js';
|
|
@@ -281,6 +282,12 @@ export interface AuthModuleOptions {
|
|
|
281
282
|
* the boot). Omitted ⇒ off, every route answers exactly as before.
|
|
282
283
|
*/
|
|
283
284
|
readonly captcha?: ShieldCaptchaOption;
|
|
285
|
+
/**
|
|
286
|
+
* G-027 step 2: the app's notification kinds (`{ kind, category }`), validated at registration
|
|
287
|
+
* (pattern, ≤ 64 characters, category, duplicates, the reserved `shield.` prefix); a bad entry
|
|
288
|
+
* fails the boot naming the kind. `NotificationService.post` refuses any other kind.
|
|
289
|
+
*/
|
|
290
|
+
readonly notificationKinds?: readonly NotificationKindRegistration[];
|
|
284
291
|
}
|
|
285
292
|
/**
|
|
286
293
|
* The per-account email-change REQUEST limiter (Phase 12) — `email-change:pid:<id>`, 3 per 60-min
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH,OAAO,EAGL,KAAK,aAAa,EAElB,KAAK,QAAQ,EACd,MAAM,gBAAgB,CAAC;AAaxB,OAAO,KAAK,EAGV,kBAAkB,EAOlB,QAAQ,EACR,cAAc,EAKf,MAAM,cAAc,CAA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sFD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,QAAQ,CAQpE;AAwDD;;;;;;GAMG;AACH,qBACa,UAAU;IACrB;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,GAAE,iBAAsB,GAAG,aAAa;CA+N/D"}
|
package/dist/auth/auth.module.js
CHANGED
|
@@ -143,6 +143,11 @@ const confirm_email_controller_js_1 = require("./confirm-email.controller.js");
|
|
|
143
143
|
const pending_mfa_store_js_1 = require("./pending-mfa-store.js");
|
|
144
144
|
const mfa_step_up_js_1 = require("./mfa-step-up.js");
|
|
145
145
|
const tokens_js_1 = require("./tokens.js");
|
|
146
|
+
const mariadb_notification_store_js_1 = require("../notifications/mariadb-notification-store.js");
|
|
147
|
+
const notification_service_js_1 = require("../notifications/notification.service.js");
|
|
148
|
+
const notification_retention_job_js_1 = require("../notifications/notification-retention.job.js");
|
|
149
|
+
const notifications_controller_js_1 = require("../notifications/notifications.controller.js");
|
|
150
|
+
const notification_config_js_1 = require("../config/notification-config.js");
|
|
146
151
|
const admin_signin_controls_js_1 = require("./admin-signin-controls.js");
|
|
147
152
|
const captcha_gate_js_1 = require("./captcha-gate.js");
|
|
148
153
|
const sign_in_with_js_1 = require("../authentication/sign-in-with.js");
|
|
@@ -775,6 +780,30 @@ const totpVerifierProvider = {
|
|
|
775
780
|
return createTotpFactorVerifier({ hmacSha1: exports.hmacSha1 });
|
|
776
781
|
},
|
|
777
782
|
};
|
|
783
|
+
/**
|
|
784
|
+
* G-027 step 2 (notification-store SPEC §5, §6): the store over the core pool, the posting service
|
|
785
|
+
* over the validated kind registry, and the hourly retention job (`NOTIFICATION_*_RETENTION_DAYS`
|
|
786
|
+
* read when the job is built; an invalid value fails the boot naming the variable).
|
|
787
|
+
*/
|
|
788
|
+
function makeNotificationProviders(kinds) {
|
|
789
|
+
return [
|
|
790
|
+
{
|
|
791
|
+
provide: tokens_js_1.SHIELD_NOTIFICATION_STORE,
|
|
792
|
+
useFactory: (pool, config) => new mariadb_notification_store_js_1.MariaDbNotificationStore(pool, (0, app_config_js_1.frameworkSchemasOf)(config)),
|
|
793
|
+
inject: [tokens_js_1.SHIELD_DB_POOL, config_module_js_1.APP_CONFIG],
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
provide: tokens_js_1.SHIELD_NOTIFICATIONS,
|
|
797
|
+
useFactory: (store, pool, config) => new notification_service_js_1.NotificationService(store, pool, kinds, (0, app_config_js_1.frameworkSchemasOf)(config)),
|
|
798
|
+
inject: [tokens_js_1.SHIELD_NOTIFICATION_STORE, tokens_js_1.SHIELD_DB_POOL, config_module_js_1.APP_CONFIG],
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
provide: notification_retention_job_js_1.NotificationRetentionJob,
|
|
802
|
+
useFactory: (store) => new notification_retention_job_js_1.NotificationRetentionJob(store, (0, notification_config_js_1.loadNotificationConfig)(process.env)),
|
|
803
|
+
inject: [tokens_js_1.SHIELD_NOTIFICATION_STORE],
|
|
804
|
+
},
|
|
805
|
+
];
|
|
806
|
+
}
|
|
778
807
|
/** DI token for the R1.9 boot count of users with a login name. */
|
|
779
808
|
const SHIELD_LOGIN_NAME_COUNT_BOOT = Symbol('SHIELD_LOGIN_NAME_COUNT_BOOT');
|
|
780
809
|
/**
|
|
@@ -1094,6 +1123,8 @@ let AuthModule = AuthModule_1 = class AuthModule {
|
|
|
1094
1123
|
const signInWith = (0, sign_in_with_js_1.resolveSignInWith)(options.signInWith);
|
|
1095
1124
|
// R7: validated here too, so a bad value fails the boot with a clear message.
|
|
1096
1125
|
const captcha = (0, captcha_providers_js_1.captchaProviders)(options.captcha);
|
|
1126
|
+
// G-027 step 2: validated here so a bad kind fails the boot naming it.
|
|
1127
|
+
const notificationKinds = (0, notification_service_js_1.resolveNotificationKinds)(options.notificationKinds);
|
|
1097
1128
|
return {
|
|
1098
1129
|
module: AuthModule_1,
|
|
1099
1130
|
imports: [persistence_module_js_1.PersistenceModule.forRoot()],
|
|
@@ -1104,7 +1135,14 @@ let AuthModule = AuthModule_1 = class AuthModule {
|
|
|
1104
1135
|
// AuthFactsController serves the framework-default `/identity/auth-facts` +
|
|
1105
1136
|
// `/identity/permissions-version` (over the SHIELD_PERMISSION_FACTS adapter below).
|
|
1106
1137
|
// ConfirmEmailController (Phase 12): `POST /auth/confirm-email`, beside AuthController.
|
|
1107
|
-
|
|
1138
|
+
// NotificationsController (G-027 step 2): `/account/notifications`, beside AccountController.
|
|
1139
|
+
controllers: [
|
|
1140
|
+
auth_controller_js_1.AuthController,
|
|
1141
|
+
confirm_email_controller_js_1.ConfirmEmailController,
|
|
1142
|
+
account_controller_js_1.AccountController,
|
|
1143
|
+
notifications_controller_js_1.NotificationsController,
|
|
1144
|
+
auth_facts_controller_js_1.AuthFactsController,
|
|
1145
|
+
],
|
|
1108
1146
|
providers: [
|
|
1109
1147
|
passwordHasherProvider,
|
|
1110
1148
|
{ provide: tokens_js_1.SHIELD_SIGN_IN_WITH, useValue: signInWith },
|
|
@@ -1226,6 +1264,8 @@ let AuthModule = AuthModule_1 = class AuthModule {
|
|
|
1226
1264
|
// spec 5.D: the guard migrations are in the ledger (once at bootstrap; production fails).
|
|
1227
1265
|
migrationLedgerCheckProvider,
|
|
1228
1266
|
exports.singleLayoutProbeProvider,
|
|
1267
|
+
// G-027 step 2: notification store, posting service, retention job.
|
|
1268
|
+
...makeNotificationProviders(notificationKinds),
|
|
1229
1269
|
],
|
|
1230
1270
|
exports: [
|
|
1231
1271
|
tokens_js_1.SHIELD_AUTHENTICATOR,
|
|
@@ -1277,6 +1317,8 @@ let AuthModule = AuthModule_1 = class AuthModule {
|
|
|
1277
1317
|
// R11: identity's admin sign-in controls inject these (through @astram/guard/internal).
|
|
1278
1318
|
tokens_js_1.SHIELD_ADMIN_STEP_UP,
|
|
1279
1319
|
tokens_js_1.SHIELD_ACCOUNT_UNLOCKER,
|
|
1320
|
+
// G-027 step 2: app code (and identity in step 3) posts notices through it.
|
|
1321
|
+
tokens_js_1.SHIELD_NOTIFICATIONS,
|
|
1280
1322
|
],
|
|
1281
1323
|
};
|
|
1282
1324
|
}
|
package/dist/auth/tokens.d.ts
CHANGED
|
@@ -451,6 +451,19 @@ export declare const SHIELD_MFA_POLICY_FEATURE: unique symbol;
|
|
|
451
451
|
* so every route answers exactly as before).
|
|
452
452
|
*/
|
|
453
453
|
export declare const SHIELD_CAPTCHA_CONFIG: unique symbol;
|
|
454
|
+
/**
|
|
455
|
+
* G-027 step 2 (notification-store SPEC §5B, §6): the {@link
|
|
456
|
+
* import('../notifications/notification.service.js').NotificationService} through which app and
|
|
457
|
+
* framework code posts notices under registered kinds. Bound with `auth: true`, exported app-wide
|
|
458
|
+
* and from the main entry.
|
|
459
|
+
*/
|
|
460
|
+
export declare const SHIELD_NOTIFICATIONS: unique symbol;
|
|
461
|
+
/**
|
|
462
|
+
* G-027 step 2: the {@link import('../notifications/ports.js').NotificationStore} (default
|
|
463
|
+
* `MariaDbNotificationStore` over the core pool). Internal to the auth wiring: the service, the
|
|
464
|
+
* retention job and the `/account/notifications` routes use it.
|
|
465
|
+
*/
|
|
466
|
+
export declare const SHIELD_NOTIFICATION_STORE: unique symbol;
|
|
454
467
|
export declare const SHIELD_CAPTCHA_VERIFIER: unique symbol;
|
|
455
468
|
export declare const SHIELD_CAPTCHA_GATE: unique symbol;
|
|
456
469
|
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/auth/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAEvF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,eAA2B,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,eAAqC,CAAC;AAE3E;;;;GAIG;AACH,eAAO,MAAM,YAAY,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GED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.SHIELD_ACCOUNT_UNLOCKER = exports.SHIELD_ADMIN_STEP_UP = exports.SHIELD_MFA_REQUIREMENT = exports.SHIELD_MFA_REQUIREMENT_SOURCE = exports.SHIELD_SIGN_IN_WITH = exports.SHIELD_SESSION_RESTRICTIONS = exports.SHIELD_PERMISSION_VERSION_CACHE = exports.SHIELD_PERMISSION_FACTS = exports.SHIELD_RESET_LIMITER = exports.SHIELD_FORGOT_HINT_LIMITER = exports.SHIELD_FORGOT_LIMITER = exports.SHIELD_LOGIN_TOTP_VERIFIER = exports.SHIELD_MFA_STEP_UP = exports.SHIELD_MFA_LIMITER = exports.SHIELD_RECOVERY_LIMITER = exports.SHIELD_LOGIN_IP_LIMITER = exports.SHIELD_LOGIN_LIMITER = exports.SHIELD_MEMBERSHIP_CHECKER = exports.SHIELD_SCOPE_SUBTREE_RESOLVER = exports.SHIELD_SESSION_FACTS_PROJECTOR = exports.SHIELD_ROOT_IDS = exports.SHIELD_TOTP_VERIFIER_OVERRIDE = exports.SHIELD_TOTP_VERIFIER = exports.SHIELD_RESET_LINK_BASE_URL = exports.SHIELD_SESSION_SWEEPER = exports.SHIELD_MFA_DEVICE_STORE = exports.SHIELD_DEFAULT_AUTH_AUDIT_SINK = exports.SHIELD_AUDIT_SINK = exports.SHIELD_PROFILE_WRITER = exports.SHIELD_RECOVERY_CODE_STORE = exports.SHIELD_EMAIL_DELIVERY = exports.SHIELD_ATTEMPT_LIMITER_FACTORY = exports.SHIELD_MESSAGE_DISPATCHER = exports.SHIELD_EMAIL_SENDER = exports.SHIELD_CONFIRM_EMAIL_LIMITER = exports.SHIELD_EMAIL_CHANGE_LIMITER = exports.SHIELD_EMAIL_CHANGE_LINK_BASE_URL = exports.SHIELD_EMAIL_ADDRESS_CHANGER = exports.SHIELD_EMAIL_CHANGE_TOKEN_STORE = exports.SHIELD_RESET_TOKEN_STORE = exports.SHIELD_CREDENTIAL_WRITER = exports.SHIELD_RECENT_ROTATION_STORE = exports.SHIELD_SESSION_AUTHORITY = exports.SHIELD_AUTHENTICATOR = exports.SHIELD_PROFILE_RESOLVER = exports.SHIELD_CREDENTIAL_RESOLVER = exports.SHIELD_REDIS = exports.SHIELD_AUDIT_SEALER_POOL = exports.SHIELD_DB_POOL = exports.SHIELD_PASSWORD_HASHER = void 0;
|
|
27
|
-
exports.SHIELD_CAPTCHA_GATE = exports.SHIELD_CAPTCHA_VERIFIER = exports.SHIELD_CAPTCHA_CONFIG = exports.SHIELD_MFA_POLICY_FEATURE = void 0;
|
|
27
|
+
exports.SHIELD_CAPTCHA_GATE = exports.SHIELD_CAPTCHA_VERIFIER = exports.SHIELD_NOTIFICATION_STORE = exports.SHIELD_NOTIFICATIONS = exports.SHIELD_CAPTCHA_CONFIG = exports.SHIELD_MFA_POLICY_FEATURE = void 0;
|
|
28
28
|
var argon2id_password_hasher_js_1 = require("../authentication/argon2id-password-hasher.js");
|
|
29
29
|
Object.defineProperty(exports, "SHIELD_PASSWORD_HASHER", { enumerable: true, get: function () { return argon2id_password_hasher_js_1.SHIELD_PASSWORD_HASHER; } });
|
|
30
30
|
/**
|
|
@@ -471,5 +471,18 @@ exports.SHIELD_MFA_POLICY_FEATURE = Symbol('SHIELD_MFA_POLICY_FEATURE');
|
|
|
471
471
|
* so every route answers exactly as before).
|
|
472
472
|
*/
|
|
473
473
|
exports.SHIELD_CAPTCHA_CONFIG = Symbol('SHIELD_CAPTCHA_CONFIG');
|
|
474
|
+
/**
|
|
475
|
+
* G-027 step 2 (notification-store SPEC §5B, §6): the {@link
|
|
476
|
+
* import('../notifications/notification.service.js').NotificationService} through which app and
|
|
477
|
+
* framework code posts notices under registered kinds. Bound with `auth: true`, exported app-wide
|
|
478
|
+
* and from the main entry.
|
|
479
|
+
*/
|
|
480
|
+
exports.SHIELD_NOTIFICATIONS = Symbol('SHIELD_NOTIFICATIONS');
|
|
481
|
+
/**
|
|
482
|
+
* G-027 step 2: the {@link import('../notifications/ports.js').NotificationStore} (default
|
|
483
|
+
* `MariaDbNotificationStore` over the core pool). Internal to the auth wiring: the service, the
|
|
484
|
+
* retention job and the `/account/notifications` routes use it.
|
|
485
|
+
*/
|
|
486
|
+
exports.SHIELD_NOTIFICATION_STORE = Symbol('SHIELD_NOTIFICATION_STORE');
|
|
474
487
|
exports.SHIELD_CAPTCHA_VERIFIER = Symbol('SHIELD_CAPTCHA_VERIFIER');
|
|
475
488
|
exports.SHIELD_CAPTCHA_GATE = Symbol('SHIELD_CAPTCHA_GATE');
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { OperationInventory, ModuleRegistry } from '@astram/core';
|
|
2
|
+
import type { PermissionText } from '@astram/engine';
|
|
2
3
|
import type { CatalogStore, ReconcileReport } from './ports/catalog-store.js';
|
|
3
4
|
/** A @Classified route could not be gated (stranded or key-not-registered). Boot must
|
|
4
5
|
* abort — an ungatable route may never serve traffic (ADR-0002 fail-closed). */
|
|
@@ -15,7 +16,21 @@ export declare class CatalogReconciler {
|
|
|
15
16
|
* CRON — mutating. Auto-adds an ACTIVE catalog row per registered non-public action,
|
|
16
17
|
* marks orphaned any stored row with no registered action, reactivates revived ones.
|
|
17
18
|
* Idempotent. Returns a report for logging + /health/catalog.
|
|
19
|
+
*
|
|
20
|
+
* G-027 (spec §5E): `opts.text` (from `permissionTextByKey`) supplies label, description
|
|
21
|
+
* and caution; a key without text gets the engine's generated label. An insert stamps
|
|
22
|
+
* `firstSeenAt`/`lastActivatedAt = nowIso` and `firstSeenVersion = opts.release ?? null`;
|
|
23
|
+
* a reactivation stamps `lastActivatedAt` only. First-seen fields are never sent anywhere
|
|
24
|
+
* but the insert (spec §11, §13). A registered row whose text differs from `opts.text` is
|
|
25
|
+
* rewritten through ONE `store.updateText` call (skipped when the store lacks it).
|
|
18
26
|
*/
|
|
19
|
-
reconcile(registry: ModuleRegistry, store: CatalogStore, nowIso: string): Promise<ReconcileReport>;
|
|
27
|
+
reconcile(registry: ModuleRegistry, store: CatalogStore, nowIso: string, opts?: ReconcileOptions): Promise<ReconcileReport>;
|
|
28
|
+
}
|
|
29
|
+
/** Options of {@link CatalogReconciler.reconcile} (G-027, spec §5E). */
|
|
30
|
+
export interface ReconcileOptions {
|
|
31
|
+
/** Permission key → code text (`permissionTextByKey`). Absent ⇒ generated labels, no relabel. */
|
|
32
|
+
readonly text?: ReadonlyMap<string, PermissionText>;
|
|
33
|
+
/** The app release (`APP_RELEASE`) stamped as `firstSeenVersion` on insert; absent ⇒ null. */
|
|
34
|
+
readonly release?: string | null;
|
|
20
35
|
}
|
|
21
36
|
//# sourceMappingURL=catalog-reconciler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-reconciler.d.ts","sourceRoot":"","sources":["../../src/completeness/catalog-reconciler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog-reconciler.d.ts","sourceRoot":"","sources":["../../src/completeness/catalog-reconciler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,KAAK,EAEV,YAAY,EAEZ,eAAe,EAChB,MAAM,0BAA0B,CAAC;AAElC;iFACiF;AACjF,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,iBAAiB;IAC5B;;;OAGG;IACH,aAAa,CAAC,SAAS,EAAE,kBAAkB,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI;IAgB5E;;;;;;;;;;;OAWG;IACG,SAAS,CACb,QAAQ,EAAE,cAAc,EACxB,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,gBAAgB,GACtB,OAAO,CAAC,eAAe,CAAC;CA2D5B;AAED,wEAAwE;AACxE,MAAM,WAAW,gBAAgB;IAC/B,iGAAiG;IACjG,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACpD,8FAA8F;IAC9F,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC"}
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CatalogReconciler = exports.CatalogGatabilityError = void 0;
|
|
4
4
|
// astram-framework/packages/guard/src/completeness/catalog-reconciler.ts
|
|
5
5
|
const core_1 = require("@astram/core");
|
|
6
|
+
const engine_1 = require("@astram/engine");
|
|
7
|
+
const identity_actions_js_1 = require("../identity/identity-actions.js");
|
|
6
8
|
/** A @Classified route could not be gated (stranded or key-not-registered). Boot must
|
|
7
9
|
* abort — an ungatable route may never serve traffic (ADR-0002 fail-closed). */
|
|
8
10
|
class CatalogGatabilityError extends Error {
|
|
@@ -32,43 +34,105 @@ class CatalogReconciler {
|
|
|
32
34
|
* CRON — mutating. Auto-adds an ACTIVE catalog row per registered non-public action,
|
|
33
35
|
* marks orphaned any stored row with no registered action, reactivates revived ones.
|
|
34
36
|
* Idempotent. Returns a report for logging + /health/catalog.
|
|
37
|
+
*
|
|
38
|
+
* G-027 (spec §5E): `opts.text` (from `permissionTextByKey`) supplies label, description
|
|
39
|
+
* and caution; a key without text gets the engine's generated label. An insert stamps
|
|
40
|
+
* `firstSeenAt`/`lastActivatedAt = nowIso` and `firstSeenVersion = opts.release ?? null`;
|
|
41
|
+
* a reactivation stamps `lastActivatedAt` only. First-seen fields are never sent anywhere
|
|
42
|
+
* but the insert (spec §11, §13). A registered row whose text differs from `opts.text` is
|
|
43
|
+
* rewritten through ONE `store.updateText` call (skipped when the store lacks it).
|
|
35
44
|
*/
|
|
36
|
-
async reconcile(registry, store, nowIso) {
|
|
45
|
+
async reconcile(registry, store, nowIso, opts) {
|
|
46
|
+
const text = opts?.text;
|
|
47
|
+
const release = opts?.release ?? null;
|
|
37
48
|
const stored = await store.listPermissions();
|
|
38
49
|
const storedByKey = new Map(stored.map((r) => [r.permissionKey, r]));
|
|
39
50
|
const registered = registry.listActions().filter((a) => a.tier !== 'public');
|
|
40
51
|
const registeredKeys = new Set(registered.map((a) => a.permissionKey));
|
|
41
|
-
// code → catalog: add missing rows; revive orphaned-but-now-registered.
|
|
52
|
+
// code → catalog: add missing rows; revive orphaned-but-now-registered; queue text rewrites.
|
|
42
53
|
const added = [];
|
|
43
54
|
const reactivated = [];
|
|
55
|
+
const textUpdates = [];
|
|
44
56
|
for (const a of registered) {
|
|
45
57
|
const key = a.permissionKey;
|
|
46
58
|
const existing = storedByKey.get(key);
|
|
47
59
|
if (!existing) {
|
|
60
|
+
const t = text?.get(key) ?? generatedText(registry, a.action.typeKey, a.action.actionKey);
|
|
48
61
|
const inserted = await store.upsertPermission({
|
|
49
62
|
permissionKey: key,
|
|
50
63
|
moduleKey: a.moduleKey,
|
|
51
64
|
typeKey: a.action.typeKey,
|
|
52
65
|
action: a.action.actionKey,
|
|
53
|
-
label:
|
|
66
|
+
label: t.label,
|
|
54
67
|
tier: a.tier,
|
|
68
|
+
description: t.description,
|
|
69
|
+
caution: t.caution,
|
|
70
|
+
firstSeenAt: nowIso,
|
|
71
|
+
firstSeenVersion: release,
|
|
72
|
+
lastActivatedAt: nowIso,
|
|
55
73
|
});
|
|
56
74
|
if (inserted)
|
|
57
75
|
added.push(key);
|
|
76
|
+
continue;
|
|
58
77
|
}
|
|
59
|
-
|
|
78
|
+
if (existing.status === 'orphaned')
|
|
60
79
|
reactivated.push(key);
|
|
80
|
+
const t = text?.get(key);
|
|
81
|
+
if (t && textDiffers(existing, t)) {
|
|
82
|
+
textUpdates.push({
|
|
83
|
+
permissionKey: key,
|
|
84
|
+
label: t.label,
|
|
85
|
+
description: t.description,
|
|
86
|
+
caution: t.caution,
|
|
87
|
+
});
|
|
61
88
|
}
|
|
62
89
|
}
|
|
63
90
|
if (reactivated.length)
|
|
64
|
-
await store.markActive(reactivated);
|
|
91
|
+
await store.markActive(reactivated, nowIso);
|
|
92
|
+
const relabelled = [];
|
|
93
|
+
if (textUpdates.length && store.updateText) {
|
|
94
|
+
await store.updateText(textUpdates);
|
|
95
|
+
relabelled.push(...textUpdates.map((u) => u.permissionKey));
|
|
96
|
+
}
|
|
65
97
|
// catalog → code: mark orphaned any active stored row with no registered action.
|
|
66
98
|
const orphaned = stored
|
|
67
99
|
.filter((r) => r.status === 'active' && !registeredKeys.has(r.permissionKey))
|
|
68
100
|
.map((r) => r.permissionKey);
|
|
69
101
|
if (orphaned.length)
|
|
70
102
|
await store.markOrphaned(orphaned);
|
|
71
|
-
return { added, orphaned, reactivated, at: nowIso };
|
|
103
|
+
return { added, orphaned, reactivated, relabelled, at: nowIso };
|
|
72
104
|
}
|
|
73
105
|
}
|
|
74
106
|
exports.CatalogReconciler = CatalogReconciler;
|
|
107
|
+
/** Stored vs code text, with absent/undefined normalised to null. */
|
|
108
|
+
function textDiffers(row, t) {
|
|
109
|
+
return (row.label !== t.label ||
|
|
110
|
+
(row.description ?? null) !== (t.description ?? null) ||
|
|
111
|
+
(row.caution ?? null) !== (t.caution ?? null));
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The engine's generated text for a key with no text map entry (spec §10): engine
|
|
115
|
+
* `permissionTextOf` over a one-action declaration, the type label taken from the registry
|
|
116
|
+
* descriptor when it differs from the typeKey (the bridge sets `reg.label ?? typeKey`), else
|
|
117
|
+
* the humanized typeKey. A registry the engine rules cannot describe (e.g. a non-engine
|
|
118
|
+
* module's reserved action or an out-of-limits label) keeps the pre-G-027 label.
|
|
119
|
+
*/
|
|
120
|
+
function generatedText(registry, typeKey, actionKey) {
|
|
121
|
+
const descriptorLabel = registry.resolveObjectType(typeKey)?.label;
|
|
122
|
+
const label = descriptorLabel && descriptorLabel !== typeKey ? descriptorLabel : undefined;
|
|
123
|
+
const isCrud = identity_actions_js_1.IDENTITY_ACTIONS.includes(actionKey);
|
|
124
|
+
try {
|
|
125
|
+
const [t] = (0, engine_1.permissionTextOf)({
|
|
126
|
+
typeKey,
|
|
127
|
+
...(label !== undefined ? { label } : {}),
|
|
128
|
+
...(isCrud ? {} : { crudActions: false, actions: [actionKey] }),
|
|
129
|
+
}).filter((p) => p.action === actionKey);
|
|
130
|
+
if (t)
|
|
131
|
+
return t;
|
|
132
|
+
}
|
|
133
|
+
catch (err) {
|
|
134
|
+
if (!(err instanceof engine_1.RegistrationError))
|
|
135
|
+
throw err;
|
|
136
|
+
}
|
|
137
|
+
return { label: `${actionKey} ${typeKey}`, description: null, caution: null };
|
|
138
|
+
}
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
* the consumer app supplies the implementation (ADR-0003 — guard does no DB). A row is
|
|
4
4
|
* keyed by its permission key (`moduleKey:typeKey:actionKey`); `status` is the soft
|
|
5
5
|
* active/orphaned marker (never hard-delete).
|
|
6
|
+
*
|
|
7
|
+
* G-027 (permission text + first seen): the text and date fields are OPTIONAL and additive,
|
|
8
|
+
* so a store written before them keeps compiling. `firstSeenAt`/`firstSeenVersion` are
|
|
9
|
+
* written once, by the insert, and never changed afterwards (insert-only; the reconciler never
|
|
10
|
+
* asks the store to update them). Dates are ISO strings; `null` = unknown (e.g. a key that
|
|
11
|
+
* existed before tracking).
|
|
6
12
|
*/
|
|
7
13
|
export interface CatalogPermissionRow {
|
|
8
14
|
readonly permissionKey: string;
|
|
@@ -12,22 +18,51 @@ export interface CatalogPermissionRow {
|
|
|
12
18
|
readonly label: string;
|
|
13
19
|
readonly tier: string;
|
|
14
20
|
readonly status: 'active' | 'orphaned';
|
|
21
|
+
/** What holding the permission lets a person do (plain text). */
|
|
22
|
+
readonly description?: string | null;
|
|
23
|
+
/** Optional warning shown to whoever grants it (plain text). */
|
|
24
|
+
readonly caution?: string | null;
|
|
25
|
+
/** When the key was first catalogued (ISO); insert-only. */
|
|
26
|
+
readonly firstSeenAt?: string | null;
|
|
27
|
+
/** The app release (`APP_RELEASE`) that first catalogued the key; insert-only. */
|
|
28
|
+
readonly firstSeenVersion?: string | null;
|
|
29
|
+
/** When the key last became active (insert or orphaned → active), ISO. */
|
|
30
|
+
readonly lastActivatedAt?: string | null;
|
|
31
|
+
}
|
|
32
|
+
/** One text rewrite the reconciler asks for (code text replaces stored text, G-027). */
|
|
33
|
+
export interface CatalogTextUpdate {
|
|
34
|
+
readonly permissionKey: string;
|
|
35
|
+
readonly label: string;
|
|
36
|
+
readonly description: string | null;
|
|
37
|
+
readonly caution: string | null;
|
|
15
38
|
}
|
|
16
39
|
/** The result of one mutating reconcile pass — surfaced via /health/catalog + logged. */
|
|
17
40
|
export interface ReconcileReport {
|
|
18
41
|
readonly added: readonly string[];
|
|
19
42
|
readonly orphaned: readonly string[];
|
|
20
43
|
readonly reactivated: readonly string[];
|
|
44
|
+
readonly relabelled: readonly string[];
|
|
21
45
|
readonly at: string;
|
|
22
46
|
}
|
|
23
47
|
export interface CatalogStore {
|
|
24
48
|
/** All catalog rows (both active + orphaned). */
|
|
25
49
|
listPermissions(): Promise<CatalogPermissionRow[]>;
|
|
26
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Idempotent insert of an ACTIVE row (no-op if the key already exists). Insert-only: an
|
|
52
|
+
* existing row is never updated here, so its first-seen fields keep their first values.
|
|
53
|
+
*/
|
|
27
54
|
upsertPermission(row: Omit<CatalogPermissionRow, 'status'>): Promise<boolean>;
|
|
28
55
|
/** Mark keys orphaned (soft). No-op for keys already orphaned. */
|
|
29
56
|
markOrphaned(keys: readonly string[]): Promise<void>;
|
|
30
|
-
/**
|
|
31
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Flip keys orphaned → active (a route returned). With `nowIso`, stamp `lastActivatedAt`;
|
|
59
|
+
* never touch `firstSeenAt`/`firstSeenVersion`.
|
|
60
|
+
*/
|
|
61
|
+
markActive(keys: readonly string[], nowIso?: string): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* OPTIONAL (G-027): rewrite label/description/caution of existing rows to the code's text.
|
|
64
|
+
* Writes only those three fields. A store without it still reconciles (no relabelling).
|
|
65
|
+
*/
|
|
66
|
+
updateText?(rows: readonly CatalogTextUpdate[]): Promise<void>;
|
|
32
67
|
}
|
|
33
68
|
//# sourceMappingURL=catalog-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-store.d.ts","sourceRoot":"","sources":["../../../src/completeness/ports/catalog-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"catalog-store.d.ts","sourceRoot":"","sources":["../../../src/completeness/ports/catalog-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAC;IACvC,iEAAiE;IACjE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,gEAAgE;IAChE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,kFAAkF;IAClF,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,0EAA0E;IAC1E,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,GA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
|
3
|
+
* `auth: true` wiring; an invalid value fails the boot naming the variable and its bounds, never
|
|
4
|
+
* the value (it might be a misplaced secret). Unset, empty or whitespace-only ⇒ the default, as
|
|
5
|
+
* `loadAuditSealConfig`.
|
|
6
|
+
*/
|
|
7
|
+
import type { NotificationRetentionPolicy } from '../notifications/ports.js';
|
|
8
|
+
/** Days a READ notice is kept, and days ANY notice is kept. */
|
|
9
|
+
export type NotificationConfig = NotificationRetentionPolicy;
|
|
10
|
+
export declare const DEFAULT_NOTIFICATION_READ_RETENTION_DAYS = 90;
|
|
11
|
+
export declare const DEFAULT_NOTIFICATION_MAX_RETENTION_DAYS = 365;
|
|
12
|
+
export declare const MIN_NOTIFICATION_RETENTION_DAYS = 1;
|
|
13
|
+
export declare const MAX_NOTIFICATION_RETENTION_DAYS = 3650;
|
|
14
|
+
/**
|
|
15
|
+
* Load and validate `NOTIFICATION_READ_RETENTION_DAYS` (90, 1–3650) and
|
|
16
|
+
* `NOTIFICATION_MAX_RETENTION_DAYS` (365, at least the read retention, ≤ 3650).
|
|
17
|
+
* @throws Error naming the variable on an invalid value.
|
|
18
|
+
*/
|
|
19
|
+
export declare function loadNotificationConfig(env: NodeJS.ProcessEnv): NotificationConfig;
|
|
20
|
+
//# sourceMappingURL=notification-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-config.d.ts","sourceRoot":"","sources":["../../src/config/notification-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAE7E,+DAA+D;AAC/D,MAAM,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AAE7D,eAAO,MAAM,wCAAwC,KAAK,CAAC;AAC3D,eAAO,MAAM,uCAAuC,MAAM,CAAC;AAC3D,eAAO,MAAM,+BAA+B,IAAI,CAAC;AACjD,eAAO,MAAM,+BAA+B,OAAO,CAAC;AAqBpD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,kBAAkB,CAqBjF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MAX_NOTIFICATION_RETENTION_DAYS = exports.MIN_NOTIFICATION_RETENTION_DAYS = exports.DEFAULT_NOTIFICATION_MAX_RETENTION_DAYS = exports.DEFAULT_NOTIFICATION_READ_RETENTION_DAYS = void 0;
|
|
4
|
+
exports.loadNotificationConfig = loadNotificationConfig;
|
|
5
|
+
exports.DEFAULT_NOTIFICATION_READ_RETENTION_DAYS = 90;
|
|
6
|
+
exports.DEFAULT_NOTIFICATION_MAX_RETENTION_DAYS = 365;
|
|
7
|
+
exports.MIN_NOTIFICATION_RETENTION_DAYS = 1;
|
|
8
|
+
exports.MAX_NOTIFICATION_RETENTION_DAYS = 3650;
|
|
9
|
+
/** Plain decimal digits only (no sign, exponent, radix prefix or fraction). */
|
|
10
|
+
const PLAIN_DIGITS = /^[0-9]{1,10}$/;
|
|
11
|
+
function boundedDays(env, name, fallback, min, max) {
|
|
12
|
+
const value = env[name]?.trim();
|
|
13
|
+
if (!value)
|
|
14
|
+
return fallback;
|
|
15
|
+
const n = PLAIN_DIGITS.test(value) ? Number(value) : NaN;
|
|
16
|
+
if (!Number.isSafeInteger(n) || n < min || n > max) {
|
|
17
|
+
throw new Error(`${name} must be a whole number of days between ${min} and ${max}`);
|
|
18
|
+
}
|
|
19
|
+
return n;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Load and validate `NOTIFICATION_READ_RETENTION_DAYS` (90, 1–3650) and
|
|
23
|
+
* `NOTIFICATION_MAX_RETENTION_DAYS` (365, at least the read retention, ≤ 3650).
|
|
24
|
+
* @throws Error naming the variable on an invalid value.
|
|
25
|
+
*/
|
|
26
|
+
function loadNotificationConfig(env) {
|
|
27
|
+
const readDays = boundedDays(env, 'NOTIFICATION_READ_RETENTION_DAYS', exports.DEFAULT_NOTIFICATION_READ_RETENTION_DAYS, exports.MIN_NOTIFICATION_RETENTION_DAYS, exports.MAX_NOTIFICATION_RETENTION_DAYS);
|
|
28
|
+
const maxDays = boundedDays(env, 'NOTIFICATION_MAX_RETENTION_DAYS', exports.DEFAULT_NOTIFICATION_MAX_RETENTION_DAYS, exports.MIN_NOTIFICATION_RETENTION_DAYS, exports.MAX_NOTIFICATION_RETENTION_DAYS);
|
|
29
|
+
if (maxDays < readDays) {
|
|
30
|
+
throw new Error('NOTIFICATION_MAX_RETENTION_DAYS must be at least NOTIFICATION_READ_RETENTION_DAYS');
|
|
31
|
+
}
|
|
32
|
+
return { readDays, maxDays };
|
|
33
|
+
}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { ModuleRegistry } from '@astram/core';
|
|
2
|
-
import type { ObjectTypeInput } from '@astram/engine';
|
|
2
|
+
import type { ObjectTypeInput, PermissionText } from '@astram/engine';
|
|
3
3
|
export declare function buildIdentityModuleRegistry(inputs: readonly ObjectTypeInput[]): ModuleRegistry;
|
|
4
|
+
/**
|
|
5
|
+
* G-027 (spec §5D): the permission text of every action of the given types, keyed by the SAME
|
|
6
|
+
* permission key {@link buildIdentityModuleRegistry} registers (`MODULE_KEY` + core
|
|
7
|
+
* `derivePermissionKey`). Engine `permissionTextOf` gives the text in `effectiveActions` order
|
|
8
|
+
* (= {@link actionsOf}); declared text wins, else the generated label. Throws engine's
|
|
9
|
+
* `RegistrationError` on invalid text, like the registry build.
|
|
10
|
+
*/
|
|
11
|
+
export declare function permissionTextByKey(inputs: readonly ObjectTypeInput[]): ReadonlyMap<string, PermissionText>;
|
|
4
12
|
//# sourceMappingURL=module-registry.bridge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-registry.bridge.d.ts","sourceRoot":"","sources":["../../src/identity/module-registry.bridge.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAc,eAAe,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"module-registry.bridge.d.ts","sourceRoot":"","sources":["../../src/identity/module-registry.bridge.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAc,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AASlF,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,GAAG,cAAc,CAgC9F;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,eAAe,EAAE,GACjC,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAQrC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildIdentityModuleRegistry = buildIdentityModuleRegistry;
|
|
4
|
+
exports.permissionTextByKey = permissionTextByKey;
|
|
4
5
|
/**
|
|
5
6
|
* Bridge: engine ObjectTypes → a populated core ModuleRegistry. Ported from astram3 (framework
|
|
6
7
|
* now owns identity). Engine ObjectTypes describe physical tables; core's gates + the
|
|
@@ -25,7 +26,8 @@ function buildIdentityModuleRegistry(inputs) {
|
|
|
25
26
|
const access = (0, core_access_js_1.coreAccessOf)(r.access);
|
|
26
27
|
return {
|
|
27
28
|
typeKey: r.typeKey,
|
|
28
|
-
|
|
29
|
+
// G-027: the type's declared human name, else its typeKey (core contract unchanged).
|
|
30
|
+
label: r.label ?? r.typeKey,
|
|
29
31
|
fields: r.fields.map((f) => {
|
|
30
32
|
const ref = (0, engine_1.referencedTypeOf)(f);
|
|
31
33
|
return { key: f.key, label: f.key, ...(ref ? { referencesTypeKey: ref } : {}) };
|
|
@@ -48,3 +50,19 @@ function buildIdentityModuleRegistry(inputs) {
|
|
|
48
50
|
registry.register(metadata);
|
|
49
51
|
return registry;
|
|
50
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* G-027 (spec §5D): the permission text of every action of the given types, keyed by the SAME
|
|
55
|
+
* permission key {@link buildIdentityModuleRegistry} registers (`MODULE_KEY` + core
|
|
56
|
+
* `derivePermissionKey`). Engine `permissionTextOf` gives the text in `effectiveActions` order
|
|
57
|
+
* (= {@link actionsOf}); declared text wins, else the generated label. Throws engine's
|
|
58
|
+
* `RegistrationError` on invalid text, like the registry build.
|
|
59
|
+
*/
|
|
60
|
+
function permissionTextByKey(inputs) {
|
|
61
|
+
const out = new Map();
|
|
62
|
+
for (const reg of inputs.map(toObjectType)) {
|
|
63
|
+
for (const t of (0, engine_1.permissionTextOf)(reg)) {
|
|
64
|
+
out.set((0, core_1.derivePermissionKey)(identity_actions_js_1.MODULE_KEY, reg.typeKey, t.action), t);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return out;
|
|
68
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
* `@nestjs/core`, `reflect-metadata`, `rxjs` so the host owns one copy of each.
|
|
16
16
|
*/
|
|
17
17
|
export { guardMigrationsDir } from './migrations-dir.js';
|
|
18
|
-
export { buildIdentityModuleRegistry } from './identity/module-registry.bridge.js';
|
|
18
|
+
export { buildIdentityModuleRegistry, permissionTextByKey, } from './identity/module-registry.bridge.js';
|
|
19
|
+
export type { PermissionText } from '@astram/engine';
|
|
19
20
|
export { MODULE_KEY, IDENTITY_ACTIONS, CROSS_TENANT_GRANT_ACTIONS, RECORD_SHARE_ACTIONS, SERVICE_ACCOUNT_ACTIONS, actionsFor, actionsOf, } from './identity/identity-actions.js';
|
|
20
21
|
export { ShieldModule, SHIELD_DECISION_AUTHORITY, SHIELD_RECORD_AUTHORIZATION, type ShieldModuleOptions, type ShieldModuleAsyncOptions, type RecordAuthorizationInputs, } from './module/shield.module.js';
|
|
21
22
|
export { Public, Classified, CLASSIFICATION_METADATA, DEFAULT_CLASSIFIED_ACTION, normalizeClassification, } from './enforcement/classification.decorator.js';
|
|
@@ -23,7 +24,8 @@ export type { Classification } from './enforcement/classification.decorator.js';
|
|
|
23
24
|
export { UuidPipe, uuidField, optionalUuidField, uuidArrayField } from './enforcement/uuid.pipe.js';
|
|
24
25
|
export { OperationInventoryScanner } from './completeness/operation-inventory-scanner.js';
|
|
25
26
|
export { CatalogReconciler, CatalogGatabilityError } from './completeness/catalog-reconciler.js';
|
|
26
|
-
export type {
|
|
27
|
+
export type { ReconcileOptions } from './completeness/catalog-reconciler.js';
|
|
28
|
+
export type { CatalogStore, CatalogPermissionRow, CatalogTextUpdate, ReconcileReport, } from './completeness/ports/catalog-store.js';
|
|
27
29
|
export { SHIELD_SESSION_TOKEN_BINDER, SHIELD_SERVICE_AUTHENTICATOR, } from './request-auth/tokens.js';
|
|
28
30
|
export { SessionTokenBinder } from './request-auth/session-token-binder.js';
|
|
29
31
|
export type { BoundPrincipalClaims, SessionTokenBinderOptions, } from './request-auth/session-token-binder.js';
|
|
@@ -42,6 +44,10 @@ export { S3ObjectStore, type S3ObjectStoreConfig, type S3ObjectStoreOptions, } f
|
|
|
42
44
|
export { NodeSha256Digest } from './storage/node-sha256-digest.js';
|
|
43
45
|
export { NodeSha256Hash } from './audit/node-sha256-hash.js';
|
|
44
46
|
export { loadAuditSealConfig, type AuditSealConfig } from './audit/audit-seal-config.js';
|
|
47
|
+
export { NotificationService, type NotificationPostInput, type NotificationPostResult, } from './notifications/notification.service.js';
|
|
48
|
+
export { NOTIFICATION_CATEGORIES, NotificationKindError, NotificationValidationError, NotificationUnavailableError, type NotificationCategory, type NotificationKindRegistration, type NotificationQuery, type NotificationWriteOptions, } from './notifications/ports.js';
|
|
49
|
+
export { loadNotificationConfig, type NotificationConfig } from './config/notification-config.js';
|
|
50
|
+
export { SHIELD_NOTIFICATIONS } from './auth/tokens.js';
|
|
45
51
|
export { ObjectStoreBootCheck } from './storage/object-store-boot-check.js';
|
|
46
52
|
export { FileIntake, FILE_INTAKE_REQUEST_KEY, FILE_INTAKE_DEFAULT_MAX_BYTES, type FileIntakeOptions, type FileIntakeResult, } from './storage/file-intake.interceptor.js';
|
|
47
53
|
export type { ShieldStorageOption } from './storage/storage.providers.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AASzD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AASzD,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAE9C,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,oBAAoB,EACpB,uBAAuB,EACvB,UAAU,EACV,SAAS,GACV,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EACL,YAAY,EACZ,yBAAyB,EAGzB,2BAA2B,EAC3B,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAI7B,KAAK,yBAAyB,GAC/B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,MAAM,EACN,UAAU,EACV,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,2CAA2C,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAKhF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAKpG,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAA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