@pristine-ts/security 2.0.5 → 2.0.7
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/lib/cjs/managers/authentication.manager.js +34 -4
- package/dist/lib/cjs/managers/authentication.manager.js.map +1 -1
- package/dist/lib/cjs/managers/authorizer.manager.js +24 -7
- package/dist/lib/cjs/managers/authorizer.manager.js.map +1 -1
- package/dist/lib/cjs/managers/permission.manager.js +31 -9
- package/dist/lib/cjs/managers/permission.manager.js.map +1 -1
- package/dist/lib/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/lib/esm/managers/authentication.manager.js +34 -4
- package/dist/lib/esm/managers/authentication.manager.js.map +1 -1
- package/dist/lib/esm/managers/authorizer.manager.js +24 -7
- package/dist/lib/esm/managers/authorizer.manager.js.map +1 -1
- package/dist/lib/esm/managers/permission.manager.js +32 -10
- package/dist/lib/esm/managers/permission.manager.js.map +1 -1
- package/dist/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/types/managers/authentication.manager.d.ts +7 -2
- package/dist/types/managers/authorizer.manager.d.ts +7 -3
- package/dist/types/managers/permission.manager.d.ts +8 -3
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VoterInterface } from "../interfaces/voter.interface";
|
|
2
2
|
import { VotingStrategyEnum } from "../enums/voting-strategy.enum";
|
|
3
|
-
import { IdentityInterface } from "@pristine-ts/common";
|
|
3
|
+
import { IdentityInterface, TracingManagerInterface } from "@pristine-ts/common";
|
|
4
4
|
import { LogHandlerInterface } from "@pristine-ts/logging";
|
|
5
5
|
/**
|
|
6
6
|
* The permission manager verifies if the correct permission are there to access and take an action on a resource.
|
|
@@ -8,15 +8,20 @@ import { LogHandlerInterface } from "@pristine-ts/logging";
|
|
|
8
8
|
export declare class PermissionManager {
|
|
9
9
|
private readonly voters;
|
|
10
10
|
private readonly logHandler;
|
|
11
|
+
private readonly tracingManager;
|
|
11
12
|
/**
|
|
12
13
|
* The permission manager verifies if the correct permission are there to access and take an action on a resource.
|
|
13
14
|
* @param voters The voters that determine if access is granted.
|
|
14
15
|
* All services with the tag ServiceDefinitionTagEnum.Voter will be injected here
|
|
15
16
|
* @param logHandler The log handler to output logs.
|
|
17
|
+
* @param tracingManager The tracing manager used to attach markers for the voting decisions.
|
|
16
18
|
*/
|
|
17
|
-
constructor(voters: VoterInterface[], logHandler: LogHandlerInterface);
|
|
19
|
+
constructor(voters: VoterInterface[], logHandler: LogHandlerInterface, tracingManager: TracingManagerInterface);
|
|
18
20
|
/**
|
|
19
|
-
* Returns whether or not the permission manager grants access to the resource.
|
|
21
|
+
* Returns whether or not the permission manager grants access to the resource. Drops one
|
|
22
|
+
* marker per voter (`permission.voter-vote` with `{voter, vote}`) so the trace shows which
|
|
23
|
+
* voter swung the decision. `@traced()` puts the whole call in its own span so the
|
|
24
|
+
* voting work is visible in the trace tree alongside auth/authz.
|
|
20
25
|
* @param identity The identity trying to have access to a resource.
|
|
21
26
|
* @param action The action trying to be executed on the resource.
|
|
22
27
|
* @param resource The resource being accessed.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pristine-ts/security",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"module": "dist/lib/esm/security.module.js",
|
|
6
6
|
"main": "dist/lib/cjs/security.module.js",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@pristine-ts/common": "^2.0.
|
|
24
|
-
"@pristine-ts/logging": "^2.0.
|
|
23
|
+
"@pristine-ts/common": "^2.0.7",
|
|
24
|
+
"@pristine-ts/logging": "^2.0.7"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/jsonwebtoken": "^8.5.1"
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"src/*.{js,ts}"
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "8788c711f72b7ebdcec76bc8f6a56d51af143087",
|
|
64
64
|
"repository": {
|
|
65
65
|
"type": "git",
|
|
66
66
|
"url": "https://github.com/magieno/pristine-ts.git",
|