@dudousxd/nestjs-authz 0.6.2 → 0.6.3
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 +6 -0
- package/dist/tokens.d.ts +5 -5
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +5 -5
- package/dist/tokens.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @dudousxd/nestjs-authz
|
|
2
2
|
|
|
3
|
+
## 0.6.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c4a1fe8`](https://github.com/DavideCarvalho/nestjs-authz/commit/c4a1fe876f6539446a1dec3bc241164058045bcb) - Derive authz's own DI tokens (`AUTHZ_MODULE_OPTIONS`, `RESOURCE_RESOLVER`, `RESOURCE_HYDRATOR`, `PERMISSION_PROVIDER`, `ROLE_PROVIDER`) from the `capability()` factory instead of hand-rolled `Symbol.for` strings, and add a conformance test (`assertCapabilityNaming`) that locks their canonical naming. Resolves to byte-identical symbols — fully non-breaking.
|
|
8
|
+
|
|
3
9
|
## 0.6.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/tokens.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Injection token holding the resolved {@link AuthzModuleOptions}. */
|
|
2
|
-
export declare const AUTHZ_MODULE_OPTIONS:
|
|
2
|
+
export declare const AUTHZ_MODULE_OPTIONS: symbol;
|
|
3
3
|
/** Injection token for the optional {@link ResourceResolver} registered by the app. */
|
|
4
|
-
export declare const RESOURCE_RESOLVER:
|
|
4
|
+
export declare const RESOURCE_RESOLVER: symbol;
|
|
5
5
|
/**
|
|
6
6
|
* Injection token holding the optional resource-loader map consulted by the opt-in
|
|
7
7
|
* `POST /authz/can` endpoint to rehydrate a `{ type, id }` shim into the REAL entity
|
|
@@ -16,7 +16,7 @@ export declare const RESOURCE_RESOLVER: unique symbol;
|
|
|
16
16
|
* same key resolves to the SAME symbol instance. Consulted with `@Optional()` — absent
|
|
17
17
|
* or empty, the endpoint behaves exactly as before (class-level / ad-hoc only).
|
|
18
18
|
*/
|
|
19
|
-
export declare const RESOURCE_HYDRATOR:
|
|
19
|
+
export declare const RESOURCE_HYDRATOR: symbol;
|
|
20
20
|
/** Metadata key for `@Policy(Resource)` — stores the resource class on the policy. */
|
|
21
21
|
export declare const POLICY_RESOURCE_METADATA = "nestjs-authz:policy-resource";
|
|
22
22
|
/** Metadata key for `@Can(ability, Resource?)` — stores the ability descriptor on a route. */
|
|
@@ -34,7 +34,7 @@ export declare const ROLES_METADATA = "nestjs-authz:roles";
|
|
|
34
34
|
* The token is consulted with `@Optional()` — when absent, the Gate behaves exactly
|
|
35
35
|
* as before (backward-compatible: unknown abilities still throw).
|
|
36
36
|
*/
|
|
37
|
-
export declare const PERMISSION_PROVIDER:
|
|
37
|
+
export declare const PERMISSION_PROVIDER: symbol;
|
|
38
38
|
/**
|
|
39
39
|
* Cross-lib injection token for an optional {@link RoleProvider} — the seam an RBAC
|
|
40
40
|
* adapter (`@dudousxd/nestjs-authz-typeorm`) registers so coarse role-checks
|
|
@@ -46,7 +46,7 @@ export declare const PERMISSION_PROVIDER: unique symbol;
|
|
|
46
46
|
* `@Optional()`: when absent, only the default {@link RoleResolver} (roles read off
|
|
47
47
|
* the user object) supplies roles. When BOTH yield roles, the Gate unions them.
|
|
48
48
|
*/
|
|
49
|
-
export declare const ROLE_PROVIDER:
|
|
49
|
+
export declare const ROLE_PROVIDER: symbol;
|
|
50
50
|
/**
|
|
51
51
|
* Cross-lib injection token for the current-request context accessor, owned by
|
|
52
52
|
* `@dudousxd/nestjs-context`. Resolved via the ecosystem protocol's typed
|
package/dist/tokens.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAEA,uEAAuE;AACvE,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAEA,uEAAuE;AACvE,eAAO,MAAM,oBAAoB,QAAiC,CAAC;AAEnE,uFAAuF;AACvF,eAAO,MAAM,iBAAiB,QAA2C,CAAC;AAE1E;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,QAA2C,CAAC;AAE1E,sFAAsF;AACtF,eAAO,MAAM,wBAAwB,iCAAiC,CAAC;AAEvE,8FAA8F;AAC9F,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAE/C,sFAAsF;AACtF,eAAO,MAAM,cAAc,uBAAuB,CAAC;AAEnD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,QAA6C,CAAC;AAE9E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,QAAuC,CAAC;AAElE;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,QAAoC,CAAC"}
|
package/dist/tokens.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { capability } from '@dudousxd/nestjs-diagnostics';
|
|
2
2
|
/** Injection token holding the resolved {@link AuthzModuleOptions}. */
|
|
3
|
-
export const AUTHZ_MODULE_OPTIONS =
|
|
3
|
+
export const AUTHZ_MODULE_OPTIONS = capability('authz', 'options');
|
|
4
4
|
/** Injection token for the optional {@link ResourceResolver} registered by the app. */
|
|
5
|
-
export const RESOURCE_RESOLVER =
|
|
5
|
+
export const RESOURCE_RESOLVER = capability('authz', 'resource-resolver');
|
|
6
6
|
/**
|
|
7
7
|
* Injection token holding the optional resource-loader map consulted by the opt-in
|
|
8
8
|
* `POST /authz/can` endpoint to rehydrate a `{ type, id }` shim into the REAL entity
|
|
@@ -17,7 +17,7 @@ export const RESOURCE_RESOLVER = Symbol.for('@dudousxd/nestjs-authz:resource-res
|
|
|
17
17
|
* same key resolves to the SAME symbol instance. Consulted with `@Optional()` — absent
|
|
18
18
|
* or empty, the endpoint behaves exactly as before (class-level / ad-hoc only).
|
|
19
19
|
*/
|
|
20
|
-
export const RESOURCE_HYDRATOR =
|
|
20
|
+
export const RESOURCE_HYDRATOR = capability('authz', 'resource-hydrator');
|
|
21
21
|
/** Metadata key for `@Policy(Resource)` — stores the resource class on the policy. */
|
|
22
22
|
export const POLICY_RESOURCE_METADATA = 'nestjs-authz:policy-resource';
|
|
23
23
|
/** Metadata key for `@Can(ability, Resource?)` — stores the ability descriptor on a route. */
|
|
@@ -35,7 +35,7 @@ export const ROLES_METADATA = 'nestjs-authz:roles';
|
|
|
35
35
|
* The token is consulted with `@Optional()` — when absent, the Gate behaves exactly
|
|
36
36
|
* as before (backward-compatible: unknown abilities still throw).
|
|
37
37
|
*/
|
|
38
|
-
export const PERMISSION_PROVIDER =
|
|
38
|
+
export const PERMISSION_PROVIDER = capability('authz', 'permission-provider');
|
|
39
39
|
/**
|
|
40
40
|
* Cross-lib injection token for an optional {@link RoleProvider} — the seam an RBAC
|
|
41
41
|
* adapter (`@dudousxd/nestjs-authz-typeorm`) registers so coarse role-checks
|
|
@@ -47,7 +47,7 @@ export const PERMISSION_PROVIDER = Symbol.for('@dudousxd/nestjs-authz:permission
|
|
|
47
47
|
* `@Optional()`: when absent, only the default {@link RoleResolver} (roles read off
|
|
48
48
|
* the user object) supplies roles. When BOTH yield roles, the Gate unions them.
|
|
49
49
|
*/
|
|
50
|
-
export const ROLE_PROVIDER =
|
|
50
|
+
export const ROLE_PROVIDER = capability('authz', 'role-provider');
|
|
51
51
|
/**
|
|
52
52
|
* Cross-lib injection token for the current-request context accessor, owned by
|
|
53
53
|
* `@dudousxd/nestjs-context`. Resolved via the ecosystem protocol's typed
|
package/dist/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,uEAAuE;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,uEAAuE;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAEnE,uFAAuF;AACvF,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;AAE1E;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;AAE1E,sFAAsF;AACtF,MAAM,CAAC,MAAM,wBAAwB,GAAG,8BAA8B,CAAC;AAEvE,8FAA8F;AAC9F,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAE/C,sFAAsF;AACtF,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAEnD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC;AAE9E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;AAElE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC"}
|