@astram/identity 0.20.0 → 0.22.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/features/authz/access-change-notifier.d.ts +109 -0
- package/dist/features/authz/access-change-notifier.d.ts.map +1 -0
- package/dist/features/authz/access-change-notifier.js +421 -0
- package/dist/features/authz/grant-admin.service.d.ts +27 -1
- package/dist/features/authz/grant-admin.service.d.ts.map +1 -1
- package/dist/features/authz/grant-admin.service.js +52 -2
- package/dist/features/identity-feature.module.d.ts.map +1 -1
- package/dist/features/identity-feature.module.js +26 -1
- package/dist/features/membership/membership.service.d.ts +19 -2
- package/dist/features/membership/membership.service.d.ts.map +1 -1
- package/dist/features/membership/membership.service.js +57 -5
- package/dist/features/membership/posting.service.d.ts +12 -1
- package/dist/features/membership/posting.service.d.ts.map +1 -1
- package/dist/features/membership/posting.service.js +39 -2
- package/dist/features/permission-announcement/permission-announcement.controller.d.ts +22 -0
- package/dist/features/permission-announcement/permission-announcement.controller.d.ts.map +1 -0
- package/dist/features/permission-announcement/permission-announcement.controller.js +130 -0
- package/dist/features/permission-announcement/permission-announcement.service.d.ts +143 -0
- package/dist/features/permission-announcement/permission-announcement.service.d.ts.map +1 -0
- package/dist/features/permission-announcement/permission-announcement.service.js +389 -0
- package/migrations/1710000000109-CreatePermissionAnnouncementDismissal.cjs +46 -0
- package/package.json +4 -4
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework identity migration — "Reviewed, not needed" dismissals of permission-announcement admin
|
|
3
|
+
* tasks (G-027 step 4, NAES G-034 R3; spec `docs/features/permission-announcements/SPEC.md` §4A).
|
|
4
|
+
*
|
|
5
|
+
* `<identity>.permission_announcement_dismissal` — one row per company and permission key that an
|
|
6
|
+
* administrator closed on purpose. Open tasks are never stored: identity computes them on read from
|
|
7
|
+
* the catalog (`<authz>.permission`) and the company's roles, so a grant closes a task with no job.
|
|
8
|
+
* Written and read only by identity's `PermissionAnnouncementService`.
|
|
9
|
+
* - pad_company_uuid: the company the task belongs to (server-authorized, never trusted input).
|
|
10
|
+
* - pad_perm_key: the permission key (same width as `role_permission.rp_perm_key`).
|
|
11
|
+
* - pad_activated_at: the key's `perm_last_activated_at` when dismissed; a later re-activation
|
|
12
|
+
* (key removed, then re-added by a release) no longer matches, so the task opens again.
|
|
13
|
+
* - pad_dismissed_by / pad_dismissed_at: the actor and time (the audit row is the record).
|
|
14
|
+
* No foreign keys (companies live in the app database, keys in authz): a row left by a deleted
|
|
15
|
+
* company or an orphaned key is ignored by the read.
|
|
16
|
+
*
|
|
17
|
+
* Idempotent (CREATE TABLE IF NOT EXISTS); `down` drops the table with IF EXISTS. No rows are
|
|
18
|
+
* written, no ids are hard-coded. Database names come from `ctx.schemas` (namespace or single
|
|
19
|
+
* layout, ADR-0037/ADR-0041); the table is listed in core `FRAMEWORK_TABLES`.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const { frameworkSchemasForMigration } = require('@astram/core');
|
|
23
|
+
|
|
24
|
+
async function up(ctx) {
|
|
25
|
+
const { query } = ctx;
|
|
26
|
+
const { identity: IDENTITY } = frameworkSchemasForMigration(ctx, process.env);
|
|
27
|
+
|
|
28
|
+
await query(
|
|
29
|
+
`CREATE TABLE IF NOT EXISTS \`${IDENTITY}\`.\`permission_announcement_dismissal\` (
|
|
30
|
+
pad_company_uuid CHAR(36) NOT NULL,
|
|
31
|
+
pad_perm_key VARCHAR(191) NOT NULL,
|
|
32
|
+
pad_activated_at TIMESTAMP(3) NOT NULL,
|
|
33
|
+
pad_dismissed_by CHAR(36) NOT NULL,
|
|
34
|
+
pad_dismissed_at TIMESTAMP(3) NOT NULL,
|
|
35
|
+
PRIMARY KEY (pad_company_uuid, pad_perm_key)
|
|
36
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci`,
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async function down(ctx) {
|
|
41
|
+
const { query } = ctx;
|
|
42
|
+
const { identity: IDENTITY } = frameworkSchemasForMigration(ctx, process.env);
|
|
43
|
+
await query(`DROP TABLE IF EXISTS \`${IDENTITY}\`.\`permission_announcement_dismissal\``);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = { up, down };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astram/identity",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Astram framework — the framework-owned identity + tenancy model. Hosts the identity @ObjectType classes (user, company, membership, posting), framework-authored identity migrations, and the identity resolver. Top of the dependency graph: depends on @astram/engine (for @ObjectType/@Field decorators) + @astram/guard / @astram/core (for the auth ports).",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"mariadb": "^3.5.4",
|
|
39
|
-
"@astram/core": "1.
|
|
40
|
-
"@astram/
|
|
41
|
-
"@astram/
|
|
39
|
+
"@astram/core": "1.14.0",
|
|
40
|
+
"@astram/engine": "0.16.2",
|
|
41
|
+
"@astram/guard": "0.25.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@nestjs/common": "^11",
|