@authup/access 1.0.0-beta.68 → 1.0.0-beta.69
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.d.mts +65 -55
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +34 -7
- package/dist/index.mjs.map +1 -1
- package/dist/permission/authorization/module.d.ts.map +1 -1
- package/dist/policy/built-in/identity/data/validator.d.ts.map +1 -1
- package/dist/policy/built-in/identity/types.d.ts +9 -0
- package/dist/policy/built-in/identity/types.d.ts.map +1 -1
- package/dist/policy/built-in/permission-binding/identity-evaluator.d.ts +7 -7
- package/dist/policy/built-in/permission-binding/identity-evaluator.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/permission/authorization/module.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACR,oBAAoB,EAIvB,MAAM,cAAc,CAAC;AAWtB,OAAO,KAAK,EACR,gCAAgC,EAChC,2BAA2B,EAC3B,6BAA6B,EAEhC,MAAM,SAAS,CAAC;AA0CjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAsB,4BAA4B,CAC9C,KAAK,EAAE,2BAA2B,EAClC,OAAO,GAAE,6BAAkC,GAC3C,OAAO,CAAC,oBAAoB,CAAC,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/permission/authorization/module.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACR,oBAAoB,EAIvB,MAAM,cAAc,CAAC;AAWtB,OAAO,KAAK,EACR,gCAAgC,EAChC,2BAA2B,EAC3B,6BAA6B,EAEhC,MAAM,SAAS,CAAC;AA0CjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAsB,4BAA4B,CAC9C,KAAK,EAAE,2BAA2B,EAClC,OAAO,GAAE,6BAAkC,GAC3C,OAAO,CAAC,oBAAoB,CAAC,CAiMhC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,iCAAiC,CACnD,KAAK,EAAE,gCAAgC,GACvC,OAAO,CAAC,oBAAoB,CAAC,CA0GhC"}
|
|
@@ -1 +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;
|
|
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;AAIpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AActD,qBAAa,2BAA4B,SAAQ,SAAS,CAAC,kBAAkB,CAAC;IACjE,UAAU;CAuDtB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PermissionPolicyBinding } from '../../../permission/types';
|
|
1
2
|
import type { BasePolicy } from '../../types';
|
|
2
3
|
export interface IdentityPolicy extends BasePolicy {
|
|
3
4
|
/**
|
|
@@ -26,5 +27,13 @@ export type IdentityPolicyData = {
|
|
|
26
27
|
* Realm name associated with identity.
|
|
27
28
|
*/
|
|
28
29
|
realmName?: string | null;
|
|
30
|
+
/**
|
|
31
|
+
* The grants the identity holds. The permission binding evaluator reads
|
|
32
|
+
* them from here rather than loading them, so evaluation is a function of
|
|
33
|
+
* the data alone. Whoever places an identity in the policy data places
|
|
34
|
+
* its grants with it, and an identity without them holds none we could
|
|
35
|
+
* prove.
|
|
36
|
+
*/
|
|
37
|
+
grants?: PermissionPolicyBinding[];
|
|
29
38
|
};
|
|
30
39
|
//# 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;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;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/identity/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,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,CAAC;IAC1B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,uBAAuB,EAAE,CAAA;CACrC,CAAC"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import type { PermissionPolicyBinding, PermissionPolicyBindingAggregated } from '../../../permission/types';
|
|
2
2
|
import type { IPolicyEvaluator, PolicyEvaluationContext, PolicyEvaluationResult } from '../../evaluation';
|
|
3
|
-
import type { IdentityPolicyData } from '../identity';
|
|
4
3
|
import { IdentityPolicyEvaluator } from '../identity';
|
|
4
|
+
import type { IdentityPolicyData } from '../identity';
|
|
5
5
|
import { RealmMatchPolicyEvaluator } from '../realm-match';
|
|
6
6
|
import { PermissionBindingPolicyValidator } from './validator';
|
|
7
|
-
type IdentityPermissionProvider = {
|
|
8
|
-
getFor(identity: IdentityPolicyData): Promise<PermissionPolicyBinding[]>;
|
|
9
|
-
};
|
|
10
7
|
export declare class IdentityPermissionBindingPolicyEvaluator implements IPolicyEvaluator {
|
|
11
8
|
protected validator: PermissionBindingPolicyValidator;
|
|
12
9
|
protected identityEvaluator: IdentityPolicyEvaluator;
|
|
13
10
|
protected realmMatchEvaluator: RealmMatchPolicyEvaluator;
|
|
14
|
-
|
|
15
|
-
constructor(identityPermissionProvider: IdentityPermissionProvider);
|
|
11
|
+
constructor();
|
|
16
12
|
requires(): string[];
|
|
17
13
|
accessData(ctx: PolicyEvaluationContext): Promise<PermissionPolicyBindingAggregated | null>;
|
|
14
|
+
/**
|
|
15
|
+
* The grants the identity holds. An identity carrying none is missing
|
|
16
|
+
* data, which throws a PolicyError carrying the refusing issue.
|
|
17
|
+
*/
|
|
18
|
+
accessGrants(ctx: PolicyEvaluationContext, identity: IdentityPolicyData): PermissionPolicyBinding[];
|
|
18
19
|
evaluate(value: Record<string, any>, ctx: PolicyEvaluationContext): Promise<PolicyEvaluationResult>;
|
|
19
20
|
}
|
|
20
|
-
export {};
|
|
21
21
|
//# sourceMappingURL=identity-evaluator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-evaluator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/permission-binding/identity-evaluator.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,uBAAuB,EAAE,iCAAiC,EAAE,MAAM,2BAA2B,CAAC;AAG5G,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"identity-evaluator.d.ts","sourceRoot":"","sources":["../../../../src/policy/built-in/permission-binding/identity-evaluator.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,uBAAuB,EAAE,iCAAiC,EAAE,MAAM,2BAA2B,CAAC;AAG5G,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAO1G,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AAmB/D,qBAAa,wCAAyC,YAAW,gBAAgB;IAC7E,SAAS,CAAC,SAAS,EAAG,gCAAgC,CAAC;IAEvD,SAAS,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;IAErD,SAAS,CAAC,mBAAmB,EAAG,yBAAyB,CAAC;;IAQ1D,QAAQ,IAAK,MAAM,EAAE;IASf,UAAU,CAAC,GAAG,EAAE,uBAAuB,GAAI,OAAO,CAAC,iCAAiC,GAAG,IAAI,CAAC;IAiBlG;;;OAGG;IACH,YAAY,CACR,GAAG,EAAE,uBAAuB,EAC5B,QAAQ,EAAE,kBAAkB,GAC5B,uBAAuB,EAAE;IAcvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAuO5G"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authup/access",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.69",
|
|
5
5
|
"description": "A library for evaluating permissions and policies.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"exports": {
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
},
|
|
55
55
|
"homepage": "https://github.com/authup/authup#readme",
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@authup/errors": "^1.0.0-beta.
|
|
58
|
-
"@authup/kit": "^1.0.0-beta.
|
|
57
|
+
"@authup/errors": "^1.0.0-beta.69",
|
|
58
|
+
"@authup/kit": "^1.0.0-beta.69",
|
|
59
59
|
"@ebec/core": "^1.3.2",
|
|
60
60
|
"@rapiq/adapter-memory": "^2.4.0",
|
|
61
61
|
"@rapiq/core": "^2.4.0",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"zod": "^4.6.5"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"unplugin-swc": "^
|
|
70
|
-
"vitest": "^
|
|
69
|
+
"unplugin-swc": "^2.0.0",
|
|
70
|
+
"vitest": "^5.0.3"
|
|
71
71
|
},
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"access": "public"
|