@dudousxd/nestjs-authz-prisma 0.5.0 → 0.6.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/CHANGELOG.md +22 -0
- package/README.md +20 -6
- package/dist/authz-rbac.module.d.ts.map +1 -1
- package/dist/authz-rbac.module.js +12 -0
- package/dist/authz-rbac.module.js.map +1 -1
- package/package.json +10 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @dudousxd/nestjs-authz-prisma
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#67](https://github.com/DavideCarvalho/nestjs-authz/pull/67) [`32e967f`](https://github.com/DavideCarvalho/nestjs-authz/commit/32e967ffbcd68a97e8effc77af9c16bbbafdc918) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Run on `@dudousxd/nestjs-authz` 0.9 and `@nestjs/authorization`: persisted roles and
|
|
8
|
+
permissions now guard routes through the official guard as the core's `RolePolicy` /
|
|
9
|
+
`PermissionPolicy` (`@Roles('editor')`, `@Permission('posts.publish')`), and the guard and the
|
|
10
|
+
handler's `Gate` calls share one permission and role fetch per request. The store API
|
|
11
|
+
(role sources, admin management, tenant-scoped roles where supported) and `AuthzRbacModule`
|
|
12
|
+
are unchanged. A persisted permission named like a policy ability no longer bypasses that
|
|
13
|
+
policy (see the core changeset). Requires NestJS 12, `@nestjs/authorization` ^0.1.3 and Node 22+.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#67](https://github.com/DavideCarvalho/nestjs-authz/pull/67) [`32e967f`](https://github.com/DavideCarvalho/nestjs-authz/commit/32e967ffbcd68a97e8effc77af9c16bbbafdc918) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Fix packages that could be published without files their `exports` point to. `tsc` builds no longer use a `.tsbuildinfo` that can outlive `dist/` and skip emitting files. A new `check:exports` step (also `prepack`) fails the release if any `exports`/`main`/`types` path is missing.
|
|
18
|
+
|
|
19
|
+
## 0.5.1
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- [#66](https://github.com/DavideCarvalho/nestjs-authz/pull/66) [`d5fdd23`](https://github.com/DavideCarvalho/nestjs-authz/commit/d5fdd23a2b72ae61fae0f913f11164bc4d2df77b) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Authorization checks within one request no longer hit the database per check. The Gate memoizes `resolveUser`, the permission set and the provider roles on the request context (keyed by the row a user names, its class or `type` plus `id`, so ORMs without an identity map share entries; a plain object without `type` is keyed by identity, so two users that only share an `id` never share an entry), and compiles the granted set once so a check is a hash lookup plus a scan of the wildcard grants. Providers can set the optional `exhaustivePermissions` flag to say `getPermissions` lists everything `hasPermission` grants; the ORM adapters do, and the MikroORM and Prisma providers now expose `getPermissions` (so persisted wildcard grants such as `posts.*` match there too). Grants changed mid-request apply from the next request.
|
|
24
|
+
|
|
3
25
|
## 0.5.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @dudousxd/nestjs-authz-prisma
|
|
2
2
|
|
|
3
3
|
Prisma RBAC persistence for [`@dudousxd/nestjs-authz`](https://github.com/DavideCarvalho/nestjs-authz) —
|
|
4
|
-
roles
|
|
4
|
+
roles and permissions for the official `@nestjs/authorization` policies, with **zero connection ownership** (your app owns the
|
|
5
5
|
`PrismaClient`; this package never opens a connection and never imports `@prisma/client`).
|
|
6
6
|
|
|
7
7
|
This is the Prisma sibling of `@dudousxd/nestjs-authz-typeorm`: identical store surface and
|
|
@@ -10,7 +10,7 @@ This is the Prisma sibling of `@dudousxd/nestjs-authz-typeorm`: identical store
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
pnpm add @dudousxd/nestjs-authz-prisma @dudousxd/nestjs-authz
|
|
13
|
+
pnpm add @dudousxd/nestjs-authz-prisma @dudousxd/nestjs-authz @nestjs/authorization
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
No `@prisma/client` is required by this package — it depends only on the structural
|
|
@@ -92,16 +92,30 @@ AuthzRbacModule.forRootAsync({
|
|
|
92
92
|
});
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
Once wired,
|
|
95
|
+
Once wired, persisted roles and permissions guard routes through the official
|
|
96
|
+
`@nestjs/authorization` guard, as the core's `RolePolicy` / `PermissionPolicy`:
|
|
96
97
|
|
|
97
98
|
```ts
|
|
98
|
-
await store.givePermissionToRole('editor', 'posts
|
|
99
|
+
await store.givePermissionToRole('editor', 'posts.*');
|
|
99
100
|
await store.assignRole({ type: 'user', id: 7 }, 'editor');
|
|
100
101
|
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
@Permission('posts.publish') // posts.* grants it
|
|
103
|
+
@Can(PermissionPolicy, 'has', permission('posts.publish')) // the same, spelled out
|
|
104
|
+
@Roles('editor') // @Can(RolePolicy, 'has', roles('editor'))
|
|
103
105
|
```
|
|
104
106
|
|
|
107
|
+
and in services, through the `Gate`:
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
gate.forUser(user).allows('posts.publish'); // true (PERMISSION_PROVIDER seam)
|
|
111
|
+
gate.forUser(user).allows(PermissionPolicy, 'has', 'posts.publish');
|
|
112
|
+
gate.forUser(user).hasRole('editor'); // true (ROLE_PROVIDER seam)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The user is the one the official guard reads (`AuthorizationModule.forRoot({ getUser })`,
|
|
116
|
+
default `request.user`), mapped to a store ref with `userRefFrom` (default `{ type, id }` or
|
|
117
|
+
`{ id }`).
|
|
118
|
+
|
|
105
119
|
## Role sources (manual vs SSO/SCIM)
|
|
106
120
|
|
|
107
121
|
Every role assignment records a `source`. It defaults to `'manual'`, so existing calls and existing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authz-rbac.module.d.ts","sourceRoot":"","sources":["../src/authz-rbac.module.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EACL,KAAK,aAAa,EAQnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAiB,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE/E,oFAAoF;AACpF,eAAO,MAAM,gBAAgB,eAAoD,CAAC;AAClF,2EAA2E;AAC3E,eAAO,MAAM,kBAAkB,eAAsD,CAAC;AAEtF;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,GAAG,SAAS,CAAC;AAEnE,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,oFAAoF;IACpF,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;IACnB,UAAU,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,sBAAsB,CAAC,GAAG,sBAAsB,CAAC;CAC9F;AAED,qFAAqF;AACrF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAOvE;
|
|
1
|
+
{"version":3,"file":"authz-rbac.module.d.ts","sourceRoot":"","sources":["../src/authz-rbac.module.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EA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/B"}
|
|
@@ -46,6 +46,8 @@ function resolveStore(options) {
|
|
|
46
46
|
*/
|
|
47
47
|
let RbacPermissionProvider = class RbacPermissionProvider {
|
|
48
48
|
options;
|
|
49
|
+
// `getPermissions` lists every grant `hasPermission` can find, for any resource.
|
|
50
|
+
exhaustivePermissions = true;
|
|
49
51
|
store;
|
|
50
52
|
constructor(options) {
|
|
51
53
|
this.options = options;
|
|
@@ -62,6 +64,16 @@ let RbacPermissionProvider = class RbacPermissionProvider {
|
|
|
62
64
|
return undefined;
|
|
63
65
|
return this.store.userHasPermission(ref, permission);
|
|
64
66
|
}
|
|
67
|
+
// Expose the user's full granted permission set so the core can apply
|
|
68
|
+
// Laravel/spatie-style wildcard matching (a granted `posts.*` satisfies a check
|
|
69
|
+
// for `posts.update`, `*` satisfies anything) and fetch it once per request.
|
|
70
|
+
async getPermissions(user) {
|
|
71
|
+
const map = this.options.userRefFrom ?? defaultUserRefMapper;
|
|
72
|
+
const ref = map(user);
|
|
73
|
+
if (ref === undefined)
|
|
74
|
+
return undefined;
|
|
75
|
+
return this.store.getPermissionsForUser(ref);
|
|
76
|
+
}
|
|
65
77
|
};
|
|
66
78
|
RbacPermissionProvider = __decorate([
|
|
67
79
|
Injectable(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authz-rbac.module.js","sourceRoot":"","sources":["../src/authz-rbac.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EACL,mBAAmB,EAEnB,aAAa,GAEd,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAEL,MAAM,EACN,UAAU,EACV,MAAM,EAEN,QAAQ,GAGT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,oFAAoF;AACpF,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;AAClF,2EAA2E;AAC3E,MAAM,CAAC,MAAM,k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
"version": "0.6.0",
|
|
4
4
|
"description": "Prisma RBAC persistence for @dudousxd/nestjs-authz — roles, permissions, and a Gate seam (zero connection ownership, structural client).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,30 +38,32 @@
|
|
|
38
38
|
"CHANGELOG.md"
|
|
39
39
|
],
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@dudousxd/nestjs-authz": ">=0.
|
|
42
|
-
"@nestjs/
|
|
43
|
-
"@nestjs/
|
|
41
|
+
"@dudousxd/nestjs-authz": ">=0.9.0 <0.10.0",
|
|
42
|
+
"@nestjs/authorization": "^0.1.3",
|
|
43
|
+
"@nestjs/common": "^12.0.0",
|
|
44
|
+
"@nestjs/core": "^12.0.0",
|
|
44
45
|
"reflect-metadata": ">=0.1.13"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
48
|
+
"@nestjs/authorization": "0.1.3",
|
|
47
49
|
"@nestjs/common": "12.0.1",
|
|
48
50
|
"@nestjs/core": "12.0.1",
|
|
49
51
|
"@nestjs/testing": "12.0.1",
|
|
50
52
|
"@testcontainers/postgresql": "12.1.0",
|
|
51
|
-
"@types/node": "20.
|
|
53
|
+
"@types/node": "22.20.5",
|
|
52
54
|
"@types/pg": "8.23.1",
|
|
53
55
|
"pg": "8.23.0",
|
|
54
56
|
"reflect-metadata": "0.2.2",
|
|
55
57
|
"rxjs": "7.8.2",
|
|
56
58
|
"typescript": "5.9.3",
|
|
57
59
|
"vitest": "3.2.7",
|
|
58
|
-
"@dudousxd/nestjs-authz": "^0.
|
|
60
|
+
"@dudousxd/nestjs-authz": "^0.9.0"
|
|
59
61
|
},
|
|
60
62
|
"engines": {
|
|
61
|
-
"node": ">=
|
|
63
|
+
"node": ">=22"
|
|
62
64
|
},
|
|
63
65
|
"scripts": {
|
|
64
|
-
"build": "tsc -p tsconfig.json",
|
|
66
|
+
"build": "tsc -p tsconfig.json --incremental false",
|
|
65
67
|
"test": "vitest run --passWithNoTests",
|
|
66
68
|
"test:db:pg": "AUTHZ_TEST_DIALECT=postgres vitest run --config vitest.db.config.ts",
|
|
67
69
|
"test:watch": "vitest",
|