@mahmoud-auth/auth 0.1.1-beta.0 → 0.1.1-beta.2
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/{policy → auth/policy}/registry.d.ts +1 -1
- package/dist/{policy → auth/policy}/registry.js +1 -1
- package/dist/base-registry/index.d.ts +7 -0
- package/dist/base-registry/index.js +22 -0
- package/package.json +7 -12
- /package/dist/{auth-guard → auth/auth-guard}/authorization-context.class.d.ts +0 -0
- /package/dist/{auth-guard → auth/auth-guard}/authorization-context.class.js +0 -0
- /package/dist/{auth-guard → auth/auth-guard}/index.d.ts +0 -0
- /package/dist/{auth-guard → auth/auth-guard}/index.js +0 -0
- /package/dist/{core → auth/core}/index.d.ts +0 -0
- /package/dist/{core → auth/core}/index.js +0 -0
- /package/dist/{core → auth/core}/resource.d.ts +0 -0
- /package/dist/{core → auth/core}/resource.js +0 -0
- /package/dist/{decorators → auth/decorators}/authorize.decorator.d.ts +0 -0
- /package/dist/{decorators → auth/decorators}/authorize.decorator.js +0 -0
- /package/dist/{decorators → auth/decorators}/index.d.ts +0 -0
- /package/dist/{decorators → auth/decorators}/index.js +0 -0
- /package/dist/{decorators → auth/decorators}/permission.decorator.d.ts +0 -0
- /package/dist/{decorators → auth/decorators}/permission.decorator.js +0 -0
- /package/dist/{decorators → auth/decorators}/policy.decorator.d.ts +0 -0
- /package/dist/{decorators → auth/decorators}/policy.decorator.js +0 -0
- /package/dist/{dsl → auth/dsl}/can.d.ts +0 -0
- /package/dist/{dsl → auth/dsl}/can.js +0 -0
- /package/dist/{dsl → auth/dsl}/condition.d.ts +0 -0
- /package/dist/{dsl → auth/dsl}/condition.js +0 -0
- /package/dist/{dsl → auth/dsl}/index.d.ts +0 -0
- /package/dist/{dsl → auth/dsl}/index.js +0 -0
- /package/dist/{dsl → auth/dsl}/trinary/and.d.ts +0 -0
- /package/dist/{dsl → auth/dsl}/trinary/and.js +0 -0
- /package/dist/{dsl → auth/dsl}/trinary/index.d.ts +0 -0
- /package/dist/{dsl → auth/dsl}/trinary/index.js +0 -0
- /package/dist/{dsl → auth/dsl}/trinary/not.d.ts +0 -0
- /package/dist/{dsl → auth/dsl}/trinary/not.js +0 -0
- /package/dist/{dsl → auth/dsl}/trinary/or.d.ts +0 -0
- /package/dist/{dsl → auth/dsl}/trinary/or.js +0 -0
- /package/dist/{errors → auth/errors}/circular-policy.exception.d.ts +0 -0
- /package/dist/{errors → auth/errors}/circular-policy.exception.js +0 -0
- /package/dist/{errors → auth/errors}/duplicate-policy.exception.d.ts +0 -0
- /package/dist/{errors → auth/errors}/duplicate-policy.exception.js +0 -0
- /package/dist/{errors → auth/errors}/index.d.ts +0 -0
- /package/dist/{errors → auth/errors}/index.js +0 -0
- /package/dist/{errors → auth/errors}/missing-policy.exception.d.ts +0 -0
- /package/dist/{errors → auth/errors}/missing-policy.exception.js +0 -0
- /package/dist/{errors → auth/errors}/out-of-bounds-action.exception.d.ts +0 -0
- /package/dist/{errors → auth/errors}/out-of-bounds-action.exception.js +0 -0
- /package/dist/{evaluation → auth/evaluation}/index.d.ts +0 -0
- /package/dist/{evaluation → auth/evaluation}/index.js +0 -0
- /package/dist/{evaluation → auth/evaluation}/service.d.ts +0 -0
- /package/dist/{evaluation → auth/evaluation}/service.js +0 -0
- /package/dist/{extensions → auth/extensions}/index.d.ts +0 -0
- /package/dist/{extensions → auth/extensions}/index.js +0 -0
- /package/dist/{extensions → auth/extensions}/token/index.d.ts +0 -0
- /package/dist/{extensions → auth/extensions}/token/index.js +0 -0
- /package/dist/{feature-shortcuts → auth/feature-shortcuts}/index.d.ts +0 -0
- /package/dist/{feature-shortcuts → auth/feature-shortcuts}/index.js +0 -0
- /package/dist/{index.d.ts → auth/index.d.ts} +0 -0
- /package/dist/{index.js → auth/index.js} +0 -0
- /package/dist/{mahmoud.module.d.ts → auth/mahmoud.module.d.ts} +0 -0
- /package/dist/{mahmoud.module.js → auth/mahmoud.module.js} +0 -0
- /package/dist/{policy → auth/policy}/compiler.d.ts +0 -0
- /package/dist/{policy → auth/policy}/compiler.js +0 -0
- /package/dist/{policy → auth/policy}/index.d.ts +0 -0
- /package/dist/{policy → auth/policy}/index.js +0 -0
- /package/dist/{policy → auth/policy}/module.d.ts +0 -0
- /package/dist/{policy → auth/policy}/module.js +0 -0
- /package/dist/{policy → auth/policy}/permission-node.type.d.ts +0 -0
- /package/dist/{policy → auth/policy}/permission-node.type.js +0 -0
- /package/dist/{policy → auth/policy}/scanner.d.ts +0 -0
- /package/dist/{policy → auth/policy}/scanner.js +0 -0
- /package/dist/{policy → auth/policy}/validator.d.ts +0 -0
- /package/dist/{policy → auth/policy}/validator.js +0 -0
- /package/dist/{policy → auth/policy}/visualizer/controller.d.ts +0 -0
- /package/dist/{policy → auth/policy}/visualizer/controller.js +0 -0
- /package/dist/{policy → auth/policy}/visualizer/index.d.ts +0 -0
- /package/dist/{policy → auth/policy}/visualizer/index.js +0 -0
- /package/dist/{tracing → auth/tracing}/index.d.ts +0 -0
- /package/dist/{tracing → auth/tracing}/index.js +0 -0
- /package/dist/{tracing → auth/tracing}/module.d.ts +0 -0
- /package/dist/{tracing → auth/tracing}/module.js +0 -0
- /package/dist/{tracing → auth/tracing}/service.d.ts +0 -0
- /package/dist/{tracing → auth/tracing}/service.js +0 -0
- /package/dist/{tracing → auth/tracing}/tokens/activate-trace.token.d.ts +0 -0
- /package/dist/{tracing → auth/tracing}/tokens/activate-trace.token.js +0 -0
- /package/dist/{tracing → auth/tracing}/tokens/evaluation-id.token.d.ts +0 -0
- /package/dist/{tracing → auth/tracing}/tokens/evaluation-id.token.js +0 -0
- /package/dist/{tracing → auth/tracing}/tokens/index.d.ts +0 -0
- /package/dist/{tracing → auth/tracing}/tokens/index.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IAuthorizationGraphDto, IResourceToken, RuleNode } from '@mahmoud-auth/common';
|
|
2
2
|
import { IPermissionNode } from './permission-node.type';
|
|
3
|
-
import { BaseMahmoudRegistry } from '
|
|
3
|
+
import { BaseMahmoudRegistry } from '../../base-registry';
|
|
4
4
|
export interface GraphEntry<T = unknown> extends IPermissionNode<T> {
|
|
5
5
|
rule: RuleNode;
|
|
6
6
|
}
|
|
@@ -14,7 +14,7 @@ const common_1 = require("@nestjs/common");
|
|
|
14
14
|
const common_2 = require("@mahmoud-auth/common");
|
|
15
15
|
const core_1 = require("../core");
|
|
16
16
|
const errors_1 = require("../errors");
|
|
17
|
-
const base_registry_1 = require("
|
|
17
|
+
const base_registry_1 = require("../../base-registry");
|
|
18
18
|
let PolicyRegistry = class PolicyRegistry extends base_registry_1.BaseMahmoudRegistry {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(new Map());
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseMahmoudRegistry = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
class BaseMahmoudRegistry {
|
|
6
|
+
entries;
|
|
7
|
+
isFrozen = false;
|
|
8
|
+
constructor(entries) {
|
|
9
|
+
this.entries = entries;
|
|
10
|
+
}
|
|
11
|
+
checkIsFrozen(registryName) {
|
|
12
|
+
if (this.isFrozen) {
|
|
13
|
+
throw new common_1.InternalServerErrorException(`${registryName} is frozen, and cannot be updated`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
freeze() {
|
|
17
|
+
this.isFrozen = true;
|
|
18
|
+
this.entries.forEach((entry) => Object.freeze(entry));
|
|
19
|
+
Object.freeze(this.entries);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.BaseMahmoudRegistry = BaseMahmoudRegistry;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mahmoud-auth/auth",
|
|
3
|
-
"version": "0.1.1-beta.
|
|
3
|
+
"version": "0.1.1-beta.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Policy-based authorization for NestJS applications.",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
6
|
+
"main": "./dist/auth/index.js",
|
|
7
|
+
"types": "./dist/auth/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"default": "./dist/index.js"
|
|
10
|
+
"types": "./dist/auth/index.d.ts",
|
|
11
|
+
"default": "./dist/auth/index.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@mahmoud-auth/common": "*",
|
|
27
|
-
"@mahmoud-auth/model-climbers": "
|
|
27
|
+
"@mahmoud-auth/model-climbers": "0.1.1-beta.2",
|
|
28
28
|
"@mahmoud-auth/utils": "*"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
@@ -37,10 +37,5 @@
|
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
|
-
}
|
|
41
|
-
"repository": {
|
|
42
|
-
"type": "git",
|
|
43
|
-
"url": "git+https://github.com/shahariko-lab/nestjs-rebac.git",
|
|
44
|
-
"directory": "packages/mahmoud/auth"
|
|
45
|
-
}
|
|
40
|
+
}
|
|
46
41
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|