@twin.org/rights-management-plugins 0.0.3-next.13 → 0.0.3-next.14
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/es/index.js +5 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IDefaultPolicyArbiterConfig.js +4 -0
- package/dist/es/models/IDefaultPolicyArbiterConfig.js.map +1 -0
- package/dist/es/models/IDefaultPolicyArbiterConstructorOptions.js +4 -0
- package/dist/es/models/IDefaultPolicyArbiterConstructorOptions.js.map +1 -0
- package/dist/es/models/IPassThroughPolicyObligationEnforcerConstructorOptions.js +4 -0
- package/dist/es/models/IPassThroughPolicyObligationEnforcerConstructorOptions.js.map +1 -0
- package/dist/es/policyArbiters/defaultPolicyArbiter.js +824 -0
- package/dist/es/policyArbiters/defaultPolicyArbiter.js.map +1 -0
- package/dist/es/policyArbiters/passThroughPolicyArbiter.js +5 -4
- package/dist/es/policyArbiters/passThroughPolicyArbiter.js.map +1 -1
- package/dist/es/policyEnforcementProcessor/defaultPolicyEnforcementProcessor.js +5 -4
- package/dist/es/policyEnforcementProcessor/defaultPolicyEnforcementProcessor.js.map +1 -1
- package/dist/es/policyEnforcementProcessor/passThroughPolicyEnforcementProcessor.js +5 -4
- package/dist/es/policyEnforcementProcessor/passThroughPolicyEnforcementProcessor.js.map +1 -1
- package/dist/es/policyExecutionActions/loggingPolicyExecutionAction.js +4 -1
- package/dist/es/policyExecutionActions/loggingPolicyExecutionAction.js.map +1 -1
- package/dist/es/policyInformationSources/identityPolicyInformationSource.js +2 -1
- package/dist/es/policyInformationSources/identityPolicyInformationSource.js.map +1 -1
- package/dist/es/policyInformationSources/staticPolicyInformationSource.js +2 -1
- package/dist/es/policyInformationSources/staticPolicyInformationSource.js.map +1 -1
- package/dist/es/policyObligationEnforcers/passThroughPolicyObligationEnforcer.js +55 -0
- package/dist/es/policyObligationEnforcers/passThroughPolicyObligationEnforcer.js.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/models/IDefaultPolicyArbiterConfig.d.ts +10 -0
- package/dist/types/models/IDefaultPolicyArbiterConstructorOptions.d.ts +20 -0
- package/dist/types/models/IPassThroughPolicyObligationEnforcerConstructorOptions.d.ts +10 -0
- package/dist/types/policyArbiters/defaultPolicyArbiter.d.ts +34 -0
- package/dist/types/policyArbiters/passThroughPolicyArbiter.d.ts +5 -4
- package/dist/types/policyEnforcementProcessor/defaultPolicyEnforcementProcessor.d.ts +4 -3
- package/dist/types/policyEnforcementProcessor/passThroughPolicyEnforcementProcessor.d.ts +4 -3
- package/dist/types/policyExecutionActions/loggingPolicyExecutionAction.d.ts +3 -2
- package/dist/types/policyInformationSources/identityPolicyInformationSource.d.ts +3 -2
- package/dist/types/policyInformationSources/staticPolicyInformationSource.d.ts +3 -2
- package/dist/types/policyObligationEnforcers/passThroughPolicyObligationEnforcer.d.ts +35 -0
- package/docs/changelog.md +23 -0
- package/docs/reference/classes/DefaultPolicyArbiter.md +101 -0
- package/docs/reference/classes/DefaultPolicyEnforcementProcessor.md +10 -4
- package/docs/reference/classes/IdentityPolicyInformationSource.md +7 -1
- package/docs/reference/classes/LoggingPolicyExecutionAction.md +7 -1
- package/docs/reference/classes/PassThroughPolicyArbiter.md +10 -4
- package/docs/reference/classes/PassThroughPolicyEnforcementProcessor.md +10 -4
- package/docs/reference/classes/PassThroughPolicyObligationEnforcer.md +107 -0
- package/docs/reference/classes/StaticPolicyInformationSource.md +7 -1
- package/docs/reference/index.md +5 -0
- package/docs/reference/interfaces/IDefaultPolicyArbiterConfig.md +17 -0
- package/docs/reference/interfaces/IDefaultPolicyArbiterConstructorOptions.md +39 -0
- package/docs/reference/interfaces/IPassThroughPolicyObligationEnforcerConstructorOptions.md +17 -0
- package/locales/en.json +16 -0
- package/package.json +2 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IDefaultPolicyArbiterConfig } from "./IDefaultPolicyArbiterConfig.js";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the Default Policy Arbiter.
|
|
4
|
+
*/
|
|
5
|
+
export interface IDefaultPolicyArbiterConstructorOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The logging component for policy arbiter.
|
|
8
|
+
* @default logging
|
|
9
|
+
*/
|
|
10
|
+
loggingComponentType?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The policy administration point component for retrieving inherited policies.
|
|
13
|
+
* @default policy-administration-point
|
|
14
|
+
*/
|
|
15
|
+
policyAdministrationPointComponentType?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The configuration options for the default policy arbiter.
|
|
18
|
+
*/
|
|
19
|
+
config?: IDefaultPolicyArbiterConfig;
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for the Pass Through Policy Obligation Enforcer.
|
|
3
|
+
*/
|
|
4
|
+
export interface IPassThroughPolicyObligationEnforcerConstructorOptions {
|
|
5
|
+
/**
|
|
6
|
+
* The logging component for the policy obligation enforcer.
|
|
7
|
+
* @default logging
|
|
8
|
+
*/
|
|
9
|
+
loggingComponentType?: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
|
+
import { type IPolicyArbiter, type IPolicyDecision } from "@twin.org/rights-management-models";
|
|
3
|
+
import { type ActionType, type IOdrlAgreement } from "@twin.org/standards-w3c-odrl";
|
|
4
|
+
import type { IDefaultPolicyArbiterConstructorOptions } from "../models/IDefaultPolicyArbiterConstructorOptions.js";
|
|
5
|
+
/**
|
|
6
|
+
* Default Policy Arbiter.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DefaultPolicyArbiter implements IPolicyArbiter {
|
|
9
|
+
/**
|
|
10
|
+
* The class name of the Default Policy Arbiter.
|
|
11
|
+
*/
|
|
12
|
+
static readonly CLASS_NAME: string;
|
|
13
|
+
/**
|
|
14
|
+
* Create a new instance of DefaultPolicyArbiter.
|
|
15
|
+
* @param options The options for the default policy arbiter.
|
|
16
|
+
*/
|
|
17
|
+
constructor(options?: IDefaultPolicyArbiterConstructorOptions);
|
|
18
|
+
/**
|
|
19
|
+
* Returns the class name of the component.
|
|
20
|
+
* @returns The class name of the component.
|
|
21
|
+
*/
|
|
22
|
+
className(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Makes decisions regarding policy access to data.
|
|
25
|
+
* @param agreement The agreement to evaluate.
|
|
26
|
+
* @param information Information provided by the requester to determine if a policy can be created.
|
|
27
|
+
* @param data The data to make a decision on.
|
|
28
|
+
* @param action Optional action to make a decision on, if not provided, the arbiter will evaluate all actions in the agreement.
|
|
29
|
+
* @returns The decisions about access to the data.
|
|
30
|
+
*/
|
|
31
|
+
decide<D = unknown>(agreement: IOdrlAgreement, information?: {
|
|
32
|
+
[id: string]: IJsonLdNodeObject;
|
|
33
|
+
}, data?: D, action?: ActionType | string): Promise<IPolicyDecision[]>;
|
|
34
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
2
|
import { type IPolicyArbiter, type IPolicyDecision } from "@twin.org/rights-management-models";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ActionType, IOdrlAgreement } from "@twin.org/standards-w3c-odrl";
|
|
4
4
|
import type { IPassThroughPolicyArbiterConstructorOptions } from "../models/IPassThroughPolicyArbiterConstructorOptions.js";
|
|
5
5
|
/**
|
|
6
6
|
* Pass Through Policy Arbiter.
|
|
@@ -22,12 +22,13 @@ export declare class PassThroughPolicyArbiter implements IPolicyArbiter {
|
|
|
22
22
|
className(): string;
|
|
23
23
|
/**
|
|
24
24
|
* Makes decisions regarding policy access to data.
|
|
25
|
-
* @param
|
|
25
|
+
* @param agreement The agreement to evaluate.
|
|
26
26
|
* @param information Information provided by the requester to determine if a policy can be created.
|
|
27
27
|
* @param data The data to make a decision on.
|
|
28
|
+
* @param action Optional action to make a decision on, if not provided, the arbiter will evaluate all actions in the agreement.
|
|
28
29
|
* @returns The decisions about access to the data.
|
|
29
30
|
*/
|
|
30
|
-
decide<D = unknown>(
|
|
31
|
+
decide<D = unknown>(agreement: IOdrlAgreement, information?: {
|
|
31
32
|
[id: string]: IJsonLdNodeObject;
|
|
32
|
-
}, data?: D): Promise<IPolicyDecision[]>;
|
|
33
|
+
}, data?: D, action?: ActionType | string): Promise<IPolicyDecision[]>;
|
|
33
34
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IPolicyDecision, type IPolicyEnforcementProcessor } from "@twin.org/rights-management-models";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ActionType, IOdrlAgreement } from "@twin.org/standards-w3c-odrl";
|
|
3
3
|
import type { IDefaultPolicyEnforcementProcessorConstructorOptions } from "../models/IDefaultPolicyEnforcementProcessorConstructorOptions.js";
|
|
4
4
|
/**
|
|
5
5
|
* Default Policy Enforcement Processor.
|
|
@@ -21,12 +21,13 @@ export declare class DefaultPolicyEnforcementProcessor implements IPolicyEnforce
|
|
|
21
21
|
className(): string;
|
|
22
22
|
/**
|
|
23
23
|
* Process the response from the policy decision point.
|
|
24
|
-
* @param
|
|
24
|
+
* @param agreement The agreement to process.
|
|
25
25
|
* @param decisions The decisions made by the policy decision point.
|
|
26
26
|
* @param data The data to process.
|
|
27
|
+
* @param action Optional action to make a decision on, if not provided, the arbiter will evaluate all actions in the agreement.
|
|
27
28
|
* @returns The data after processing.
|
|
28
29
|
*/
|
|
29
|
-
process<D = unknown, R = D>(
|
|
30
|
+
process<D = unknown, R = D>(agreement: IOdrlAgreement, decisions: IPolicyDecision[], data?: D, action?: ActionType | string): Promise<R>;
|
|
30
31
|
/**
|
|
31
32
|
* Process a single policy decision.
|
|
32
33
|
* @param sourceObject The data to process.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IPolicyDecision, IPolicyEnforcementProcessor } from "@twin.org/rights-management-models";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ActionType, IOdrlAgreement } from "@twin.org/standards-w3c-odrl";
|
|
3
3
|
import type { IPassThroughPolicyEnforcementProcessorConstructorOptions } from "../models/IPassThroughPolicyEnforcementProcessorConstructorOptions.js";
|
|
4
4
|
/**
|
|
5
5
|
* Pass Through Policy Enforcement Processor.
|
|
@@ -21,10 +21,11 @@ export declare class PassThroughPolicyEnforcementProcessor implements IPolicyEnf
|
|
|
21
21
|
className(): string;
|
|
22
22
|
/**
|
|
23
23
|
* Process the response from the policy decision point.
|
|
24
|
-
* @param
|
|
24
|
+
* @param agreement The agreement to process.
|
|
25
25
|
* @param decisions The decisions made by the policy decision point.
|
|
26
26
|
* @param data The data to process.
|
|
27
|
+
* @param action Optional action to make a decision on, if not provided, the arbiter will evaluate all actions in the agreement.
|
|
27
28
|
* @returns The data after processing.
|
|
28
29
|
*/
|
|
29
|
-
process<D = unknown, R = D>(
|
|
30
|
+
process<D = unknown, R = D>(agreement: IOdrlAgreement, decisions: IPolicyDecision[], data?: D, action?: ActionType | string): Promise<R>;
|
|
30
31
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IPolicyDecision, type IPolicyExecutionAction, PolicyDecisionStage } from "@twin.org/rights-management-models";
|
|
2
|
-
import type { IOdrlPolicy } from "@twin.org/standards-w3c-odrl";
|
|
2
|
+
import type { ActionType, IOdrlPolicy } from "@twin.org/standards-w3c-odrl";
|
|
3
3
|
import type { ILoggingPolicyExecutionActionConstructorOptions } from "../models/ILoggingPolicyExecutionActionConstructorOptions.js";
|
|
4
4
|
/**
|
|
5
5
|
* Logging Policy Execution Action to send decisions to logging.
|
|
@@ -41,8 +41,9 @@ export declare class LoggingPolicyExecutionAction implements IPolicyExecutionAct
|
|
|
41
41
|
* @param policy The policy that applied to the data.
|
|
42
42
|
* @param decisions The decisions made by the PDP.
|
|
43
43
|
* @param data The data to process.
|
|
44
|
+
* @param action Optional action to make a decision on, if not provided, the arbiter will evaluate all actions in the agreement.
|
|
44
45
|
* @param stage The stage of the policy decision.
|
|
45
46
|
* @returns A promise that resolves when the action is complete.
|
|
46
47
|
*/
|
|
47
|
-
execute<D = unknown>(policy: IOdrlPolicy, decisions: IPolicyDecision[], data: D | undefined, stage: PolicyDecisionStage): Promise<void>;
|
|
48
|
+
execute<D = unknown>(policy: IOdrlPolicy, decisions: IPolicyDecision[], data: D | undefined, action: ActionType | string, stage: PolicyDecisionStage): Promise<void>;
|
|
48
49
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
2
|
import { type IPolicyInformationSource, PolicyInformationAccessMode } from "@twin.org/rights-management-models";
|
|
3
|
-
import type { IOdrlPolicy } from "@twin.org/standards-w3c-odrl";
|
|
3
|
+
import type { ActionType, IOdrlPolicy } from "@twin.org/standards-w3c-odrl";
|
|
4
4
|
import type { IIdentityPolicyInformationSourceConstructorOptions } from "../models/IIdentityPolicyInformationSourceConstructorOptions.js";
|
|
5
5
|
/**
|
|
6
6
|
* Policy information source which retrieves the identity information.
|
|
@@ -25,9 +25,10 @@ export declare class IdentityPolicyInformationSource implements IPolicyInformati
|
|
|
25
25
|
* @param policy The policy to retrieve information for if available.
|
|
26
26
|
* @param accessMode The access mode to use for the retrieval.
|
|
27
27
|
* @param data The data to process.
|
|
28
|
+
* @param action The action that was evaluated.
|
|
28
29
|
* @returns The objects containing relevant information or undefined if nothing relevant is found.
|
|
29
30
|
*/
|
|
30
|
-
retrieve<D = unknown>(policy: IOdrlPolicy | undefined, accessMode: PolicyInformationAccessMode, data?: D): Promise<{
|
|
31
|
+
retrieve<D = unknown>(policy: IOdrlPolicy | undefined, accessMode: PolicyInformationAccessMode, data?: D, action?: ActionType | string): Promise<{
|
|
31
32
|
[id: string]: IJsonLdNodeObject;
|
|
32
33
|
} | undefined>;
|
|
33
34
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
2
|
import { PolicyInformationAccessMode, type IPolicyInformationSource } from "@twin.org/rights-management-models";
|
|
3
|
-
import type { IOdrlPolicy } from "@twin.org/standards-w3c-odrl";
|
|
3
|
+
import type { ActionType, IOdrlPolicy } from "@twin.org/standards-w3c-odrl";
|
|
4
4
|
import type { IStaticPolicyInformationSource } from "../models/IStaticPolicyInformationSource.js";
|
|
5
5
|
import type { IStaticPolicyInformationSourceConstructorOptions } from "../models/IStaticPolicyInformationSourceConstructorOptions.js";
|
|
6
6
|
/**
|
|
@@ -26,9 +26,10 @@ export declare class StaticPolicyInformationSource implements IPolicyInformation
|
|
|
26
26
|
* @param policy The policy to retrieve information for if available.
|
|
27
27
|
* @param accessMode The access mode to use for the retrieval.
|
|
28
28
|
* @param data The data to process.
|
|
29
|
+
* @param action The action to get any additional information for.
|
|
29
30
|
* @returns The objects containing relevant information or undefined if nothing relevant is found.
|
|
30
31
|
*/
|
|
31
|
-
retrieve<D = unknown>(policy: IOdrlPolicy | undefined, accessMode: PolicyInformationAccessMode, data?: D): Promise<{
|
|
32
|
+
retrieve<D = unknown>(policy: IOdrlPolicy | undefined, accessMode: PolicyInformationAccessMode, data?: D, action?: ActionType | string): Promise<{
|
|
32
33
|
[id: string]: IJsonLdNodeObject;
|
|
33
34
|
} | undefined>;
|
|
34
35
|
/**
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
|
+
import type { IPolicyObligationEnforcer } from "@twin.org/rights-management-models";
|
|
3
|
+
import type { ActionType, IOdrlDuty, IOdrlPolicy } from "@twin.org/standards-w3c-odrl";
|
|
4
|
+
import type { IPassThroughPolicyObligationEnforcerConstructorOptions } from "../models/IPassThroughPolicyObligationEnforcerConstructorOptions.js";
|
|
5
|
+
/**
|
|
6
|
+
* Pass Through Policy Obligation Enforcer.
|
|
7
|
+
*/
|
|
8
|
+
export declare class PassThroughPolicyObligationEnforcer implements IPolicyObligationEnforcer {
|
|
9
|
+
/**
|
|
10
|
+
* The class name of the Pass Through Policy Obligation Enforcer.
|
|
11
|
+
*/
|
|
12
|
+
static readonly CLASS_NAME: string;
|
|
13
|
+
/**
|
|
14
|
+
* Create a new instance of Pass Through Policy Obligation Enforcer.
|
|
15
|
+
* @param options The options for the pass through policy obligation enforcer.
|
|
16
|
+
*/
|
|
17
|
+
constructor(options?: IPassThroughPolicyObligationEnforcerConstructorOptions);
|
|
18
|
+
/**
|
|
19
|
+
* Returns the class name of the component.
|
|
20
|
+
* @returns The class name of the component.
|
|
21
|
+
*/
|
|
22
|
+
className(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Enforces obligations regarding policy access to data.
|
|
25
|
+
* @param policy The policy to evaluate.
|
|
26
|
+
* @param duty The duty to enforce.
|
|
27
|
+
* @param information Information provided by the requester to determine if a policy can be created.
|
|
28
|
+
* @param data The data to make a decision on.
|
|
29
|
+
* @param action Optional action to make a decision on, if not provided, the enforcer will evaluate all actions in the duty.
|
|
30
|
+
* @returns Whether the obligations were successfully enforced.
|
|
31
|
+
*/
|
|
32
|
+
enforce<D = unknown>(policy: IOdrlPolicy, duty: IOdrlDuty, information?: {
|
|
33
|
+
[id: string]: IJsonLdNodeObject;
|
|
34
|
+
}, data?: D, action?: ActionType | string): Promise<boolean>;
|
|
35
|
+
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.14](https://github.com/twinfoundation/rights-management/compare/rights-management-plugins-v0.0.3-next.13...rights-management-plugins-v0.0.3-next.14) (2026-02-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add default policy arbiter ([#76](https://github.com/twinfoundation/rights-management/issues/76)) ([b62ff9c](https://github.com/twinfoundation/rights-management/commit/b62ff9ce1b3400c4a95909da01863af47f430dbf))
|
|
9
|
+
* policy negotiator callback ([#77](https://github.com/twinfoundation/rights-management/issues/77)) ([6566ed0](https://github.com/twinfoundation/rights-management/commit/6566ed0e2186b6445f1669f9b2f88a6ce059ab83))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Dependencies
|
|
13
|
+
|
|
14
|
+
* The following workspace dependencies were updated
|
|
15
|
+
* dependencies
|
|
16
|
+
* @twin.org/rights-management-models bumped from 0.0.3-next.13 to 0.0.3-next.14
|
|
17
|
+
* devDependencies
|
|
18
|
+
* @twin.org/rights-management-pap-service bumped from 0.0.3-next.13 to 0.0.3-next.14
|
|
19
|
+
* @twin.org/rights-management-pdp-service bumped from 0.0.3-next.13 to 0.0.3-next.14
|
|
20
|
+
* @twin.org/rights-management-pep-service bumped from 0.0.3-next.13 to 0.0.3-next.14
|
|
21
|
+
* @twin.org/rights-management-pip-service bumped from 0.0.3-next.13 to 0.0.3-next.14
|
|
22
|
+
* @twin.org/rights-management-pmp-service bumped from 0.0.3-next.13 to 0.0.3-next.14
|
|
23
|
+
* @twin.org/rights-management-pnp-service bumped from 0.0.3-next.13 to 0.0.3-next.14
|
|
24
|
+
* @twin.org/rights-management-pxp-service bumped from 0.0.3-next.13 to 0.0.3-next.14
|
|
25
|
+
|
|
3
26
|
## [0.0.3-next.13](https://github.com/twinfoundation/rights-management/compare/rights-management-plugins-v0.0.3-next.12...rights-management-plugins-v0.0.3-next.13) (2026-02-02)
|
|
4
27
|
|
|
5
28
|
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Class: DefaultPolicyArbiter
|
|
2
|
+
|
|
3
|
+
Default Policy Arbiter.
|
|
4
|
+
|
|
5
|
+
## Implements
|
|
6
|
+
|
|
7
|
+
- `IPolicyArbiter`
|
|
8
|
+
|
|
9
|
+
## Constructors
|
|
10
|
+
|
|
11
|
+
### Constructor
|
|
12
|
+
|
|
13
|
+
> **new DefaultPolicyArbiter**(`options?`): `DefaultPolicyArbiter`
|
|
14
|
+
|
|
15
|
+
Create a new instance of DefaultPolicyArbiter.
|
|
16
|
+
|
|
17
|
+
#### Parameters
|
|
18
|
+
|
|
19
|
+
##### options?
|
|
20
|
+
|
|
21
|
+
[`IDefaultPolicyArbiterConstructorOptions`](../interfaces/IDefaultPolicyArbiterConstructorOptions.md)
|
|
22
|
+
|
|
23
|
+
The options for the default policy arbiter.
|
|
24
|
+
|
|
25
|
+
#### Returns
|
|
26
|
+
|
|
27
|
+
`DefaultPolicyArbiter`
|
|
28
|
+
|
|
29
|
+
## Properties
|
|
30
|
+
|
|
31
|
+
### CLASS\_NAME
|
|
32
|
+
|
|
33
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
34
|
+
|
|
35
|
+
The class name of the Default Policy Arbiter.
|
|
36
|
+
|
|
37
|
+
## Methods
|
|
38
|
+
|
|
39
|
+
### className()
|
|
40
|
+
|
|
41
|
+
> **className**(): `string`
|
|
42
|
+
|
|
43
|
+
Returns the class name of the component.
|
|
44
|
+
|
|
45
|
+
#### Returns
|
|
46
|
+
|
|
47
|
+
`string`
|
|
48
|
+
|
|
49
|
+
The class name of the component.
|
|
50
|
+
|
|
51
|
+
#### Implementation of
|
|
52
|
+
|
|
53
|
+
`IPolicyArbiter.className`
|
|
54
|
+
|
|
55
|
+
***
|
|
56
|
+
|
|
57
|
+
### decide()
|
|
58
|
+
|
|
59
|
+
> **decide**\<`D`\>(`agreement`, `information?`, `data?`, `action?`): `Promise`\<`IPolicyDecision`[]\>
|
|
60
|
+
|
|
61
|
+
Makes decisions regarding policy access to data.
|
|
62
|
+
|
|
63
|
+
#### Type Parameters
|
|
64
|
+
|
|
65
|
+
##### D
|
|
66
|
+
|
|
67
|
+
`D` = `unknown`
|
|
68
|
+
|
|
69
|
+
#### Parameters
|
|
70
|
+
|
|
71
|
+
##### agreement
|
|
72
|
+
|
|
73
|
+
`IOdrlAgreement`
|
|
74
|
+
|
|
75
|
+
The agreement to evaluate.
|
|
76
|
+
|
|
77
|
+
##### information?
|
|
78
|
+
|
|
79
|
+
Information provided by the requester to determine if a policy can be created.
|
|
80
|
+
|
|
81
|
+
##### data?
|
|
82
|
+
|
|
83
|
+
`D`
|
|
84
|
+
|
|
85
|
+
The data to make a decision on.
|
|
86
|
+
|
|
87
|
+
##### action?
|
|
88
|
+
|
|
89
|
+
`string`
|
|
90
|
+
|
|
91
|
+
Optional action to make a decision on, if not provided, the arbiter will evaluate all actions in the agreement.
|
|
92
|
+
|
|
93
|
+
#### Returns
|
|
94
|
+
|
|
95
|
+
`Promise`\<`IPolicyDecision`[]\>
|
|
96
|
+
|
|
97
|
+
The decisions about access to the data.
|
|
98
|
+
|
|
99
|
+
#### Implementation of
|
|
100
|
+
|
|
101
|
+
`IPolicyArbiter.decide`
|
|
@@ -56,7 +56,7 @@ The class name of the component.
|
|
|
56
56
|
|
|
57
57
|
### process()
|
|
58
58
|
|
|
59
|
-
> **process**\<`D`, `R`\>(`
|
|
59
|
+
> **process**\<`D`, `R`\>(`agreement`, `decisions`, `data?`, `action?`): `Promise`\<`R`\>
|
|
60
60
|
|
|
61
61
|
Process the response from the policy decision point.
|
|
62
62
|
|
|
@@ -72,11 +72,11 @@ Process the response from the policy decision point.
|
|
|
72
72
|
|
|
73
73
|
#### Parameters
|
|
74
74
|
|
|
75
|
-
#####
|
|
75
|
+
##### agreement
|
|
76
76
|
|
|
77
|
-
`
|
|
77
|
+
`IOdrlAgreement`
|
|
78
78
|
|
|
79
|
-
The
|
|
79
|
+
The agreement to process.
|
|
80
80
|
|
|
81
81
|
##### decisions
|
|
82
82
|
|
|
@@ -90,6 +90,12 @@ The decisions made by the policy decision point.
|
|
|
90
90
|
|
|
91
91
|
The data to process.
|
|
92
92
|
|
|
93
|
+
##### action?
|
|
94
|
+
|
|
95
|
+
`string`
|
|
96
|
+
|
|
97
|
+
Optional action to make a decision on, if not provided, the arbiter will evaluate all actions in the agreement.
|
|
98
|
+
|
|
93
99
|
#### Returns
|
|
94
100
|
|
|
95
101
|
`Promise`\<`R`\>
|
|
@@ -56,7 +56,7 @@ The class name of the component.
|
|
|
56
56
|
|
|
57
57
|
### retrieve()
|
|
58
58
|
|
|
59
|
-
> **retrieve**\<`D`\>(`policy`, `accessMode`, `data?`): `Promise`\<\{\[`id`: `string`\]: `IJsonLdNodeObject`; \} \| `undefined`\>
|
|
59
|
+
> **retrieve**\<`D`\>(`policy`, `accessMode`, `data?`, `action?`): `Promise`\<\{\[`id`: `string`\]: `IJsonLdNodeObject`; \} \| `undefined`\>
|
|
60
60
|
|
|
61
61
|
Retrieve information from the sources.
|
|
62
62
|
|
|
@@ -86,6 +86,12 @@ The access mode to use for the retrieval.
|
|
|
86
86
|
|
|
87
87
|
The data to process.
|
|
88
88
|
|
|
89
|
+
##### action?
|
|
90
|
+
|
|
91
|
+
`string`
|
|
92
|
+
|
|
93
|
+
The action that was evaluated.
|
|
94
|
+
|
|
89
95
|
#### Returns
|
|
90
96
|
|
|
91
97
|
`Promise`\<\{\[`id`: `string`\]: `IJsonLdNodeObject`; \} \| `undefined`\>
|
|
@@ -74,7 +74,7 @@ List of stages.
|
|
|
74
74
|
|
|
75
75
|
### execute()
|
|
76
76
|
|
|
77
|
-
> **execute**\<`D`\>(`policy`, `decisions`, `data`, `stage`): `Promise`\<`void`\>
|
|
77
|
+
> **execute**\<`D`\>(`policy`, `decisions`, `data`, `action`, `stage`): `Promise`\<`void`\>
|
|
78
78
|
|
|
79
79
|
Execute function type for policy actions.
|
|
80
80
|
|
|
@@ -104,6 +104,12 @@ The data to process.
|
|
|
104
104
|
|
|
105
105
|
`D` | `undefined`
|
|
106
106
|
|
|
107
|
+
##### action
|
|
108
|
+
|
|
109
|
+
`string`
|
|
110
|
+
|
|
111
|
+
Optional action to make a decision on, if not provided, the arbiter will evaluate all actions in the agreement.
|
|
112
|
+
|
|
107
113
|
##### stage
|
|
108
114
|
|
|
109
115
|
`PolicyDecisionStage`
|
|
@@ -56,7 +56,7 @@ The class name of the component.
|
|
|
56
56
|
|
|
57
57
|
### decide()
|
|
58
58
|
|
|
59
|
-
> **decide**\<`D`\>(`
|
|
59
|
+
> **decide**\<`D`\>(`agreement`, `information?`, `data?`, `action?`): `Promise`\<`IPolicyDecision`[]\>
|
|
60
60
|
|
|
61
61
|
Makes decisions regarding policy access to data.
|
|
62
62
|
|
|
@@ -68,11 +68,11 @@ Makes decisions regarding policy access to data.
|
|
|
68
68
|
|
|
69
69
|
#### Parameters
|
|
70
70
|
|
|
71
|
-
#####
|
|
71
|
+
##### agreement
|
|
72
72
|
|
|
73
|
-
`
|
|
73
|
+
`IOdrlAgreement`
|
|
74
74
|
|
|
75
|
-
The
|
|
75
|
+
The agreement to evaluate.
|
|
76
76
|
|
|
77
77
|
##### information?
|
|
78
78
|
|
|
@@ -84,6 +84,12 @@ Information provided by the requester to determine if a policy can be created.
|
|
|
84
84
|
|
|
85
85
|
The data to make a decision on.
|
|
86
86
|
|
|
87
|
+
##### action?
|
|
88
|
+
|
|
89
|
+
`string`
|
|
90
|
+
|
|
91
|
+
Optional action to make a decision on, if not provided, the arbiter will evaluate all actions in the agreement.
|
|
92
|
+
|
|
87
93
|
#### Returns
|
|
88
94
|
|
|
89
95
|
`Promise`\<`IPolicyDecision`[]\>
|
|
@@ -56,7 +56,7 @@ The class name of the component.
|
|
|
56
56
|
|
|
57
57
|
### process()
|
|
58
58
|
|
|
59
|
-
> **process**\<`D`, `R`\>(`
|
|
59
|
+
> **process**\<`D`, `R`\>(`agreement`, `decisions`, `data?`, `action?`): `Promise`\<`R`\>
|
|
60
60
|
|
|
61
61
|
Process the response from the policy decision point.
|
|
62
62
|
|
|
@@ -72,11 +72,11 @@ Process the response from the policy decision point.
|
|
|
72
72
|
|
|
73
73
|
#### Parameters
|
|
74
74
|
|
|
75
|
-
#####
|
|
75
|
+
##### agreement
|
|
76
76
|
|
|
77
|
-
`
|
|
77
|
+
`IOdrlAgreement`
|
|
78
78
|
|
|
79
|
-
The
|
|
79
|
+
The agreement to process.
|
|
80
80
|
|
|
81
81
|
##### decisions
|
|
82
82
|
|
|
@@ -90,6 +90,12 @@ The decisions made by the policy decision point.
|
|
|
90
90
|
|
|
91
91
|
The data to process.
|
|
92
92
|
|
|
93
|
+
##### action?
|
|
94
|
+
|
|
95
|
+
`string`
|
|
96
|
+
|
|
97
|
+
Optional action to make a decision on, if not provided, the arbiter will evaluate all actions in the agreement.
|
|
98
|
+
|
|
93
99
|
#### Returns
|
|
94
100
|
|
|
95
101
|
`Promise`\<`R`\>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Class: PassThroughPolicyObligationEnforcer
|
|
2
|
+
|
|
3
|
+
Pass Through Policy Obligation Enforcer.
|
|
4
|
+
|
|
5
|
+
## Implements
|
|
6
|
+
|
|
7
|
+
- `IPolicyObligationEnforcer`
|
|
8
|
+
|
|
9
|
+
## Constructors
|
|
10
|
+
|
|
11
|
+
### Constructor
|
|
12
|
+
|
|
13
|
+
> **new PassThroughPolicyObligationEnforcer**(`options?`): `PassThroughPolicyObligationEnforcer`
|
|
14
|
+
|
|
15
|
+
Create a new instance of Pass Through Policy Obligation Enforcer.
|
|
16
|
+
|
|
17
|
+
#### Parameters
|
|
18
|
+
|
|
19
|
+
##### options?
|
|
20
|
+
|
|
21
|
+
[`IPassThroughPolicyObligationEnforcerConstructorOptions`](../interfaces/IPassThroughPolicyObligationEnforcerConstructorOptions.md)
|
|
22
|
+
|
|
23
|
+
The options for the pass through policy obligation enforcer.
|
|
24
|
+
|
|
25
|
+
#### Returns
|
|
26
|
+
|
|
27
|
+
`PassThroughPolicyObligationEnforcer`
|
|
28
|
+
|
|
29
|
+
## Properties
|
|
30
|
+
|
|
31
|
+
### CLASS\_NAME
|
|
32
|
+
|
|
33
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
34
|
+
|
|
35
|
+
The class name of the Pass Through Policy Obligation Enforcer.
|
|
36
|
+
|
|
37
|
+
## Methods
|
|
38
|
+
|
|
39
|
+
### className()
|
|
40
|
+
|
|
41
|
+
> **className**(): `string`
|
|
42
|
+
|
|
43
|
+
Returns the class name of the component.
|
|
44
|
+
|
|
45
|
+
#### Returns
|
|
46
|
+
|
|
47
|
+
`string`
|
|
48
|
+
|
|
49
|
+
The class name of the component.
|
|
50
|
+
|
|
51
|
+
#### Implementation of
|
|
52
|
+
|
|
53
|
+
`IPolicyObligationEnforcer.className`
|
|
54
|
+
|
|
55
|
+
***
|
|
56
|
+
|
|
57
|
+
### enforce()
|
|
58
|
+
|
|
59
|
+
> **enforce**\<`D`\>(`policy`, `duty`, `information?`, `data?`, `action?`): `Promise`\<`boolean`\>
|
|
60
|
+
|
|
61
|
+
Enforces obligations regarding policy access to data.
|
|
62
|
+
|
|
63
|
+
#### Type Parameters
|
|
64
|
+
|
|
65
|
+
##### D
|
|
66
|
+
|
|
67
|
+
`D` = `unknown`
|
|
68
|
+
|
|
69
|
+
#### Parameters
|
|
70
|
+
|
|
71
|
+
##### policy
|
|
72
|
+
|
|
73
|
+
`IOdrlPolicy`
|
|
74
|
+
|
|
75
|
+
The policy to evaluate.
|
|
76
|
+
|
|
77
|
+
##### duty
|
|
78
|
+
|
|
79
|
+
`IOdrlDuty`
|
|
80
|
+
|
|
81
|
+
The duty to enforce.
|
|
82
|
+
|
|
83
|
+
##### information?
|
|
84
|
+
|
|
85
|
+
Information provided by the requester to determine if a policy can be created.
|
|
86
|
+
|
|
87
|
+
##### data?
|
|
88
|
+
|
|
89
|
+
`D`
|
|
90
|
+
|
|
91
|
+
The data to make a decision on.
|
|
92
|
+
|
|
93
|
+
##### action?
|
|
94
|
+
|
|
95
|
+
`string`
|
|
96
|
+
|
|
97
|
+
Optional action to make a decision on, if not provided, the enforcer will evaluate all actions in the duty.
|
|
98
|
+
|
|
99
|
+
#### Returns
|
|
100
|
+
|
|
101
|
+
`Promise`\<`boolean`\>
|
|
102
|
+
|
|
103
|
+
Whether the obligations were successfully enforced.
|
|
104
|
+
|
|
105
|
+
#### Implementation of
|
|
106
|
+
|
|
107
|
+
`IPolicyObligationEnforcer.enforce`
|
|
@@ -56,7 +56,7 @@ The class name of the component.
|
|
|
56
56
|
|
|
57
57
|
### retrieve()
|
|
58
58
|
|
|
59
|
-
> **retrieve**\<`D`\>(`policy`, `accessMode`, `data?`): `Promise`\<\{\[`id`: `string`\]: `IJsonLdNodeObject`; \} \| `undefined`\>
|
|
59
|
+
> **retrieve**\<`D`\>(`policy`, `accessMode`, `data?`, `action?`): `Promise`\<\{\[`id`: `string`\]: `IJsonLdNodeObject`; \} \| `undefined`\>
|
|
60
60
|
|
|
61
61
|
Retrieve information from the sources.
|
|
62
62
|
|
|
@@ -86,6 +86,12 @@ The access mode to use for the retrieval.
|
|
|
86
86
|
|
|
87
87
|
The data to process.
|
|
88
88
|
|
|
89
|
+
##### action?
|
|
90
|
+
|
|
91
|
+
`string`
|
|
92
|
+
|
|
93
|
+
The action to get any additional information for.
|
|
94
|
+
|
|
89
95
|
#### Returns
|
|
90
96
|
|
|
91
97
|
`Promise`\<\{\[`id`: `string`\]: `IJsonLdNodeObject`; \} \| `undefined`\>
|