@twin.org/rights-management-plugins 0.0.3-next.9 → 0.9.0
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/README.md +11 -3
- package/dist/es/index.js +20 -10
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IAutomationPolicyExecutionActionConfig.js +4 -0
- package/dist/es/models/IAutomationPolicyExecutionActionConfig.js.map +1 -0
- package/dist/es/models/IAutomationPolicyExecutionActionConstructorOptions.js +2 -0
- package/dist/es/models/IAutomationPolicyExecutionActionConstructorOptions.js.map +1 -0
- package/dist/es/models/{IExamplePolicyArbiterConstructorOptions.js → IDefaultPolicyArbiterConfig.js} +1 -1
- package/dist/es/models/IDefaultPolicyArbiterConfig.js.map +1 -0
- package/dist/es/models/{IExamplePolicyRequesterConstructorOptions.js → IDefaultPolicyArbiterConstructorOptions.js} +1 -1
- package/dist/es/models/IDefaultPolicyArbiterConstructorOptions.js.map +1 -0
- package/dist/es/models/{IExamplePolicyEnforcementProcessorConstructorOptions.js → IDefaultPolicyEnforcementProcessorConstructorOptions.js} +1 -1
- package/dist/es/models/IDefaultPolicyEnforcementProcessorConstructorOptions.js.map +1 -0
- package/dist/es/models/IIdentityPolicyInformationSourceConstructorOptions.js.map +1 -1
- package/dist/es/models/IIdentityProfilePolicyInformationSourceConstructorOptions.js +4 -0
- package/dist/es/models/IIdentityProfilePolicyInformationSourceConstructorOptions.js.map +1 -0
- package/dist/es/models/ILoggingPolicyExecutionActionConfig.js.map +1 -1
- package/dist/es/models/ILoggingPolicyExecutionActionConstructorOptions.js.map +1 -1
- package/dist/es/models/{IExampleDataAccessHandlerConstructorOptions.js → IPassThroughPolicyArbiterConstructorOptions.js} +1 -1
- package/dist/es/models/IPassThroughPolicyArbiterConstructorOptions.js.map +1 -0
- package/dist/es/models/IPassThroughPolicyEnforcementProcessorConstructorOptions.js +4 -0
- package/dist/es/models/IPassThroughPolicyEnforcementProcessorConstructorOptions.js.map +1 -0
- package/dist/es/models/IPassThroughPolicyNegotiatorConstructorOptions.js +4 -0
- package/dist/es/models/IPassThroughPolicyNegotiatorConstructorOptions.js.map +1 -0
- package/dist/es/models/IPassThroughPolicyObligationEnforcerConstructorOptions.js +4 -0
- package/dist/es/models/IPassThroughPolicyObligationEnforcerConstructorOptions.js.map +1 -0
- package/dist/es/models/{IExamplePolicyNegotiatorConstructorOptions.js → IPassThroughPolicyRequesterConstructorOptions.js} +1 -1
- package/dist/es/models/IPassThroughPolicyRequesterConstructorOptions.js.map +1 -0
- package/dist/es/models/IStaticPolicyInformationSource.js.map +1 -1
- package/dist/es/models/IStaticPolicyInformationSourceConstructorOptions.js.map +1 -1
- package/dist/es/policyArbiters/defaultPolicyArbiter.js +1790 -0
- package/dist/es/policyArbiters/defaultPolicyArbiter.js.map +1 -0
- package/dist/es/policyArbiters/passThroughPolicyArbiter.js +59 -0
- package/dist/es/policyArbiters/passThroughPolicyArbiter.js.map +1 -0
- package/dist/es/policyEnforcementProcessor/defaultPolicyEnforcementProcessor.js +147 -0
- package/dist/es/policyEnforcementProcessor/defaultPolicyEnforcementProcessor.js.map +1 -0
- package/dist/es/policyEnforcementProcessor/passThroughPolicyEnforcementProcessor.js +54 -0
- package/dist/es/policyEnforcementProcessor/passThroughPolicyEnforcementProcessor.js.map +1 -0
- package/dist/es/policyExecutionActions/automationPolicyExecutionAction.js +77 -0
- package/dist/es/policyExecutionActions/automationPolicyExecutionAction.js.map +1 -0
- package/dist/es/policyExecutionActions/loggingPolicyExecutionAction.js +22 -18
- package/dist/es/policyExecutionActions/loggingPolicyExecutionAction.js.map +1 -1
- package/dist/es/policyInformationSources/identityPolicyInformationSource.js +44 -32
- package/dist/es/policyInformationSources/identityPolicyInformationSource.js.map +1 -1
- package/dist/es/policyInformationSources/identityProfilePolicyInformationSource.js +112 -0
- package/dist/es/policyInformationSources/identityProfilePolicyInformationSource.js.map +1 -0
- package/dist/es/policyInformationSources/staticPolicyInformationSource.js +18 -16
- package/dist/es/policyInformationSources/staticPolicyInformationSource.js.map +1 -1
- package/dist/es/policyNegotiators/passThroughPolicyNegotiator.js +88 -0
- package/dist/es/policyNegotiators/passThroughPolicyNegotiator.js.map +1 -0
- package/dist/es/policyObligationEnforcers/passThroughPolicyObligationEnforcer.js +56 -0
- package/dist/es/policyObligationEnforcers/passThroughPolicyObligationEnforcer.js.map +1 -0
- package/dist/es/policyRequesters/passThroughPolicyRequester.js +103 -0
- package/dist/es/policyRequesters/passThroughPolicyRequester.js.map +1 -0
- package/dist/types/index.d.ts +20 -10
- package/dist/types/models/IAutomationPolicyExecutionActionConfig.d.ts +9 -0
- package/dist/types/models/IAutomationPolicyExecutionActionConstructorOptions.d.ts +15 -0
- package/dist/types/models/IDefaultPolicyArbiterConfig.d.ts +10 -0
- package/dist/types/models/IDefaultPolicyArbiterConstructorOptions.d.ts +19 -0
- package/dist/types/models/IDefaultPolicyEnforcementProcessorConstructorOptions.d.ts +9 -0
- package/dist/types/models/IIdentityPolicyInformationSourceConstructorOptions.d.ts +0 -1
- package/dist/types/models/IIdentityProfilePolicyInformationSourceConstructorOptions.d.ts +14 -0
- package/dist/types/models/ILoggingPolicyExecutionActionConfig.d.ts +2 -2
- package/dist/types/models/ILoggingPolicyExecutionActionConstructorOptions.d.ts +0 -1
- package/dist/types/models/IPassThroughPolicyArbiterConstructorOptions.d.ts +9 -0
- package/dist/types/models/IPassThroughPolicyEnforcementProcessorConstructorOptions.d.ts +9 -0
- package/dist/types/models/IPassThroughPolicyNegotiatorConstructorOptions.d.ts +9 -0
- package/dist/types/models/IPassThroughPolicyObligationEnforcerConstructorOptions.d.ts +9 -0
- package/dist/types/models/IPassThroughPolicyRequesterConstructorOptions.d.ts +9 -0
- package/dist/types/models/IStaticPolicyInformationSource.d.ts +8 -5
- package/dist/types/models/IStaticPolicyInformationSourceConstructorOptions.d.ts +0 -1
- package/dist/types/policyArbiters/defaultPolicyArbiter.d.ts +38 -0
- package/dist/types/policyArbiters/passThroughPolicyArbiter.d.ts +32 -0
- package/dist/types/policyEnforcementProcessor/defaultPolicyEnforcementProcessor.d.ts +32 -0
- package/dist/types/policyEnforcementProcessor/passThroughPolicyEnforcementProcessor.d.ts +32 -0
- package/dist/types/policyExecutionActions/automationPolicyExecutionAction.d.ts +45 -0
- package/dist/types/policyExecutionActions/loggingPolicyExecutionAction.d.ts +6 -18
- package/dist/types/policyInformationSources/identityPolicyInformationSource.d.ts +5 -6
- package/dist/types/policyInformationSources/identityProfilePolicyInformationSource.d.ts +31 -0
- package/dist/types/policyInformationSources/staticPolicyInformationSource.d.ts +5 -6
- package/dist/types/policyNegotiators/passThroughPolicyNegotiator.d.ts +47 -0
- package/dist/types/policyObligationEnforcers/passThroughPolicyObligationEnforcer.d.ts +32 -0
- package/dist/types/policyRequesters/passThroughPolicyRequester.d.ts +48 -0
- package/docs/changelog.md +1230 -10
- package/docs/examples.md +295 -1
- package/docs/reference/classes/AutomationPolicyExecutionAction.md +143 -0
- package/docs/reference/classes/DefaultPolicyArbiter.md +113 -0
- package/docs/reference/classes/DefaultPolicyEnforcementProcessor.md +107 -0
- package/docs/reference/classes/IdentityPolicyInformationSource.md +14 -14
- package/docs/reference/classes/IdentityProfilePolicyInformationSource.md +103 -0
- package/docs/reference/classes/LoggingPolicyExecutionAction.md +20 -20
- package/docs/reference/classes/PassThroughPolicyArbiter.md +103 -0
- package/docs/reference/classes/PassThroughPolicyEnforcementProcessor.md +107 -0
- package/docs/reference/classes/{ExamplePolicyNegotiator.md → PassThroughPolicyNegotiator.md} +27 -21
- package/docs/reference/classes/PassThroughPolicyObligationEnforcer.md +109 -0
- package/docs/reference/classes/{ExamplePolicyRequester.md → PassThroughPolicyRequester.md} +22 -40
- package/docs/reference/classes/StaticPolicyInformationSource.md +15 -15
- package/docs/reference/index.md +20 -10
- package/docs/reference/interfaces/IAutomationPolicyExecutionActionConfig.md +11 -0
- package/docs/reference/interfaces/IAutomationPolicyExecutionActionConstructorOptions.md +25 -0
- package/docs/reference/interfaces/IDefaultPolicyArbiterConfig.md +17 -0
- package/docs/reference/interfaces/IDefaultPolicyArbiterConstructorOptions.md +33 -0
- package/docs/reference/interfaces/IDefaultPolicyEnforcementProcessorConstructorOptions.md +11 -0
- package/docs/reference/interfaces/IIdentityPolicyInformationSourceConstructorOptions.md +4 -10
- package/docs/reference/interfaces/IIdentityProfilePolicyInformationSourceConstructorOptions.md +25 -0
- package/docs/reference/interfaces/ILoggingPolicyExecutionActionConfig.md +9 -9
- package/docs/reference/interfaces/ILoggingPolicyExecutionActionConstructorOptions.md +4 -10
- package/docs/reference/interfaces/IPassThroughPolicyArbiterConstructorOptions.md +11 -0
- package/docs/reference/interfaces/IPassThroughPolicyEnforcementProcessorConstructorOptions.md +11 -0
- package/docs/reference/interfaces/IPassThroughPolicyNegotiatorConstructorOptions.md +11 -0
- package/docs/reference/interfaces/IPassThroughPolicyObligationEnforcerConstructorOptions.md +11 -0
- package/docs/reference/interfaces/IPassThroughPolicyRequesterConstructorOptions.md +11 -0
- package/docs/reference/interfaces/IStaticPolicyInformationSource.md +21 -6
- package/docs/reference/interfaces/IStaticPolicyInformationSourceConfig.md +2 -2
- package/docs/reference/interfaces/IStaticPolicyInformationSourceConstructorOptions.md +4 -10
- package/locales/en.json +65 -6
- package/package.json +14 -11
- package/dist/es/dataAccessHandlers/examplePolicyRequester.js +0 -82
- package/dist/es/dataAccessHandlers/examplePolicyRequester.js.map +0 -1
- package/dist/es/models/IExampleDataAccessHandlerConstructorOptions.js.map +0 -1
- package/dist/es/models/IExamplePolicyArbiterConstructorOptions.js.map +0 -1
- package/dist/es/models/IExamplePolicyEnforcementProcessorConstructorOptions.js.map +0 -1
- package/dist/es/models/IExamplePolicyNegotiatorConstructorOptions.js.map +0 -1
- package/dist/es/models/IExamplePolicyRequesterConstructorOptions.js.map +0 -1
- package/dist/es/policyArbiters/examplePolicyArbiter.js +0 -50
- package/dist/es/policyArbiters/examplePolicyArbiter.js.map +0 -1
- package/dist/es/policyEnforcementProcessor/examplePolicyEnforcementProcessor.js +0 -42
- package/dist/es/policyEnforcementProcessor/examplePolicyEnforcementProcessor.js.map +0 -1
- package/dist/es/policyNegotiators/examplePolicyNegotiator.js +0 -61
- package/dist/es/policyNegotiators/examplePolicyNegotiator.js.map +0 -1
- package/dist/es/policyRequesters/examplePolicyRequester.js +0 -69
- package/dist/es/policyRequesters/examplePolicyRequester.js.map +0 -1
- package/dist/types/dataAccessHandlers/examplePolicyRequester.d.ts +0 -68
- package/dist/types/models/IExampleDataAccessHandlerConstructorOptions.d.ts +0 -10
- package/dist/types/models/IExamplePolicyArbiterConstructorOptions.d.ts +0 -10
- package/dist/types/models/IExamplePolicyEnforcementProcessorConstructorOptions.d.ts +0 -10
- package/dist/types/models/IExamplePolicyNegotiatorConstructorOptions.d.ts +0 -10
- package/dist/types/models/IExamplePolicyRequesterConstructorOptions.d.ts +0 -10
- package/dist/types/policyArbiters/examplePolicyArbiter.d.ts +0 -36
- package/dist/types/policyEnforcementProcessor/examplePolicyEnforcementProcessor.d.ts +0 -29
- package/dist/types/policyNegotiators/examplePolicyNegotiator.d.ts +0 -45
- package/dist/types/policyRequesters/examplePolicyRequester.d.ts +0 -53
- package/docs/reference/classes/ExampleDataAccessHandler.md +0 -243
- package/docs/reference/classes/ExamplePolicyArbiter.md +0 -121
- package/docs/reference/classes/ExamplePolicyEnforcementProcessor.md +0 -101
- package/docs/reference/interfaces/IExampleDataAccessHandlerConstructorOptions.md +0 -17
- package/docs/reference/interfaces/IExamplePolicyArbiterConstructorOptions.md +0 -17
- package/docs/reference/interfaces/IExamplePolicyEnforcementProcessorConstructorOptions.md +0 -17
- package/docs/reference/interfaces/IExamplePolicyNegotiatorConstructorOptions.md +0 -17
- package/docs/reference/interfaces/IExamplePolicyRequesterConstructorOptions.md +0 -17
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { IPolicyLocator, PolicyInformationAccessMode } from "@twin.org/rights-management-models";
|
|
1
|
+
import type { IRightsManagementInformation, PolicyInformationAccessMode } from "@twin.org/rights-management-models";
|
|
3
2
|
/**
|
|
4
3
|
* Configuration for the Static Policy Information Source Component.
|
|
5
4
|
*/
|
|
@@ -10,11 +9,15 @@ export interface IStaticPolicyInformationSource {
|
|
|
10
9
|
accessMode: PolicyInformationAccessMode;
|
|
11
10
|
/**
|
|
12
11
|
* Information is only provided for the specified locator combination.
|
|
13
|
-
* If undefined is provided matches all resources.
|
|
14
12
|
*/
|
|
15
|
-
matchLocators?:
|
|
13
|
+
matchLocators?: {
|
|
14
|
+
assignee?: string;
|
|
15
|
+
assigner?: string;
|
|
16
|
+
target?: string;
|
|
17
|
+
action?: string;
|
|
18
|
+
}[];
|
|
16
19
|
/**
|
|
17
20
|
* The objects containing the information.
|
|
18
21
|
*/
|
|
19
|
-
objects:
|
|
22
|
+
objects: IRightsManagementInformation;
|
|
20
23
|
}
|
|
@@ -5,7 +5,6 @@ import type { IStaticPolicyInformationSourceConfig } from "./IStaticPolicyInform
|
|
|
5
5
|
export interface IStaticPolicyInformationSourceConstructorOptions {
|
|
6
6
|
/**
|
|
7
7
|
* The logging component for logging policy source.
|
|
8
|
-
* @default logging
|
|
9
8
|
*/
|
|
10
9
|
loggingComponentType?: string;
|
|
11
10
|
/**
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type IPolicyArbiter, type IPolicyDecision, type IRightsManagementInformation } from "@twin.org/rights-management-models";
|
|
2
|
+
import type { IDataspaceProtocolAgreement } from "@twin.org/standards-dataspace-protocol";
|
|
3
|
+
import { type OdrlActionType } 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
|
+
* ODRL profiles whose custom vocabulary this arbiter understands and supports.
|
|
15
|
+
* Any policy declaring a profile not in this set will be rejected.
|
|
16
|
+
* Add a new entry here when support for an additional profile is implemented.
|
|
17
|
+
*/
|
|
18
|
+
static readonly SUPPORTED_PROFILES: ReadonlySet<string>;
|
|
19
|
+
/**
|
|
20
|
+
* Create a new instance of DefaultPolicyArbiter.
|
|
21
|
+
* @param options The options for the default policy arbiter.
|
|
22
|
+
*/
|
|
23
|
+
constructor(options?: IDefaultPolicyArbiterConstructorOptions);
|
|
24
|
+
/**
|
|
25
|
+
* Returns the class name of the component.
|
|
26
|
+
* @returns The class name of the component.
|
|
27
|
+
*/
|
|
28
|
+
className(): string;
|
|
29
|
+
/**
|
|
30
|
+
* Makes decisions regarding policy access to data.
|
|
31
|
+
* @param agreement The agreement to evaluate.
|
|
32
|
+
* @param information Information provided by the requester to determine if a policy can be created.
|
|
33
|
+
* @param data The data to make a decision on.
|
|
34
|
+
* @param action Optional action to make a decision on, if not provided, the arbiter will evaluate all actions in the agreement.
|
|
35
|
+
* @returns The decisions about access to the data.
|
|
36
|
+
*/
|
|
37
|
+
decide<D = unknown>(agreement: IDataspaceProtocolAgreement, information?: IRightsManagementInformation, data?: D, action?: OdrlActionType | string): Promise<IPolicyDecision[]>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type IPolicyArbiter, type IPolicyDecision, type IRightsManagementInformation } from "@twin.org/rights-management-models";
|
|
2
|
+
import type { IDataspaceProtocolAgreement } from "@twin.org/standards-dataspace-protocol";
|
|
3
|
+
import type { OdrlActionType } from "@twin.org/standards-w3c-odrl";
|
|
4
|
+
import type { IPassThroughPolicyArbiterConstructorOptions } from "../models/IPassThroughPolicyArbiterConstructorOptions.js";
|
|
5
|
+
/**
|
|
6
|
+
* Pass Through Policy Arbiter.
|
|
7
|
+
*/
|
|
8
|
+
export declare class PassThroughPolicyArbiter implements IPolicyArbiter {
|
|
9
|
+
/**
|
|
10
|
+
* The class name of the Pass Through Policy Arbiter.
|
|
11
|
+
*/
|
|
12
|
+
static readonly CLASS_NAME: string;
|
|
13
|
+
/**
|
|
14
|
+
* Create a new instance of PassThroughPolicyArbiter.
|
|
15
|
+
* @param options The options for the pass through policy arbiter.
|
|
16
|
+
*/
|
|
17
|
+
constructor(options?: IPassThroughPolicyArbiterConstructorOptions);
|
|
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: IDataspaceProtocolAgreement, information?: IRightsManagementInformation, data?: D, action?: OdrlActionType | string): Promise<IPolicyDecision[]>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type IPolicyDecision, type IPolicyEnforcementProcessor } from "@twin.org/rights-management-models";
|
|
2
|
+
import type { IDataspaceProtocolAgreement } from "@twin.org/standards-dataspace-protocol";
|
|
3
|
+
import type { OdrlActionType } from "@twin.org/standards-w3c-odrl";
|
|
4
|
+
import type { IDefaultPolicyEnforcementProcessorConstructorOptions } from "../models/IDefaultPolicyEnforcementProcessorConstructorOptions.js";
|
|
5
|
+
/**
|
|
6
|
+
* Default Policy Enforcement Processor.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DefaultPolicyEnforcementProcessor implements IPolicyEnforcementProcessor {
|
|
9
|
+
/**
|
|
10
|
+
* The class name of the Default Policy Enforcement Processor.
|
|
11
|
+
*/
|
|
12
|
+
static readonly CLASS_NAME: string;
|
|
13
|
+
/**
|
|
14
|
+
* Create a new instance of DefaultPolicyEnforcementProcessor.
|
|
15
|
+
* @param options The options for the default policy enforcement processor.
|
|
16
|
+
*/
|
|
17
|
+
constructor(options?: IDefaultPolicyEnforcementProcessorConstructorOptions);
|
|
18
|
+
/**
|
|
19
|
+
* Returns the class name of the component.
|
|
20
|
+
* @returns The class name of the component.
|
|
21
|
+
*/
|
|
22
|
+
className(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Process the response from the policy decision point.
|
|
25
|
+
* @param agreement The agreement to process.
|
|
26
|
+
* @param decisions The decisions made by the policy decision point.
|
|
27
|
+
* @param data The data to process.
|
|
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 data after processing.
|
|
30
|
+
*/
|
|
31
|
+
process<D = unknown, R = D>(agreement: IDataspaceProtocolAgreement, decisions: IPolicyDecision[], data?: D, action?: OdrlActionType | string): Promise<R>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type IPolicyDecision, type IPolicyEnforcementProcessor } from "@twin.org/rights-management-models";
|
|
2
|
+
import type { IDataspaceProtocolAgreement } from "@twin.org/standards-dataspace-protocol";
|
|
3
|
+
import type { OdrlActionType } from "@twin.org/standards-w3c-odrl";
|
|
4
|
+
import type { IPassThroughPolicyEnforcementProcessorConstructorOptions } from "../models/IPassThroughPolicyEnforcementProcessorConstructorOptions.js";
|
|
5
|
+
/**
|
|
6
|
+
* Pass Through Policy Enforcement Processor.
|
|
7
|
+
*/
|
|
8
|
+
export declare class PassThroughPolicyEnforcementProcessor implements IPolicyEnforcementProcessor {
|
|
9
|
+
/**
|
|
10
|
+
* The class name of the Pass Through Policy Enforcement Processor.
|
|
11
|
+
*/
|
|
12
|
+
static readonly CLASS_NAME: string;
|
|
13
|
+
/**
|
|
14
|
+
* Create a new instance of PassThroughPolicyEnforcementProcessor.
|
|
15
|
+
* @param options The options for the pass through policy enforcement processor.
|
|
16
|
+
*/
|
|
17
|
+
constructor(options?: IPassThroughPolicyEnforcementProcessorConstructorOptions);
|
|
18
|
+
/**
|
|
19
|
+
* Returns the class name of the component.
|
|
20
|
+
* @returns The class name of the component.
|
|
21
|
+
*/
|
|
22
|
+
className(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Process the response from the policy decision point.
|
|
25
|
+
* @param agreement The agreement to process.
|
|
26
|
+
* @param decisions The decisions made by the policy decision point.
|
|
27
|
+
* @param data The data to process.
|
|
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 data after processing.
|
|
30
|
+
*/
|
|
31
|
+
process<D = unknown, R = D>(agreement: IDataspaceProtocolAgreement, decisions: IPolicyDecision[], data?: D, action?: OdrlActionType | string): Promise<R>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type IPolicyDecision, type IPolicyExecutionAction, type IRightsManagementPolicy, PolicyDecisionStage } from "@twin.org/rights-management-models";
|
|
2
|
+
import { OdrlActionType } from "@twin.org/standards-w3c-odrl";
|
|
3
|
+
import type { IAutomationPolicyExecutionActionConstructorOptions } from "../models/IAutomationPolicyExecutionActionConstructorOptions.js";
|
|
4
|
+
/**
|
|
5
|
+
* Automation Policy Execution Action to execute automation policies.
|
|
6
|
+
*/
|
|
7
|
+
export declare class AutomationPolicyExecutionAction implements IPolicyExecutionAction {
|
|
8
|
+
/**
|
|
9
|
+
* The class name of the Automation Policy Execution Action.
|
|
10
|
+
*/
|
|
11
|
+
static readonly CLASS_NAME: string;
|
|
12
|
+
/**
|
|
13
|
+
* The before automation trigger name.
|
|
14
|
+
*/
|
|
15
|
+
static readonly BEFORE_TRIGGER_NAME: string;
|
|
16
|
+
/**
|
|
17
|
+
* The after automation trigger name.
|
|
18
|
+
*/
|
|
19
|
+
static readonly AFTER_TRIGGER_NAME: string;
|
|
20
|
+
/**
|
|
21
|
+
* Create a new instance of AutomationPolicyExecutionAction.
|
|
22
|
+
* @param options The options for the automation policy execution action.
|
|
23
|
+
*/
|
|
24
|
+
constructor(options?: IAutomationPolicyExecutionActionConstructorOptions);
|
|
25
|
+
/**
|
|
26
|
+
* Returns the class name of the component.
|
|
27
|
+
* @returns The class name of the component.
|
|
28
|
+
*/
|
|
29
|
+
className(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Which stages should the action be executed at.
|
|
32
|
+
* @returns List of stages.
|
|
33
|
+
*/
|
|
34
|
+
supportedStages(): PolicyDecisionStage[];
|
|
35
|
+
/**
|
|
36
|
+
* Execute function type for policy actions.
|
|
37
|
+
* @param policy The policy that applied to the data.
|
|
38
|
+
* @param decisions The decisions made by the PDP.
|
|
39
|
+
* @param data The data to process.
|
|
40
|
+
* @param action Optional action to make a decision on, if not provided, the arbiter will evaluate all actions in the agreement.
|
|
41
|
+
* @param stage The stage of the policy decision.
|
|
42
|
+
* @returns A promise that resolves when the action is complete.
|
|
43
|
+
*/
|
|
44
|
+
execute<D = unknown>(policy: IRightsManagementPolicy, decisions: IPolicyDecision[], data: D | undefined, action: OdrlActionType | string | undefined, stage: PolicyDecisionStage): Promise<void>;
|
|
45
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type IPolicyDecision, type IPolicyExecutionAction, type
|
|
2
|
-
import type {
|
|
1
|
+
import { type IPolicyDecision, type IPolicyExecutionAction, type IRightsManagementPolicy, PolicyDecisionStage } from "@twin.org/rights-management-models";
|
|
2
|
+
import type { OdrlActionType } 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.
|
|
@@ -9,18 +9,6 @@ export declare class LoggingPolicyExecutionAction implements IPolicyExecutionAct
|
|
|
9
9
|
* The class name of the Logging Policy Execution Action.
|
|
10
10
|
*/
|
|
11
11
|
static readonly CLASS_NAME: string;
|
|
12
|
-
/**
|
|
13
|
-
* Whether to include the data in the log.
|
|
14
|
-
*/
|
|
15
|
-
private readonly _includeData;
|
|
16
|
-
/**
|
|
17
|
-
* Whether to include the policies in the log.
|
|
18
|
-
*/
|
|
19
|
-
private readonly _includePolicies;
|
|
20
|
-
/**
|
|
21
|
-
* Whether to include the decisions in the log.
|
|
22
|
-
*/
|
|
23
|
-
private readonly _includeDecisions;
|
|
24
12
|
/**
|
|
25
13
|
* Create a new instance of LoggingPolicyExecutionAction.
|
|
26
14
|
* @param options The options for the logging policy execution action.
|
|
@@ -38,12 +26,12 @@ export declare class LoggingPolicyExecutionAction implements IPolicyExecutionAct
|
|
|
38
26
|
supportedStages(): PolicyDecisionStage[];
|
|
39
27
|
/**
|
|
40
28
|
* Execute function type for policy actions.
|
|
41
|
-
* @param
|
|
42
|
-
* @param locator The locator to find relevant policies.
|
|
43
|
-
* @param policies The policies that apply to the data.
|
|
29
|
+
* @param policy The policy that applied to the data.
|
|
44
30
|
* @param decisions The decisions made by the PDP.
|
|
45
31
|
* @param data The data to process.
|
|
32
|
+
* @param action Optional action to make a decision on, if not provided, the arbiter will evaluate all actions in the agreement.
|
|
33
|
+
* @param stage The stage of the policy decision.
|
|
46
34
|
* @returns A promise that resolves when the action is complete.
|
|
47
35
|
*/
|
|
48
|
-
execute<D = unknown>(
|
|
36
|
+
execute<D = unknown>(policy: IRightsManagementPolicy, decisions: IPolicyDecision[], data: D | undefined, action: OdrlActionType | string | undefined, stage: PolicyDecisionStage): Promise<void>;
|
|
49
37
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import
|
|
3
|
-
import type { IOdrlPolicy } from "@twin.org/standards-w3c-odrl";
|
|
1
|
+
import { type IPolicyInformationSource, type IRightsManagementInformation, type IRightsManagementPolicy, PolicyInformationAccessMode } from "@twin.org/rights-management-models";
|
|
2
|
+
import type { OdrlActionType } from "@twin.org/standards-w3c-odrl";
|
|
4
3
|
import type { IIdentityPolicyInformationSourceConstructorOptions } from "../models/IIdentityPolicyInformationSourceConstructorOptions.js";
|
|
5
4
|
/**
|
|
6
5
|
* Policy information source which retrieves the identity information.
|
|
@@ -22,11 +21,11 @@ export declare class IdentityPolicyInformationSource implements IPolicyInformati
|
|
|
22
21
|
className(): string;
|
|
23
22
|
/**
|
|
24
23
|
* Retrieve information from the sources.
|
|
25
|
-
* @param
|
|
24
|
+
* @param policy The policy to retrieve information for if available.
|
|
26
25
|
* @param accessMode The access mode to use for the retrieval.
|
|
27
|
-
* @param policies The policies that apply to the data.
|
|
28
26
|
* @param data The data to process.
|
|
27
|
+
* @param action The action that was evaluated.
|
|
29
28
|
* @returns The objects containing relevant information or undefined if nothing relevant is found.
|
|
30
29
|
*/
|
|
31
|
-
retrieve<D = unknown>(
|
|
30
|
+
retrieve<D = unknown>(policy: IRightsManagementPolicy | undefined, accessMode: PolicyInformationAccessMode, data?: D, action?: OdrlActionType | string): Promise<IRightsManagementInformation | undefined>;
|
|
32
31
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PolicyInformationAccessMode, type IPolicyInformationSource, type IRightsManagementInformation, type IRightsManagementPolicy } from "@twin.org/rights-management-models";
|
|
2
|
+
import type { OdrlActionType } from "@twin.org/standards-w3c-odrl";
|
|
3
|
+
import type { IIdentityProfilePolicyInformationSourceConstructorOptions } from "../models/IIdentityProfilePolicyInformationSourceConstructorOptions.js";
|
|
4
|
+
/**
|
|
5
|
+
* Policy information source which retrieves identity profile information.
|
|
6
|
+
*/
|
|
7
|
+
export declare class IdentityProfilePolicyInformationSource implements IPolicyInformationSource {
|
|
8
|
+
/**
|
|
9
|
+
* The class name of the Identity Profile Policy Information Source.
|
|
10
|
+
*/
|
|
11
|
+
static readonly CLASS_NAME: string;
|
|
12
|
+
/**
|
|
13
|
+
* Create a new instance of IdentityProfilePolicyInformationSource.
|
|
14
|
+
* @param options The options for the identity profile policy source.
|
|
15
|
+
*/
|
|
16
|
+
constructor(options?: IIdentityProfilePolicyInformationSourceConstructorOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Returns the class name of the component.
|
|
19
|
+
* @returns The class name of the component.
|
|
20
|
+
*/
|
|
21
|
+
className(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieve information from the sources.
|
|
24
|
+
* @param policy The policy to retrieve information for if available.
|
|
25
|
+
* @param accessMode The access mode to use for the retrieval.
|
|
26
|
+
* @param data The data to process.
|
|
27
|
+
* @param action The action that was evaluated.
|
|
28
|
+
* @returns The objects containing relevant information or undefined if nothing relevant is found.
|
|
29
|
+
*/
|
|
30
|
+
retrieve<D = unknown>(policy: IRightsManagementPolicy | undefined, accessMode: PolicyInformationAccessMode, data?: D, action?: OdrlActionType | string): Promise<IRightsManagementInformation | undefined>;
|
|
31
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import
|
|
3
|
-
import type { IOdrlPolicy } from "@twin.org/standards-w3c-odrl";
|
|
1
|
+
import { PolicyInformationAccessMode, type IPolicyInformationSource, type IRightsManagementInformation, type IRightsManagementPolicy } from "@twin.org/rights-management-models";
|
|
2
|
+
import type { OdrlActionType } from "@twin.org/standards-w3c-odrl";
|
|
4
3
|
import type { IStaticPolicyInformationSource } from "../models/IStaticPolicyInformationSource.js";
|
|
5
4
|
import type { IStaticPolicyInformationSourceConstructorOptions } from "../models/IStaticPolicyInformationSourceConstructorOptions.js";
|
|
6
5
|
/**
|
|
@@ -23,13 +22,13 @@ export declare class StaticPolicyInformationSource implements IPolicyInformation
|
|
|
23
22
|
className(): string;
|
|
24
23
|
/**
|
|
25
24
|
* Retrieve information from the sources.
|
|
26
|
-
* @param
|
|
25
|
+
* @param policy The policy to retrieve information for if available.
|
|
27
26
|
* @param accessMode The access mode to use for the retrieval.
|
|
28
|
-
* @param policies The policies that apply to the data.
|
|
29
27
|
* @param data The data to process.
|
|
28
|
+
* @param action The action to get any additional information for.
|
|
30
29
|
* @returns The objects containing relevant information or undefined if nothing relevant is found.
|
|
31
30
|
*/
|
|
32
|
-
retrieve<D = unknown>(
|
|
31
|
+
retrieve<D = unknown>(policy: IRightsManagementPolicy | undefined, accessMode: PolicyInformationAccessMode, data?: D, action?: OdrlActionType | string): Promise<IRightsManagementInformation | undefined>;
|
|
33
32
|
/**
|
|
34
33
|
* Add static policy information.
|
|
35
34
|
* @param info The static policy information to add.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type IPolicyNegotiator, type IRightsManagementInformation } from "@twin.org/rights-management-models";
|
|
2
|
+
import type { IDataspaceProtocolAgreement, IDataspaceProtocolOffer } from "@twin.org/standards-dataspace-protocol";
|
|
3
|
+
import { type IOdrlParty } from "@twin.org/standards-w3c-odrl";
|
|
4
|
+
import type { IPassThroughPolicyNegotiatorConstructorOptions } from "../models/IPassThroughPolicyNegotiatorConstructorOptions.js";
|
|
5
|
+
/**
|
|
6
|
+
* Pass Through Policy Negotiator.
|
|
7
|
+
*/
|
|
8
|
+
export declare class PassThroughPolicyNegotiator implements IPolicyNegotiator {
|
|
9
|
+
/**
|
|
10
|
+
* The class name of the Pass Through Policy Negotiator.
|
|
11
|
+
*/
|
|
12
|
+
static readonly CLASS_NAME: string;
|
|
13
|
+
/**
|
|
14
|
+
* Create a new instance of PassThroughPolicyNegotiator.
|
|
15
|
+
* @param options The options for the pass through policy negotiator.
|
|
16
|
+
*/
|
|
17
|
+
constructor(options?: IPassThroughPolicyNegotiatorConstructorOptions);
|
|
18
|
+
/**
|
|
19
|
+
* Returns the class name of the component.
|
|
20
|
+
* @returns The class name of the component.
|
|
21
|
+
*/
|
|
22
|
+
className(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Determines if the negotiator supports the given offer.
|
|
25
|
+
* @param offer The offer to check.
|
|
26
|
+
* @returns True if the negotiator supports the given offer.
|
|
27
|
+
*/
|
|
28
|
+
supportsOffer(offer: IDataspaceProtocolOffer): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Handle the offer.
|
|
31
|
+
* @param offer The offer to check.
|
|
32
|
+
* @param information Information provided by the requester to determine if a policy can be created.
|
|
33
|
+
* @returns Sets the accepted flag if it can be offered, and the interventionRequired flag if manual agreement is needed.
|
|
34
|
+
*/
|
|
35
|
+
handleOffer(offer: IDataspaceProtocolOffer, information?: IRightsManagementInformation): Promise<{
|
|
36
|
+
accepted: boolean;
|
|
37
|
+
interventionRequired: boolean;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Create an agreement based on the offer.
|
|
41
|
+
* @param offer The offer to create the agreement from.
|
|
42
|
+
* @param assignee The assignee of the agreement.
|
|
43
|
+
* @param information Information provided by the requester to aid in the creation of the agreement.
|
|
44
|
+
* @returns The agreement created from the offer or undefined if an agreement could not be created.
|
|
45
|
+
*/
|
|
46
|
+
createAgreement(offer: IDataspaceProtocolOffer, assignee: string | IOdrlParty, information?: IRightsManagementInformation): Promise<IDataspaceProtocolAgreement | undefined>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type IPolicyObligationEnforcer, type IRightsManagementInformation, type IRightsManagementPolicy } from "@twin.org/rights-management-models";
|
|
2
|
+
import type { OdrlActionType, IOdrlDuty } from "@twin.org/standards-w3c-odrl";
|
|
3
|
+
import type { IPassThroughPolicyObligationEnforcerConstructorOptions } from "../models/IPassThroughPolicyObligationEnforcerConstructorOptions.js";
|
|
4
|
+
/**
|
|
5
|
+
* Pass Through Policy Obligation Enforcer.
|
|
6
|
+
*/
|
|
7
|
+
export declare class PassThroughPolicyObligationEnforcer implements IPolicyObligationEnforcer {
|
|
8
|
+
/**
|
|
9
|
+
* The class name of the Pass Through Policy Obligation Enforcer.
|
|
10
|
+
*/
|
|
11
|
+
static readonly CLASS_NAME: string;
|
|
12
|
+
/**
|
|
13
|
+
* Create a new instance of Pass Through Policy Obligation Enforcer.
|
|
14
|
+
* @param options The options for the pass through policy obligation enforcer.
|
|
15
|
+
*/
|
|
16
|
+
constructor(options?: IPassThroughPolicyObligationEnforcerConstructorOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Returns the class name of the component.
|
|
19
|
+
* @returns The class name of the component.
|
|
20
|
+
*/
|
|
21
|
+
className(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Enforces obligations regarding policy access to data.
|
|
24
|
+
* @param policy The policy to evaluate.
|
|
25
|
+
* @param duty The duty to enforce.
|
|
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 enforcer will evaluate all actions in the duty.
|
|
29
|
+
* @returns Whether the obligations were successfully enforced.
|
|
30
|
+
*/
|
|
31
|
+
enforce<D = unknown>(policy: IRightsManagementPolicy, duty: IOdrlDuty, information?: IRightsManagementInformation, data?: D, action?: OdrlActionType | string): Promise<boolean>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type IPolicyRequester } from "@twin.org/rights-management-models";
|
|
2
|
+
import type { IDataspaceProtocolAgreement, IDataspaceProtocolOffer } from "@twin.org/standards-dataspace-protocol";
|
|
3
|
+
import type { IPassThroughPolicyRequesterConstructorOptions } from "../models/IPassThroughPolicyRequesterConstructorOptions.js";
|
|
4
|
+
/**
|
|
5
|
+
* Pass Through Policy Requester.
|
|
6
|
+
*/
|
|
7
|
+
export declare class PassThroughPolicyRequester implements IPolicyRequester {
|
|
8
|
+
/**
|
|
9
|
+
* The class name of the Pass Through Policy Requester.
|
|
10
|
+
*/
|
|
11
|
+
static readonly CLASS_NAME: string;
|
|
12
|
+
/**
|
|
13
|
+
* Create a new instance of PassThroughPolicyRequester.
|
|
14
|
+
* @param options The options for the pass through policy Requester.
|
|
15
|
+
*/
|
|
16
|
+
constructor(options?: IPassThroughPolicyRequesterConstructorOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Returns the class name of the component.
|
|
19
|
+
* @returns The class name of the component.
|
|
20
|
+
*/
|
|
21
|
+
className(): string;
|
|
22
|
+
/**
|
|
23
|
+
* A policy has been offered by a provider, let the request handler know about it.
|
|
24
|
+
* @param negotiationId The id of the negotiation.
|
|
25
|
+
* @param offer The offer sent by the provider.
|
|
26
|
+
* @returns True if the offer was accepted, false otherwise.
|
|
27
|
+
*/
|
|
28
|
+
offer(negotiationId: string, offer: IDataspaceProtocolOffer): Promise<boolean>;
|
|
29
|
+
/**
|
|
30
|
+
* A policy agreement has been sent by a provider, let the request handler know about it.
|
|
31
|
+
* @param negotiationId The id of the negotiation.
|
|
32
|
+
* @param agreement The agreement sent by the provider.
|
|
33
|
+
* @returns True if the agreement was accepted, false otherwise.
|
|
34
|
+
*/
|
|
35
|
+
agreement(negotiationId: string, agreement: IDataspaceProtocolAgreement): Promise<boolean>;
|
|
36
|
+
/**
|
|
37
|
+
* A policy finalisation has been sent by a provider, let the request handler know about it.
|
|
38
|
+
* @param negotiationId The id of the negotiation.
|
|
39
|
+
* @returns A promise that resolves when the finalisation has been processed.
|
|
40
|
+
*/
|
|
41
|
+
finalised(negotiationId: string): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* A policy termination has been sent by a provider, let the request handler know about it.
|
|
44
|
+
* @param negotiationId The id of the negotiation.
|
|
45
|
+
* @returns A promise that resolves when the termination has been processed.
|
|
46
|
+
*/
|
|
47
|
+
terminated(negotiationId: string): Promise<void>;
|
|
48
|
+
}
|