@authup/access 1.0.0-beta.28 → 1.0.0-beta.30
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/index.mjs +693 -499
- package/dist/index.mjs.map +1 -1
- package/dist/permission/checker/index.d.ts +3 -0
- package/dist/permission/checker/index.d.ts.map +1 -0
- package/dist/permission/{module.d.ts → checker/module.d.ts} +8 -7
- package/dist/permission/checker/module.d.ts.map +1 -0
- package/dist/permission/checker/types.d.ts +26 -0
- package/dist/permission/checker/types.d.ts.map +1 -0
- package/dist/permission/error/index.d.ts +0 -1
- package/dist/permission/error/index.d.ts.map +1 -1
- package/dist/permission/error/module.d.ts +4 -5
- package/dist/permission/error/module.d.ts.map +1 -1
- package/dist/permission/index.d.ts +2 -2
- package/dist/permission/index.d.ts.map +1 -1
- package/dist/permission/repository/index.d.ts.map +1 -0
- package/dist/permission/repository/memory.d.ts +9 -0
- package/dist/permission/repository/memory.d.ts.map +1 -0
- package/dist/permission/{provider → repository}/types.d.ts +2 -2
- package/dist/permission/repository/types.d.ts.map +1 -0
- package/dist/permission/types.d.ts +1 -19
- package/dist/permission/types.d.ts.map +1 -1
- package/dist/policy/built-in/attribute-names/evaluator.d.ts +5 -8
- package/dist/policy/built-in/attribute-names/evaluator.d.ts.map +1 -1
- package/dist/policy/built-in/attributes/evaluator.d.ts +4 -8
- package/dist/policy/built-in/attributes/evaluator.d.ts.map +1 -1
- package/dist/policy/built-in/attributes/validator.d.ts.map +1 -1
- package/dist/policy/built-in/composite/evaluator.d.ts +3 -8
- package/dist/policy/built-in/composite/evaluator.d.ts.map +1 -1
- package/dist/policy/built-in/composite/validator.d.ts.map +1 -1
- package/dist/policy/built-in/date/evaluator.d.ts +3 -8
- package/dist/policy/built-in/date/evaluator.d.ts.map +1 -1
- package/dist/policy/built-in/identity/data/index.d.ts +2 -0
- package/dist/policy/built-in/identity/data/index.d.ts.map +1 -0
- package/dist/policy/built-in/identity/data/validator.d.ts +6 -0
- package/dist/policy/built-in/identity/data/validator.d.ts.map +1 -0
- package/dist/policy/built-in/identity/evaluator.d.ts +7 -8
- package/dist/policy/built-in/identity/evaluator.d.ts.map +1 -1
- package/dist/policy/built-in/identity/types.d.ts +22 -0
- package/dist/policy/built-in/identity/types.d.ts.map +1 -1
- package/dist/policy/built-in/permission-binding/module.d.ts +3 -8
- package/dist/policy/built-in/permission-binding/module.d.ts.map +1 -1
- package/dist/policy/built-in/realm-match/evaluator.d.ts +7 -8
- package/dist/policy/built-in/realm-match/evaluator.d.ts.map +1 -1
- package/dist/policy/built-in/time/evaluator.d.ts +3 -8
- package/dist/policy/built-in/time/evaluator.d.ts.map +1 -1
- package/dist/policy/constants.d.ts +12 -0
- package/dist/policy/constants.d.ts.map +1 -0
- package/dist/policy/data.d.ts +20 -0
- package/dist/policy/data.d.ts.map +1 -0
- package/dist/policy/engine/module.d.ts +9 -9
- package/dist/policy/engine/module.d.ts.map +1 -1
- package/dist/policy/engine/types.d.ts +6 -3
- package/dist/policy/engine/types.d.ts.map +1 -1
- package/dist/policy/error/module.d.ts +3 -0
- package/dist/policy/error/module.d.ts.map +1 -1
- package/dist/policy/evaluation/context/define.d.ts +3 -0
- package/dist/policy/evaluation/context/define.d.ts.map +1 -0
- package/dist/policy/evaluation/context/index.d.ts +3 -0
- package/dist/policy/evaluation/context/index.d.ts.map +1 -0
- package/dist/policy/evaluation/context/types.d.ts +11 -0
- package/dist/policy/evaluation/context/types.d.ts.map +1 -0
- package/dist/policy/evaluation/index.d.ts +3 -0
- package/dist/policy/evaluation/index.d.ts.map +1 -0
- package/dist/policy/evaluation/types.d.ts +14 -0
- package/dist/policy/evaluation/types.d.ts.map +1 -0
- package/dist/policy/index.d.ts +4 -1
- package/dist/policy/index.d.ts.map +1 -1
- package/dist/policy/issue/constants.d.ts +21 -0
- package/dist/policy/issue/constants.d.ts.map +1 -0
- package/dist/policy/issue/define.d.ts +4 -0
- package/dist/policy/issue/define.d.ts.map +1 -0
- package/dist/policy/issue/index.d.ts +4 -0
- package/dist/policy/issue/index.d.ts.map +1 -0
- package/dist/policy/issue/types.d.ts +5 -0
- package/dist/policy/issue/types.d.ts.map +1 -0
- package/dist/policy/types.d.ts +3 -41
- package/dist/policy/types.d.ts.map +1 -1
- package/package.json +17 -13
- package/dist/permission/error/types.d.ts +0 -11
- package/dist/permission/error/types.d.ts.map +0 -1
- package/dist/permission/module.d.ts.map +0 -1
- package/dist/permission/provider/index.d.ts.map +0 -1
- package/dist/permission/provider/memory.d.ts +0 -9
- package/dist/permission/provider/memory.d.ts.map +0 -1
- package/dist/permission/provider/types.d.ts.map +0 -1
- package/dist/policy/evaluator/data/identity/index.d.ts +0 -2
- package/dist/policy/evaluator/data/identity/index.d.ts.map +0 -1
- package/dist/policy/evaluator/data/identity/validator.d.ts +0 -6
- package/dist/policy/evaluator/data/identity/validator.d.ts.map +0 -1
- package/dist/policy/evaluator/data/index.d.ts +0 -4
- package/dist/policy/evaluator/data/index.d.ts.map +0 -1
- package/dist/policy/evaluator/data/permission/index.d.ts +0 -2
- package/dist/policy/evaluator/data/permission/index.d.ts.map +0 -1
- package/dist/policy/evaluator/data/permission/validator.d.ts +0 -6
- package/dist/policy/evaluator/data/permission/validator.d.ts.map +0 -1
- package/dist/policy/evaluator/data/validator.d.ts +0 -6
- package/dist/policy/evaluator/data/validator.d.ts.map +0 -1
- package/dist/policy/evaluator/evaluate.d.ts +0 -4
- package/dist/policy/evaluator/evaluate.d.ts.map +0 -1
- package/dist/policy/evaluator/index.d.ts +0 -4
- package/dist/policy/evaluator/index.d.ts.map +0 -1
- package/dist/policy/evaluator/types.d.ts +0 -44
- package/dist/policy/evaluator/types.d.ts.map +0 -1
- /package/dist/permission/{provider → repository}/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/permission/checker/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAE3D,MAAM,WAAW,kBAAkB;IAC/B,KAAK,CAAC,GAAG,EAAE,6BAA6B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD,UAAU,CAAC,GAAG,EAAE,6BAA6B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9D,QAAQ,CAAC,GAAG,EAAE,6BAA6B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5D,aAAa,CAAC,GAAG,EAAE,6BAA6B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACnE;AAED,MAAM,MAAM,wBAAwB,GAAG;IACnC,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IACxC,gBAAgB,CAAC,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACzC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IACxC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,EAAE,6BAA6B,CAAA;CAC1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/permission/error/index.ts"],"names":[],"mappings":"AAOA,cAAc,UAAU,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/permission/error/index.ts"],"names":[],"mappings":"AAOA,cAAc,UAAU,CAAC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { AuthupErrorOptions } from '@authup/errors';
|
|
2
2
|
import { AuthupError } from '@authup/errors';
|
|
3
|
-
import type {
|
|
4
|
-
import type { PermissionEvaluationErrorOptions } from './types';
|
|
3
|
+
import type { PolicyIssue } from '../../policy';
|
|
5
4
|
export declare class PermissionError extends AuthupError {
|
|
6
|
-
policy: PolicyWithType | undefined;
|
|
7
|
-
policyError: PolicyError | undefined;
|
|
8
5
|
constructor(options?: AuthupErrorOptions);
|
|
6
|
+
addIssue(data: PolicyIssue): void;
|
|
7
|
+
addIssues(data: PolicyIssue[]): void;
|
|
9
8
|
static notFound(name: string): PermissionError;
|
|
10
9
|
static denied(name: string): PermissionError;
|
|
11
10
|
static deniedAll(names: string[]): PermissionError;
|
|
12
|
-
static evaluationFailed(
|
|
11
|
+
static evaluationFailed(name: string | string[]): PermissionError;
|
|
13
12
|
}
|
|
14
13
|
//# sourceMappingURL=module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/permission/error/module.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAa,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/permission/error/module.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAa,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,qBAAa,eAAgB,SAAQ,WAAW;gBAChC,OAAO,GAAE,kBAAuB;IAQ5C,QAAQ,CAAC,IAAI,EAAE,WAAW;IAI1B,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE;IAI7B,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM;IAO5B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM;IAO1B,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE;IAOhC,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;CAalD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/permission/index.ts"],"names":[],"mappings":"AAOA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/permission/index.ts"],"names":[],"mappings":"AAOA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/permission/repository/index.ts"],"names":[],"mappings":"AAOA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PermissionItem } from '../types';
|
|
2
|
+
import type { IPermissionRepository, PermissionGetOptions } from './types';
|
|
3
|
+
export declare class PermissionMemoryRepository implements IPermissionRepository {
|
|
4
|
+
protected items: Record<string, PermissionItem>;
|
|
5
|
+
constructor(items?: PermissionItem[]);
|
|
6
|
+
findOne(options: PermissionGetOptions): Promise<PermissionItem | null>;
|
|
7
|
+
setMany(input: PermissionItem[]): void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../src/permission/repository/memory.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE3E,qBAAa,0BAA2B,YAAW,qBAAqB;IACpE,SAAS,CAAC,KAAK,EAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAM;gBAE1C,KAAK,GAAE,cAAc,EAAO;IAIlC,OAAO,CACT,OAAO,EAAE,oBAAoB,GAC9B,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IASjC,OAAO,CAAC,KAAK,EAAE,cAAc,EAAE;CAOlC"}
|
|
@@ -4,7 +4,7 @@ export type PermissionGetOptions = {
|
|
|
4
4
|
clientId?: string | null;
|
|
5
5
|
realmId?: string | null;
|
|
6
6
|
};
|
|
7
|
-
export interface
|
|
8
|
-
|
|
7
|
+
export interface IPermissionRepository {
|
|
8
|
+
findOne(criteria: PermissionGetOptions): Promise<PermissionItem | null>;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/permission/repository/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,MAAM,oBAAoB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B,CAAC;AAEF,MAAM,WAAW,qBAAqB;IAClC,OAAO,CAAC,QAAQ,EAAE,oBAAoB,GAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;CAC5E"}
|
|
@@ -1,26 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { PolicyEngine, PolicyInput, PolicyWithType } from '../policy';
|
|
3
|
-
import type { IPermissionProvider } from './provider';
|
|
1
|
+
import type { PolicyWithType } from '../policy';
|
|
4
2
|
export type PermissionItem = {
|
|
5
3
|
name: string;
|
|
6
4
|
clientId?: string | null;
|
|
7
5
|
realmId?: string | null;
|
|
8
6
|
policy?: PolicyWithType;
|
|
9
7
|
};
|
|
10
|
-
export type PermissionCheckerOptions = {
|
|
11
|
-
provider?: IPermissionProvider;
|
|
12
|
-
policyEngine?: PolicyEngine;
|
|
13
|
-
realmId?: string | null;
|
|
14
|
-
clientId?: string | null;
|
|
15
|
-
};
|
|
16
|
-
export type PermissionCheckerCheckOptions = {
|
|
17
|
-
decisionStrategy?: `${DecisionStrategy}`;
|
|
18
|
-
policiesIncluded?: string[];
|
|
19
|
-
policiesExcluded?: string[];
|
|
20
|
-
};
|
|
21
|
-
export type PermissionCheckerCheckContext = {
|
|
22
|
-
name: string | string[];
|
|
23
|
-
input?: PolicyInput;
|
|
24
|
-
options?: PermissionCheckerCheckOptions;
|
|
25
|
-
};
|
|
26
8
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/permission/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/permission/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,CAAC,EAAE,cAAc,CAAC;CAC3B,CAAC"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { PolicyInput, PolicyWithType } from '../../types';
|
|
3
|
-
import type { AttributeNamesPolicy } from './types';
|
|
1
|
+
import type { IPolicyEvaluator, PolicyEvaluationContext, PolicyEvaluationResult } from '../../evaluation';
|
|
4
2
|
import { AttributeNamesPolicyValidator } from './validator';
|
|
5
|
-
|
|
3
|
+
import { AttributesPolicyEvaluator } from '../attributes';
|
|
4
|
+
export declare class AttributeNamesPolicyEvaluator implements IPolicyEvaluator {
|
|
6
5
|
protected validator: AttributeNamesPolicyValidator;
|
|
6
|
+
protected attributesEvaluator: AttributesPolicyEvaluator;
|
|
7
7
|
constructor();
|
|
8
|
-
|
|
9
|
-
validateConfig(ctx: PolicyEvaluateContext<PolicyWithType>): Promise<AttributeNamesPolicy>;
|
|
10
|
-
validateInput(ctx: PolicyEvaluateContext<AttributeNamesPolicy>): Promise<PolicyInput>;
|
|
11
|
-
evaluate(ctx: PolicyEvaluateContext<AttributeNamesPolicy, PolicyInput>): Promise<boolean>;
|
|
8
|
+
evaluate(value: Record<string, any>, ctx: PolicyEvaluationContext): Promise<PolicyEvaluationResult>;
|
|
12
9
|
}
|
|
13
10
|
//# sourceMappingURL=evaluator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/attribute-names/evaluator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/attribute-names/evaluator.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAI1G,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAE1D,qBAAa,6BAA8B,YAAW,gBAAgB;IAClE,SAAS,CAAC,SAAS,EAAG,6BAA6B,CAAC;IAEpD,SAAS,CAAC,mBAAmB,EAAG,yBAAyB,CAAC;;IAOpD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAsC5G"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { PolicyInput, PolicyWithType } from '../../types';
|
|
3
|
-
import type { AttributesPolicy } from './types';
|
|
1
|
+
import type { IPolicyEvaluator, PolicyEvaluationContext, PolicyEvaluationResult } from '../../evaluation';
|
|
4
2
|
import { AttributesPolicyValidator } from './validator';
|
|
5
|
-
export declare class AttributesPolicyEvaluator<T extends Record<string, any> = Record<string, any>> implements
|
|
3
|
+
export declare class AttributesPolicyEvaluator<T extends Record<string, any> = Record<string, any>> implements IPolicyEvaluator {
|
|
6
4
|
protected validator: AttributesPolicyValidator<T>;
|
|
7
5
|
constructor();
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
validateInput(ctx: PolicyEvaluateContext<AttributesPolicy<T>>): Promise<PolicyInput>;
|
|
11
|
-
evaluate(ctx: PolicyEvaluateContext<AttributesPolicy<T>>): Promise<boolean>;
|
|
6
|
+
accessData(ctx: PolicyEvaluationContext): Promise<T | null>;
|
|
7
|
+
evaluate(value: Record<string, any>, ctx: PolicyEvaluationContext): Promise<PolicyEvaluationResult>;
|
|
12
8
|
protected fixQuery(query: unknown | unknown[]): void;
|
|
13
9
|
}
|
|
14
10
|
//# sourceMappingURL=evaluator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/attributes/evaluator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/attributes/evaluator.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAI1G,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAExD,qBAAa,yBAAyB,CAClC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CACrD,YAAW,gBAAgB;IACzB,SAAS,CAAC,SAAS,EAAG,yBAAyB,CAAC,CAAC,CAAC,CAAC;;IAM7C,UAAU,CAAC,GAAG,EAAE,uBAAuB,GAAI,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAkB5D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IA2BzG,SAAS,CAAC,QAAQ,CACd,KAAK,EAAE,OAAO,GAAG,OAAO,EAAE;CAiCjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/attributes/validator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,qBAAa,yBAAyB,CAClC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CACrD,SAAQ,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACpC,UAAU;
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/attributes/validator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,qBAAa,yBAAyB,CAClC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CACrD,SAAQ,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACpC,UAAU;CAoBb"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { PolicyInput, PolicyWithType } from '../../types';
|
|
3
|
-
import type { CompositePolicy } from './types';
|
|
1
|
+
import type { IPolicyEvaluator, PolicyEvaluationContext, PolicyEvaluationResult } from '../../evaluation';
|
|
4
2
|
import { CompositePolicyValidator } from './validator';
|
|
5
|
-
export declare class CompositePolicyEvaluator implements
|
|
3
|
+
export declare class CompositePolicyEvaluator implements IPolicyEvaluator {
|
|
6
4
|
protected validator: CompositePolicyValidator;
|
|
7
5
|
constructor();
|
|
8
|
-
|
|
9
|
-
validateConfig(ctx: PolicyEvaluateContext): Promise<CompositePolicy>;
|
|
10
|
-
validateInput(ctx: PolicyEvaluateContext<CompositePolicy>): Promise<PolicyInput>;
|
|
11
|
-
evaluate(ctx: PolicyEvaluateContext<CompositePolicy>): Promise<boolean>;
|
|
6
|
+
evaluate(value: Record<string, any>, ctx: PolicyEvaluationContext): Promise<PolicyEvaluationResult>;
|
|
12
7
|
}
|
|
13
8
|
//# sourceMappingURL=evaluator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/composite/evaluator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/composite/evaluator.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACR,gBAAgB,EAAE,uBAAuB,EAAE,sBAAsB,EACpE,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,qBAAa,wBAAyB,YAAW,gBAAgB;IAC7D,SAAS,CAAC,SAAS,EAAG,wBAAwB,CAAC;;IAMzC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAyE5G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/composite/validator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,qBAAa,wBAAyB,SAAQ,SAAS,CAAC,eAAe,CAAC;IACpE,UAAU;
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/composite/validator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,qBAAa,wBAAyB,SAAQ,SAAS,CAAC,eAAe,CAAC;IACpE,UAAU;CAgCb"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { PolicyInput, PolicyWithType } from '../../types';
|
|
3
|
-
import type { DatePolicy } from './types';
|
|
1
|
+
import type { IPolicyEvaluator, PolicyEvaluationContext, PolicyEvaluationResult } from '../../evaluation';
|
|
4
2
|
import { DatePolicyValidator } from './validator';
|
|
5
|
-
export declare class DatePolicyEvaluator implements
|
|
3
|
+
export declare class DatePolicyEvaluator implements IPolicyEvaluator {
|
|
6
4
|
protected validator: DatePolicyValidator;
|
|
7
5
|
constructor();
|
|
8
|
-
|
|
9
|
-
validateConfig(ctx: PolicyEvaluateContext): Promise<DatePolicy>;
|
|
10
|
-
validateInput(ctx: PolicyEvaluateContext<DatePolicy>): Promise<PolicyInput>;
|
|
11
|
-
evaluate(ctx: PolicyEvaluateContext<DatePolicy>): Promise<boolean>;
|
|
6
|
+
evaluate(value: Record<string, any>, ctx: PolicyEvaluationContext): Promise<PolicyEvaluationResult>;
|
|
12
7
|
}
|
|
13
8
|
//# sourceMappingURL=evaluator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/date/evaluator.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/date/evaluator.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAG1G,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAkBlD,qBAAa,mBAAoB,YAAW,gBAAgB;IACxD,SAAS,CAAC,SAAS,EAAG,mBAAmB,CAAC;;IAMpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CA0C5G"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/policy/built-in/identity/data/index.ts"],"names":[],"mappings":"AAOA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../../../../src/policy/built-in/identity/data/validator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,qBAAa,2BAA4B,SAAQ,SAAS,CAAC,kBAAkB,CAAC;IAC1E,UAAU;CA+Cb"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
1
|
+
import type { IPolicyEvaluator, PolicyEvaluationContext, PolicyEvaluationResult } from '../../evaluation';
|
|
2
|
+
import { PolicyIdentityDataValidator } from './data';
|
|
3
|
+
import type { IdentityPolicyData } from './types';
|
|
4
4
|
import { IdentityPolicyValidator } from './validator';
|
|
5
|
-
export declare class IdentityPolicyEvaluator implements
|
|
5
|
+
export declare class IdentityPolicyEvaluator implements IPolicyEvaluator {
|
|
6
6
|
protected validator: IdentityPolicyValidator;
|
|
7
|
+
protected dataValidator: PolicyIdentityDataValidator;
|
|
7
8
|
constructor();
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
validateInput(ctx: PolicyEvaluateContext<IdentityPolicy>): Promise<PolicyInput>;
|
|
11
|
-
evaluate(ctx: PolicyEvaluateContext<IdentityPolicy>): Promise<boolean>;
|
|
9
|
+
accessData(ctx: PolicyEvaluationContext): Promise<IdentityPolicyData | null>;
|
|
10
|
+
evaluate(value: Record<string, any>, ctx: PolicyEvaluationContext): Promise<PolicyEvaluationResult>;
|
|
12
11
|
}
|
|
13
12
|
//# sourceMappingURL=evaluator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/identity/evaluator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/identity/evaluator.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAG1G,OAAO,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,qBAAa,uBAAwB,YAAW,gBAAgB;IAC5D,SAAS,CAAC,SAAS,EAAG,uBAAuB,CAAC;IAE9C,SAAS,CAAC,aAAa,EAAG,2BAA2B,CAAC;;IAOhD,UAAU,CAAC,GAAG,EAAE,uBAAuB,GAAI,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAiB7E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CA0C5G"}
|
|
@@ -5,4 +5,26 @@ export interface IdentityPolicy extends PolicyBase {
|
|
|
5
5
|
*/
|
|
6
6
|
types?: string[];
|
|
7
7
|
}
|
|
8
|
+
export type IdentityPolicyData = {
|
|
9
|
+
/**
|
|
10
|
+
* user, client, robot
|
|
11
|
+
*/
|
|
12
|
+
type: string;
|
|
13
|
+
/**
|
|
14
|
+
* UUID
|
|
15
|
+
*/
|
|
16
|
+
id: string;
|
|
17
|
+
/**
|
|
18
|
+
* Client associated with identity.
|
|
19
|
+
*/
|
|
20
|
+
clientId?: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Realm id associated with identity.
|
|
23
|
+
*/
|
|
24
|
+
realmId?: string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Realm name associated with identity.
|
|
27
|
+
*/
|
|
28
|
+
realmName?: string | null;
|
|
29
|
+
};
|
|
8
30
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/identity/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,WAAW,cAAe,SAAQ,UAAU;IAC9C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/identity/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,WAAW,cAAe,SAAQ,UAAU;IAC9C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B,CAAC"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { PolicyInput, PolicyWithType } from '../../types';
|
|
3
|
-
import type { PermissionBindingPolicy } from './types';
|
|
1
|
+
import type { IPolicyEvaluator, PolicyEvaluationResult } from '../../evaluation';
|
|
4
2
|
import { PermissionBindingPolicyValidator } from './validator';
|
|
5
|
-
export declare class PermissionBindingPolicyEvaluator implements
|
|
3
|
+
export declare class PermissionBindingPolicyEvaluator implements IPolicyEvaluator {
|
|
6
4
|
protected validator: PermissionBindingPolicyValidator;
|
|
7
5
|
constructor();
|
|
8
|
-
|
|
9
|
-
validateConfig(ctx: PolicyEvaluateContext): Promise<PermissionBindingPolicy>;
|
|
10
|
-
validateInput(ctx: PolicyEvaluateContext): Promise<PolicyInput>;
|
|
11
|
-
evaluate(ctx: PolicyEvaluateContext<PermissionBindingPolicy, PolicyInput>): Promise<boolean>;
|
|
6
|
+
evaluate(value: Record<string, any>): Promise<PolicyEvaluationResult>;
|
|
12
7
|
}
|
|
13
8
|
//# sourceMappingURL=module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/permission-binding/module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/permission-binding/module.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAEjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AAE/D,qBAAa,gCAAiC,YAAW,gBAAgB;IACrE,SAAS,CAAC,SAAS,EAAE,gCAAgC,CAAC;;IAMhD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAQ9E"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import type { IPolicyEvaluator, PolicyEvaluationContext, PolicyEvaluationResult } from '../../evaluation';
|
|
2
|
+
import { AttributesPolicyEvaluator } from '../attributes';
|
|
3
|
+
import { IdentityPolicyEvaluator } from '../identity';
|
|
4
4
|
import { RealmMatchPolicyValidator } from './validator';
|
|
5
|
-
export declare class RealmMatchPolicyEvaluator implements
|
|
5
|
+
export declare class RealmMatchPolicyEvaluator implements IPolicyEvaluator {
|
|
6
6
|
protected validator: RealmMatchPolicyValidator;
|
|
7
|
+
protected identityEvaluator: IdentityPolicyEvaluator;
|
|
8
|
+
protected attributesEvaluator: AttributesPolicyEvaluator;
|
|
7
9
|
constructor();
|
|
8
|
-
|
|
9
|
-
validateConfig(ctx: PolicyEvaluateContext): Promise<RealmMatchPolicy>;
|
|
10
|
-
validateInput(ctx: PolicyEvaluateContext<RealmMatchPolicy>): Promise<PolicyInput>;
|
|
11
|
-
evaluate(ctx: PolicyEvaluateContext<RealmMatchPolicy>): Promise<boolean>;
|
|
10
|
+
evaluate(value: Record<string, any>, ctx: PolicyEvaluationContext): Promise<PolicyEvaluationResult>;
|
|
12
11
|
}
|
|
13
12
|
//# sourceMappingURL=evaluator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/realm-match/evaluator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/realm-match/evaluator.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAG1G,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAExD,qBAAa,yBAA0B,YAAW,gBAAgB;IAC9D,SAAS,CAAC,SAAS,EAAG,yBAAyB,CAAC;IAEhD,SAAS,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;IAErD,SAAS,CAAC,mBAAmB,EAAG,yBAAyB,CAAC;;IAQpD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAsI5G"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { PolicyInput, PolicyWithType } from '../../types';
|
|
3
|
-
import type { TimePolicy } from './types';
|
|
1
|
+
import type { IPolicyEvaluator, PolicyEvaluationContext, PolicyEvaluationResult } from '../../evaluation';
|
|
4
2
|
import { TimePolicyValidator } from './validator';
|
|
5
|
-
export declare class TimePolicyEvaluator implements
|
|
3
|
+
export declare class TimePolicyEvaluator implements IPolicyEvaluator {
|
|
6
4
|
protected validator: TimePolicyValidator;
|
|
7
5
|
constructor();
|
|
8
|
-
|
|
9
|
-
validateConfig(ctx: PolicyEvaluateContext): Promise<TimePolicy>;
|
|
10
|
-
validateInput(ctx: PolicyEvaluateContext<TimePolicy>): Promise<PolicyInput>;
|
|
11
|
-
evaluate(ctx: PolicyEvaluateContext<TimePolicy>): Promise<boolean>;
|
|
6
|
+
evaluate(value: Record<string, any>, ctx: PolicyEvaluationContext): Promise<PolicyEvaluationResult>;
|
|
12
7
|
}
|
|
13
8
|
//# sourceMappingURL=evaluator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/time/evaluator.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/time/evaluator.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAI1G,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAiClD,qBAAa,mBAAoB,YAAW,gBAAgB;IACxD,SAAS,CAAC,SAAS,EAAG,mBAAmB,CAAC;;IAMpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAoF5G"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AttributeNamesPolicyEvaluator, AttributesPolicyEvaluator, CompositePolicyEvaluator, DatePolicyEvaluator, IdentityPolicyEvaluator, PermissionBindingPolicyEvaluator, RealmMatchPolicyEvaluator, TimePolicyEvaluator } from './built-in';
|
|
2
|
+
export declare const PolicyDefaultEvaluators: {
|
|
3
|
+
readonly composite: CompositePolicyEvaluator;
|
|
4
|
+
readonly attributes: AttributesPolicyEvaluator<Record<string, any>>;
|
|
5
|
+
readonly attributeNames: AttributeNamesPolicyEvaluator;
|
|
6
|
+
readonly date: DatePolicyEvaluator;
|
|
7
|
+
readonly identity: IdentityPolicyEvaluator;
|
|
8
|
+
readonly permissionBinding: PermissionBindingPolicyEvaluator;
|
|
9
|
+
readonly realmMatch: RealmMatchPolicyEvaluator;
|
|
10
|
+
readonly time: TimePolicyEvaluator;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/policy/constants.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,6BAA6B,EAC7B,yBAAyB,EAEzB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,gCAAgC,EAChC,yBAAyB,EACzB,mBAAmB,EACtB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,uBAAuB;;;;;;;;;CAS1B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface IPolicyData {
|
|
2
|
+
set(key: string, value: unknown): void;
|
|
3
|
+
has(key: string): boolean;
|
|
4
|
+
get<T = unknown>(key: string): T;
|
|
5
|
+
isValidated(key: string): boolean;
|
|
6
|
+
setValidated(key: string): void;
|
|
7
|
+
clone(): IPolicyData;
|
|
8
|
+
}
|
|
9
|
+
export declare class PolicyData implements IPolicyData {
|
|
10
|
+
protected data: Record<string, any>;
|
|
11
|
+
protected validated: Set<string>;
|
|
12
|
+
constructor(data?: Record<string, any>, validated?: Set<string>);
|
|
13
|
+
set<T = unknown>(key: string, value: T): void;
|
|
14
|
+
get<T = unknown>(key: string): T;
|
|
15
|
+
has(key: string): boolean;
|
|
16
|
+
setValidated(key: string): void;
|
|
17
|
+
isValidated(key: string): boolean;
|
|
18
|
+
clone(): PolicyData;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/policy/data.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IACxB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAI,IAAI,CAAC;IACxC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAI,CAAC,CAAC;IAElC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAI,IAAI,CAAC;IAEjC,KAAK,IAAK,WAAW,CAAA;CACxB;AAED,qBAAa,UAAW,YAAW,WAAW;IAC1C,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEpC,SAAS,CAAC,SAAS,EAAG,GAAG,CAAC,MAAM,CAAC,CAAC;gBAG9B,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAC9B,SAAS,GAAE,GAAG,CAAC,MAAM,CAAa;IAMtC,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAI,IAAI;IAK9C,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAI,CAAC;IAQjC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAI,IAAI;IAIhC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAI,OAAO;IAIlC,KAAK;CAKR"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { IPolicyEvaluator, PolicyEvaluationContext, PolicyEvaluationResult, PolicyEvaluators } from '../evaluation';
|
|
2
|
+
import type { IPolicy } from '../types.ts';
|
|
3
|
+
import type { IPolicyEngine } from './types.ts';
|
|
3
4
|
/**
|
|
4
5
|
* The policy engine is a component that interprets defined policies and makes decisions
|
|
5
6
|
* on whether to allow or deny a particular access.
|
|
6
7
|
*/
|
|
7
|
-
export declare class PolicyEngine {
|
|
8
|
-
protected evaluators:
|
|
8
|
+
export declare class PolicyEngine implements IPolicyEngine {
|
|
9
|
+
protected evaluators: Record<string, IPolicyEvaluator>;
|
|
9
10
|
constructor(evaluators?: PolicyEvaluators);
|
|
10
|
-
registerEvaluator(type: string, evaluator:
|
|
11
|
+
registerEvaluator(type: string, evaluator: IPolicyEvaluator): void;
|
|
11
12
|
registerEvaluators(evaluators: PolicyEvaluators): void;
|
|
12
|
-
private registerDefaultEvaluators;
|
|
13
13
|
/**
|
|
14
|
-
* @
|
|
15
|
-
*
|
|
14
|
+
* @param policy
|
|
16
15
|
* @param ctx
|
|
17
16
|
*/
|
|
18
|
-
evaluate(ctx:
|
|
17
|
+
evaluate(policy: IPolicy, ctx: PolicyEvaluationContext): Promise<PolicyEvaluationResult>;
|
|
18
|
+
evaluateOrFail(policy: IPolicy, ctx: PolicyEvaluationContext): Promise<void>;
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/policy/engine/module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/policy/engine/module.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACR,gBAAgB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,gBAAgB,EACtF,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD;;;GAGG;AACH,qBAAa,YAAa,YAAW,aAAa;IAC9C,SAAS,CAAC,UAAU,EAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;gBAE5C,UAAU,GAAE,gBAAqB;IAItC,iBAAiB,CACpB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,gBAAgB,GAC3B,IAAI;IAID,kBAAkB,CAAC,UAAU,EAAE,gBAAgB;IAOtD;;;OAGG;IACG,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,uBAAuB,GAAI,OAAO,CAAC,sBAAsB,CAAC;IA4DzF,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,uBAAuB,GAAI,OAAO,CAAC,IAAI,CAAC;CAuBtF"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
export
|
|
1
|
+
import type { PolicyEvaluationContext, PolicyEvaluationResult } from '../evaluation';
|
|
2
|
+
import type { IPolicy } from '../types';
|
|
3
|
+
export interface IPolicyEngine {
|
|
4
|
+
evaluate(policy: IPolicy, options: PolicyEvaluationContext): Promise<PolicyEvaluationResult>;
|
|
5
|
+
evaluateOrFail(policy: IPolicy, options: PolicyEvaluationContext): Promise<void>;
|
|
6
|
+
}
|
|
4
7
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/policy/engine/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/policy/engine/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,WAAW,aAAa;IAC1B,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,uBAAuB,GAAI,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAE9F,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,uBAAuB,GAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACrF"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { AuthupError } from '@authup/errors';
|
|
2
|
+
import type { PolicyIssue } from '../issue';
|
|
2
3
|
export declare class PolicyError extends AuthupError {
|
|
3
4
|
constructor(message?: string, code?: string | null);
|
|
5
|
+
addIssue(data: PolicyIssue): void;
|
|
6
|
+
addIssues(data: PolicyIssue[]): void;
|
|
4
7
|
static evaluatorNotFound(type: string): PolicyError;
|
|
5
8
|
static evaluatorNotProcessable(): PolicyError;
|
|
6
9
|
static evaluatorContextInvalid(): PolicyError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/policy/error/module.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAa,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/policy/error/module.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAa,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,qBAAa,WAAY,SAAQ,WAAW;gBAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAIlD,QAAQ,CAAC,IAAI,EAAE,WAAW;IAI1B,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE;IAI7B,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,MAAM;IAOrC,MAAM,CAAC,uBAAuB;IAO9B,MAAM,CAAC,uBAAuB;CAMjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../../../src/policy/evaluation/context/define.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAGxF,wBAAgB,6BAA6B,CACzC,KAAK,GAAE,4BAAiC,GACxC,uBAAuB,CAQ1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/policy/evaluation/context/index.ts"],"names":[],"mappings":"AAOA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PolicyData } from '../../data.ts';
|
|
2
|
+
import type { IPolicyEvaluator } from '../types.ts';
|
|
3
|
+
export type PolicyEvaluationContext = {
|
|
4
|
+
readonly evaluators: Record<string, IPolicyEvaluator>;
|
|
5
|
+
readonly path: (string | number)[];
|
|
6
|
+
readonly exclude: string[];
|
|
7
|
+
readonly include: string[];
|
|
8
|
+
readonly data: PolicyData;
|
|
9
|
+
};
|
|
10
|
+
export type PolicyEvaluationContextInput = Partial<PolicyEvaluationContext>;
|
|
11
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/policy/evaluation/context/types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,MAAM,MAAM,uBAAuB,GAAG;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACtD,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAC5B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/policy/evaluation/index.ts"],"names":[],"mappings":"AAOA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
|