@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,7 +1,7 @@
|
|
|
1
1
|
// Copyright 2025 IOTA Stiftung.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
3
|
import { ComponentFactory, Guards, Is } from "@twin.org/core";
|
|
4
|
-
import {
|
|
4
|
+
import { OdrlPolicyHelper, PolicyInformationAccessMode } from "@twin.org/rights-management-models";
|
|
5
5
|
/**
|
|
6
6
|
* Policy information source which retrieves static information.
|
|
7
7
|
*/
|
|
@@ -25,7 +25,7 @@ export class StaticPolicyInformationSource {
|
|
|
25
25
|
* @param options The options for the logging policy source.
|
|
26
26
|
*/
|
|
27
27
|
constructor(options) {
|
|
28
|
-
this._logging = ComponentFactory.getIfExists(options?.loggingComponentType
|
|
28
|
+
this._logging = ComponentFactory.getIfExists(options?.loggingComponentType);
|
|
29
29
|
this._information = options?.config?.information ?? [];
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
@@ -37,24 +37,22 @@ export class StaticPolicyInformationSource {
|
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Retrieve information from the sources.
|
|
40
|
-
* @param
|
|
40
|
+
* @param policy The policy to retrieve information for if available.
|
|
41
41
|
* @param accessMode The access mode to use for the retrieval.
|
|
42
|
-
* @param policies The policies that apply to the data.
|
|
43
42
|
* @param data The data to process.
|
|
43
|
+
* @param action The action to get any additional information for.
|
|
44
44
|
* @returns The objects containing relevant information or undefined if nothing relevant is found.
|
|
45
45
|
*/
|
|
46
|
-
async retrieve(
|
|
47
|
-
Guards.objectValue(StaticPolicyInformationSource.CLASS_NAME, "locator", locator);
|
|
46
|
+
async retrieve(policy, accessMode, data, action) {
|
|
48
47
|
Guards.arrayOneOf(StaticPolicyInformationSource.CLASS_NAME, "accessMode", accessMode, Object.values(PolicyInformationAccessMode));
|
|
49
|
-
|
|
50
|
-
const information = [];
|
|
48
|
+
let information = {};
|
|
51
49
|
await this._logging?.log({
|
|
52
50
|
level: "info",
|
|
53
51
|
source: StaticPolicyInformationSource.CLASS_NAME,
|
|
54
52
|
ts: Date.now(),
|
|
55
53
|
message: "staticRetrieving",
|
|
56
54
|
data: {
|
|
57
|
-
|
|
55
|
+
policyId: OdrlPolicyHelper.getUid(policy) ?? "",
|
|
58
56
|
accessMode
|
|
59
57
|
}
|
|
60
58
|
});
|
|
@@ -62,9 +60,13 @@ export class StaticPolicyInformationSource {
|
|
|
62
60
|
if (info.accessMode === accessMode ||
|
|
63
61
|
accessMode === PolicyInformationAccessMode.Any ||
|
|
64
62
|
info.accessMode === PolicyInformationAccessMode.Any) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
const matchLocators = info.matchLocators;
|
|
64
|
+
if (!Is.arrayValue(matchLocators) ||
|
|
65
|
+
matchLocators.some(locator => OdrlPolicyHelper.matchPolicy(policy, locator))) {
|
|
66
|
+
information = {
|
|
67
|
+
...information,
|
|
68
|
+
...info.objects
|
|
69
|
+
};
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
}
|
|
@@ -74,12 +76,12 @@ export class StaticPolicyInformationSource {
|
|
|
74
76
|
ts: Date.now(),
|
|
75
77
|
message: "staticRetrieved",
|
|
76
78
|
data: {
|
|
77
|
-
|
|
79
|
+
policyId: OdrlPolicyHelper.getUid(policy) ?? "",
|
|
78
80
|
accessMode,
|
|
79
|
-
itemCount: information.length
|
|
81
|
+
itemCount: Object.keys(information).length
|
|
80
82
|
}
|
|
81
83
|
});
|
|
82
|
-
return information.length > 0 ? information : undefined;
|
|
84
|
+
return Object.keys(information).length > 0 ? information : undefined;
|
|
83
85
|
}
|
|
84
86
|
/**
|
|
85
87
|
* Add static policy information.
|
|
@@ -87,7 +89,7 @@ export class StaticPolicyInformationSource {
|
|
|
87
89
|
*/
|
|
88
90
|
addInformation(info) {
|
|
89
91
|
Guards.arrayOneOf(StaticPolicyInformationSource.CLASS_NAME, "info.accessMode", info.accessMode, Object.values(PolicyInformationAccessMode));
|
|
90
|
-
Guards.
|
|
92
|
+
Guards.objectValue(StaticPolicyInformationSource.CLASS_NAME, "info.objects", info.objects);
|
|
91
93
|
this._information.push(info);
|
|
92
94
|
}
|
|
93
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staticPolicyInformationSource.js","sourceRoot":"","sources":["../../../src/policyInformationSources/staticPolicyInformationSource.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"staticPolicyInformationSource.js","sourceRoot":"","sources":["../../../src/policyInformationSources/staticPolicyInformationSource.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAG9D,OAAO,EACN,gBAAgB,EAChB,2BAA2B,EAI3B,MAAM,oCAAoC,CAAC;AAK5C;;GAEG;AACH,MAAM,OAAO,6BAA6B;IACzC;;OAEG;IACI,MAAM,CAAU,UAAU,mCAAmD;IAEpF;;;OAGG;IACc,QAAQ,CAAqB;IAE9C;;;OAGG;IACc,YAAY,CAAmC;IAEhE;;;OAGG;IACH,YAAY,OAA0D;QACrE,IAAI,CAAC,QAAQ,GAAG,gBAAgB,CAAC,WAAW,CAAoB,OAAO,EAAE,oBAAoB,CAAC,CAAC;QAC/F,IAAI,CAAC,YAAY,GAAG,OAAO,EAAE,MAAM,EAAE,WAAW,IAAI,EAAE,CAAC;IACxD,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,6BAA6B,CAAC,UAAU,CAAC;IACjD,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,QAAQ,CACpB,MAA2C,EAC3C,UAAuC,EACvC,IAAQ,EACR,MAAgC;QAEhC,MAAM,CAAC,UAAU,CAChB,6BAA6B,CAAC,UAAU,gBAExC,UAAU,EACV,MAAM,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAC1C,CAAC;QAEF,IAAI,WAAW,GAAiC,EAAE,CAAC;QAEnD,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC;YACxB,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,6BAA6B,CAAC,UAAU;YAChD,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;YACd,OAAO,EAAE,kBAAkB;YAC3B,IAAI,EAAE;gBACL,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;gBAC/C,UAAU;aACV;SACD,CAAC,CAAC;QAEH,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtC,IACC,IAAI,CAAC,UAAU,KAAK,UAAU;gBAC9B,UAAU,KAAK,2BAA2B,CAAC,GAAG;gBAC9C,IAAI,CAAC,UAAU,KAAK,2BAA2B,CAAC,GAAG,EAClD,CAAC;gBACF,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;gBACzC,IACC,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC;oBAC7B,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,gBAAgB,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAC3E,CAAC;oBACF,WAAW,GAAG;wBACb,GAAG,WAAW;wBACd,GAAG,IAAI,CAAC,OAAO;qBACf,CAAC;gBACH,CAAC;YACF,CAAC;QACF,CAAC;QAED,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC;YACxB,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,6BAA6B,CAAC,UAAU;YAChD,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;YACd,OAAO,EAAE,iBAAiB;YAC1B,IAAI,EAAE;gBACL,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;gBAC/C,UAAU;gBACV,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM;aAC1C;SACD,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;IACtE,CAAC;IAED;;;OAGG;IACI,cAAc,CAAC,IAAoC;QACzD,MAAM,CAAC,UAAU,CAChB,6BAA6B,CAAC,UAAU,qBAExC,IAAI,CAAC,UAAU,EACf,MAAM,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAC1C,CAAC;QACF,MAAM,CAAC,WAAW,CACjB,6BAA6B,CAAC,UAAU,kBAExC,IAAI,CAAC,OAAO,CACZ,CAAC;QACF,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ComponentFactory, Guards, Is } from \"@twin.org/core\";\nimport type { ILoggingComponent } from \"@twin.org/logging-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport {\n\tOdrlPolicyHelper,\n\tPolicyInformationAccessMode,\n\ttype IPolicyInformationSource,\n\ttype IRightsManagementInformation,\n\ttype IRightsManagementPolicy\n} from \"@twin.org/rights-management-models\";\nimport type { OdrlActionType } from \"@twin.org/standards-w3c-odrl\";\nimport type { IStaticPolicyInformationSource } from \"../models/IStaticPolicyInformationSource.js\";\nimport type { IStaticPolicyInformationSourceConstructorOptions } from \"../models/IStaticPolicyInformationSourceConstructorOptions.js\";\n\n/**\n * Policy information source which retrieves static information.\n */\nexport class StaticPolicyInformationSource implements IPolicyInformationSource {\n\t/**\n\t * The class name of the Static Policy Information Source.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<StaticPolicyInformationSource>();\n\n\t/**\n\t * The logging component.\n\t * @internal\n\t */\n\tprivate readonly _logging?: ILoggingComponent;\n\n\t/**\n\t * The information sources.\n\t * @internal\n\t */\n\tprivate readonly _information: IStaticPolicyInformationSource[];\n\n\t/**\n\t * Create a new instance of StaticPolicyInformationSource.\n\t * @param options The options for the logging policy source.\n\t */\n\tconstructor(options?: IStaticPolicyInformationSourceConstructorOptions) {\n\t\tthis._logging = ComponentFactory.getIfExists<ILoggingComponent>(options?.loggingComponentType);\n\t\tthis._information = options?.config?.information ?? [];\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn StaticPolicyInformationSource.CLASS_NAME;\n\t}\n\n\t/**\n\t * Retrieve information from the sources.\n\t * @param policy The policy to retrieve information for if available.\n\t * @param accessMode The access mode to use for the retrieval.\n\t * @param data The data to process.\n\t * @param action The action to get any additional information for.\n\t * @returns The objects containing relevant information or undefined if nothing relevant is found.\n\t */\n\tpublic async retrieve<D = unknown>(\n\t\tpolicy: IRightsManagementPolicy | undefined,\n\t\taccessMode: PolicyInformationAccessMode,\n\t\tdata?: D,\n\t\taction?: OdrlActionType | string\n\t): Promise<IRightsManagementInformation | undefined> {\n\t\tGuards.arrayOneOf(\n\t\t\tStaticPolicyInformationSource.CLASS_NAME,\n\t\t\tnameof(accessMode),\n\t\t\taccessMode,\n\t\t\tObject.values(PolicyInformationAccessMode)\n\t\t);\n\n\t\tlet information: IRightsManagementInformation = {};\n\n\t\tawait this._logging?.log({\n\t\t\tlevel: \"info\",\n\t\t\tsource: StaticPolicyInformationSource.CLASS_NAME,\n\t\t\tts: Date.now(),\n\t\t\tmessage: \"staticRetrieving\",\n\t\t\tdata: {\n\t\t\t\tpolicyId: OdrlPolicyHelper.getUid(policy) ?? \"\",\n\t\t\t\taccessMode\n\t\t\t}\n\t\t});\n\n\t\tfor (const info of this._information) {\n\t\t\tif (\n\t\t\t\tinfo.accessMode === accessMode ||\n\t\t\t\taccessMode === PolicyInformationAccessMode.Any ||\n\t\t\t\tinfo.accessMode === PolicyInformationAccessMode.Any\n\t\t\t) {\n\t\t\t\tconst matchLocators = info.matchLocators;\n\t\t\t\tif (\n\t\t\t\t\t!Is.arrayValue(matchLocators) ||\n\t\t\t\t\tmatchLocators.some(locator => OdrlPolicyHelper.matchPolicy(policy, locator))\n\t\t\t\t) {\n\t\t\t\t\tinformation = {\n\t\t\t\t\t\t...information,\n\t\t\t\t\t\t...info.objects\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tawait this._logging?.log({\n\t\t\tlevel: \"info\",\n\t\t\tsource: StaticPolicyInformationSource.CLASS_NAME,\n\t\t\tts: Date.now(),\n\t\t\tmessage: \"staticRetrieved\",\n\t\t\tdata: {\n\t\t\t\tpolicyId: OdrlPolicyHelper.getUid(policy) ?? \"\",\n\t\t\t\taccessMode,\n\t\t\t\titemCount: Object.keys(information).length\n\t\t\t}\n\t\t});\n\n\t\treturn Object.keys(information).length > 0 ? information : undefined;\n\t}\n\n\t/**\n\t * Add static policy information.\n\t * @param info The static policy information to add.\n\t */\n\tpublic addInformation(info: IStaticPolicyInformationSource): void {\n\t\tGuards.arrayOneOf<string>(\n\t\t\tStaticPolicyInformationSource.CLASS_NAME,\n\t\t\tnameof(info.accessMode),\n\t\t\tinfo.accessMode,\n\t\t\tObject.values(PolicyInformationAccessMode)\n\t\t);\n\t\tGuards.objectValue<IRightsManagementInformation>(\n\t\t\tStaticPolicyInformationSource.CLASS_NAME,\n\t\t\tnameof(info.objects),\n\t\t\tinfo.objects\n\t\t);\n\t\tthis._information.push(info);\n\t}\n}\n"]}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Copyright 2025 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { ComponentFactory, Guards, ObjectHelper, Urn } from "@twin.org/core";
|
|
4
|
+
import { OdrlPolicyHelper, RightsManagementNamespaces } from "@twin.org/rights-management-models";
|
|
5
|
+
import { OdrlPolicyType } from "@twin.org/standards-w3c-odrl";
|
|
6
|
+
/**
|
|
7
|
+
* Pass Through Policy Negotiator.
|
|
8
|
+
*/
|
|
9
|
+
export class PassThroughPolicyNegotiator {
|
|
10
|
+
/**
|
|
11
|
+
* The class name of the Pass Through Policy Negotiator.
|
|
12
|
+
*/
|
|
13
|
+
static CLASS_NAME = "PassThroughPolicyNegotiator";
|
|
14
|
+
/**
|
|
15
|
+
* The logging component.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
_logging;
|
|
19
|
+
/**
|
|
20
|
+
* Create a new instance of PassThroughPolicyNegotiator.
|
|
21
|
+
* @param options The options for the pass through policy negotiator.
|
|
22
|
+
*/
|
|
23
|
+
constructor(options) {
|
|
24
|
+
this._logging = ComponentFactory.getIfExists(options?.loggingComponentType);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Returns the class name of the component.
|
|
28
|
+
* @returns The class name of the component.
|
|
29
|
+
*/
|
|
30
|
+
className() {
|
|
31
|
+
return PassThroughPolicyNegotiator.CLASS_NAME;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Determines if the negotiator supports the given offer.
|
|
35
|
+
* @param offer The offer to check.
|
|
36
|
+
* @returns True if the negotiator supports the given offer.
|
|
37
|
+
*/
|
|
38
|
+
supportsOffer(offer) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Handle the offer.
|
|
43
|
+
* @param offer The offer to check.
|
|
44
|
+
* @param information Information provided by the requester to determine if a policy can be created.
|
|
45
|
+
* @returns Sets the accepted flag if it can be offered, and the interventionRequired flag if manual agreement is needed.
|
|
46
|
+
*/
|
|
47
|
+
async handleOffer(offer, information) {
|
|
48
|
+
Guards.object(PassThroughPolicyNegotiator.CLASS_NAME, "offer", offer);
|
|
49
|
+
await this._logging?.log({
|
|
50
|
+
level: "info",
|
|
51
|
+
source: PassThroughPolicyNegotiator.CLASS_NAME,
|
|
52
|
+
ts: Date.now(),
|
|
53
|
+
message: "handlingOffer",
|
|
54
|
+
data: {
|
|
55
|
+
offerId: OdrlPolicyHelper.getUid(offer) ?? ""
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
accepted: true,
|
|
60
|
+
interventionRequired: false
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Create an agreement based on the offer.
|
|
65
|
+
* @param offer The offer to create the agreement from.
|
|
66
|
+
* @param assignee The assignee of the agreement.
|
|
67
|
+
* @param information Information provided by the requester to aid in the creation of the agreement.
|
|
68
|
+
* @returns The agreement created from the offer or undefined if an agreement could not be created.
|
|
69
|
+
*/
|
|
70
|
+
async createAgreement(offer, assignee, information) {
|
|
71
|
+
Guards.object(PassThroughPolicyNegotiator.CLASS_NAME, "offer", offer);
|
|
72
|
+
await this._logging?.log({
|
|
73
|
+
level: "info",
|
|
74
|
+
source: PassThroughPolicyNegotiator.CLASS_NAME,
|
|
75
|
+
ts: Date.now(),
|
|
76
|
+
message: "createAgreement",
|
|
77
|
+
data: {
|
|
78
|
+
offerId: OdrlPolicyHelper.getUid(offer) ?? ""
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
const agreement = ObjectHelper.clone(offer);
|
|
82
|
+
agreement["@type"] = OdrlPolicyType.Agreement;
|
|
83
|
+
agreement["@id"] = Urn.generateRandom(RightsManagementNamespaces.Policy).toString(false);
|
|
84
|
+
agreement.assignee = assignee;
|
|
85
|
+
return agreement;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=passThroughPolicyNegotiator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"passThroughPolicyNegotiator.js","sourceRoot":"","sources":["../../../src/policyNegotiators/passThroughPolicyNegotiator.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAG7E,OAAO,EACN,gBAAgB,EAChB,0BAA0B,EAG1B,MAAM,oCAAoC,CAAC;AAM5C,OAAO,EAAE,cAAc,EAAmB,MAAM,8BAA8B,CAAC;AAG/E;;GAEG;AACH,MAAM,OAAO,2BAA2B;IACvC;;OAEG;IACI,MAAM,CAAU,UAAU,iCAAiD;IAElF;;;OAGG;IACc,QAAQ,CAAqB;IAE9C;;;OAGG;IACH,YAAY,OAAwD;QACnE,IAAI,CAAC,QAAQ,GAAG,gBAAgB,CAAC,WAAW,CAAoB,OAAO,EAAE,oBAAoB,CAAC,CAAC;IAChG,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,2BAA2B,CAAC,UAAU,CAAC;IAC/C,CAAC;IAED;;;;OAIG;IACI,aAAa,CAAC,KAA8B;QAClD,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,WAAW,CACvB,KAA8B,EAC9B,WAA0C;QAK1C,MAAM,CAAC,MAAM,CACZ,2BAA2B,CAAC,UAAU,WAEtC,KAAK,CACL,CAAC;QAEF,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC;YACxB,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,2BAA2B,CAAC,UAAU;YAC9C,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;YACd,OAAO,EAAE,eAAe;YACxB,IAAI,EAAE;gBACL,OAAO,EAAE,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE;aAC7C;SACD,CAAC,CAAC;QAEH,OAAO;YACN,QAAQ,EAAE,IAAI;YACd,oBAAoB,EAAE,KAAK;SAC3B,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,eAAe,CAC3B,KAA8B,EAC9B,QAA6B,EAC7B,WAA0C;QAE1C,MAAM,CAAC,MAAM,CACZ,2BAA2B,CAAC,UAAU,WAEtC,KAAK,CACL,CAAC;QAEF,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC;YACxB,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,2BAA2B,CAAC,UAAU;YAC9C,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;YACd,OAAO,EAAE,iBAAiB;YAC1B,IAAI,EAAE;gBACL,OAAO,EAAE,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE;aAC7C;SACD,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAA2B,KAAK,CAAC,CAAC;QAEtE,SAAS,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,SAAS,CAAC;QAC9C,SAAS,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,cAAc,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACzF,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAE9B,OAAO,SAAwC,CAAC;IACjD,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ComponentFactory, Guards, ObjectHelper, Urn } from \"@twin.org/core\";\nimport type { ILoggingComponent } from \"@twin.org/logging-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport {\n\tOdrlPolicyHelper,\n\tRightsManagementNamespaces,\n\ttype IPolicyNegotiator,\n\ttype IRightsManagementInformation\n} from \"@twin.org/rights-management-models\";\nimport type {\n\tIDataspaceProtocolAgreement,\n\tIDataspaceProtocolOffer,\n\tIDataspaceProtocolPolicy\n} from \"@twin.org/standards-dataspace-protocol\";\nimport { OdrlPolicyType, type IOdrlParty } from \"@twin.org/standards-w3c-odrl\";\nimport type { IPassThroughPolicyNegotiatorConstructorOptions } from \"../models/IPassThroughPolicyNegotiatorConstructorOptions.js\";\n\n/**\n * Pass Through Policy Negotiator.\n */\nexport class PassThroughPolicyNegotiator implements IPolicyNegotiator {\n\t/**\n\t * The class name of the Pass Through Policy Negotiator.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<PassThroughPolicyNegotiator>();\n\n\t/**\n\t * The logging component.\n\t * @internal\n\t */\n\tprivate readonly _logging?: ILoggingComponent;\n\n\t/**\n\t * Create a new instance of PassThroughPolicyNegotiator.\n\t * @param options The options for the pass through policy negotiator.\n\t */\n\tconstructor(options?: IPassThroughPolicyNegotiatorConstructorOptions) {\n\t\tthis._logging = ComponentFactory.getIfExists<ILoggingComponent>(options?.loggingComponentType);\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn PassThroughPolicyNegotiator.CLASS_NAME;\n\t}\n\n\t/**\n\t * Determines if the negotiator supports the given offer.\n\t * @param offer The offer to check.\n\t * @returns True if the negotiator supports the given offer.\n\t */\n\tpublic supportsOffer(offer: IDataspaceProtocolOffer): boolean {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Handle the offer.\n\t * @param offer The offer to check.\n\t * @param information Information provided by the requester to determine if a policy can be created.\n\t * @returns Sets the accepted flag if it can be offered, and the interventionRequired flag if manual agreement is needed.\n\t */\n\tpublic async handleOffer(\n\t\toffer: IDataspaceProtocolOffer,\n\t\tinformation?: IRightsManagementInformation\n\t): Promise<{\n\t\taccepted: boolean;\n\t\tinterventionRequired: boolean;\n\t}> {\n\t\tGuards.object<IDataspaceProtocolOffer>(\n\t\t\tPassThroughPolicyNegotiator.CLASS_NAME,\n\t\t\tnameof(offer),\n\t\t\toffer\n\t\t);\n\n\t\tawait this._logging?.log({\n\t\t\tlevel: \"info\",\n\t\t\tsource: PassThroughPolicyNegotiator.CLASS_NAME,\n\t\t\tts: Date.now(),\n\t\t\tmessage: \"handlingOffer\",\n\t\t\tdata: {\n\t\t\t\tofferId: OdrlPolicyHelper.getUid(offer) ?? \"\"\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\taccepted: true,\n\t\t\tinterventionRequired: false\n\t\t};\n\t}\n\n\t/**\n\t * Create an agreement based on the offer.\n\t * @param offer The offer to create the agreement from.\n\t * @param assignee The assignee of the agreement.\n\t * @param information Information provided by the requester to aid in the creation of the agreement.\n\t * @returns The agreement created from the offer or undefined if an agreement could not be created.\n\t */\n\tpublic async createAgreement(\n\t\toffer: IDataspaceProtocolOffer,\n\t\tassignee: string | IOdrlParty,\n\t\tinformation?: IRightsManagementInformation\n\t): Promise<IDataspaceProtocolAgreement | undefined> {\n\t\tGuards.object<IDataspaceProtocolOffer>(\n\t\t\tPassThroughPolicyNegotiator.CLASS_NAME,\n\t\t\tnameof(offer),\n\t\t\toffer\n\t\t);\n\n\t\tawait this._logging?.log({\n\t\t\tlevel: \"info\",\n\t\t\tsource: PassThroughPolicyNegotiator.CLASS_NAME,\n\t\t\tts: Date.now(),\n\t\t\tmessage: \"createAgreement\",\n\t\t\tdata: {\n\t\t\t\tofferId: OdrlPolicyHelper.getUid(offer) ?? \"\"\n\t\t\t}\n\t\t});\n\n\t\tconst agreement = ObjectHelper.clone<IDataspaceProtocolPolicy>(offer);\n\n\t\tagreement[\"@type\"] = OdrlPolicyType.Agreement;\n\t\tagreement[\"@id\"] = Urn.generateRandom(RightsManagementNamespaces.Policy).toString(false);\n\t\tagreement.assignee = assignee;\n\n\t\treturn agreement as IDataspaceProtocolAgreement;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Copyright 2025 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { ComponentFactory, Guards } from "@twin.org/core";
|
|
4
|
+
import { OdrlPolicyHelper } from "@twin.org/rights-management-models";
|
|
5
|
+
/**
|
|
6
|
+
* Pass Through Policy Obligation Enforcer.
|
|
7
|
+
*/
|
|
8
|
+
export class PassThroughPolicyObligationEnforcer {
|
|
9
|
+
/**
|
|
10
|
+
* The class name of the Pass Through Policy Obligation Enforcer.
|
|
11
|
+
*/
|
|
12
|
+
static CLASS_NAME = "PassThroughPolicyObligationEnforcer";
|
|
13
|
+
/**
|
|
14
|
+
* The logging component.
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
_logging;
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of Pass Through Policy Obligation Enforcer.
|
|
20
|
+
* @param options The options for the pass through policy obligation enforcer.
|
|
21
|
+
*/
|
|
22
|
+
constructor(options) {
|
|
23
|
+
this._logging = ComponentFactory.getIfExists(options?.loggingComponentType);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns the class name of the component.
|
|
27
|
+
* @returns The class name of the component.
|
|
28
|
+
*/
|
|
29
|
+
className() {
|
|
30
|
+
return PassThroughPolicyObligationEnforcer.CLASS_NAME;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Enforces obligations regarding policy access to data.
|
|
34
|
+
* @param policy The policy to evaluate.
|
|
35
|
+
* @param duty The duty to enforce.
|
|
36
|
+
* @param information Information provided by the requester to determine if a policy can be created.
|
|
37
|
+
* @param data The data to make a decision on.
|
|
38
|
+
* @param action Optional action to make a decision on, if not provided, the enforcer will evaluate all actions in the duty.
|
|
39
|
+
* @returns Whether the obligations were successfully enforced.
|
|
40
|
+
*/
|
|
41
|
+
async enforce(policy, duty, information, data, action) {
|
|
42
|
+
Guards.object(PassThroughPolicyObligationEnforcer.CLASS_NAME, "policy", policy);
|
|
43
|
+
Guards.object(PassThroughPolicyObligationEnforcer.CLASS_NAME, "duty", duty);
|
|
44
|
+
await this._logging?.log({
|
|
45
|
+
level: "info",
|
|
46
|
+
source: PassThroughPolicyObligationEnforcer.CLASS_NAME,
|
|
47
|
+
ts: Date.now(),
|
|
48
|
+
message: "enforcingDuty",
|
|
49
|
+
data: {
|
|
50
|
+
policyId: OdrlPolicyHelper.getUid(policy) ?? ""
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=passThroughPolicyObligationEnforcer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"passThroughPolicyObligationEnforcer.js","sourceRoot":"","sources":["../../../src/policyObligationEnforcers/passThroughPolicyObligationEnforcer.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,EACN,gBAAgB,EAIhB,MAAM,oCAAoC,CAAC;AAI5C;;GAEG;AACH,MAAM,OAAO,mCAAmC;IAC/C;;OAEG;IACI,MAAM,CAAU,UAAU,yCAAyD;IAE1F;;;OAGG;IACc,QAAQ,CAAqB;IAE9C;;;OAGG;IACH,YAAY,OAAgE;QAC3E,IAAI,CAAC,QAAQ,GAAG,gBAAgB,CAAC,WAAW,CAAoB,OAAO,EAAE,oBAAoB,CAAC,CAAC;IAChG,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,mCAAmC,CAAC,UAAU,CAAC;IACvD,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,OAAO,CACnB,MAA+B,EAC/B,IAAe,EACf,WAA0C,EAC1C,IAAQ,EACR,MAAgC;QAEhC,MAAM,CAAC,MAAM,CACZ,mCAAmC,CAAC,UAAU,YAE9C,MAAM,CACN,CAAC;QACF,MAAM,CAAC,MAAM,CAAY,mCAAmC,CAAC,UAAU,UAAgB,IAAI,CAAC,CAAC;QAE7F,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC;YACxB,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,mCAAmC,CAAC,UAAU;YACtD,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;YACd,OAAO,EAAE,eAAe;YACxB,IAAI,EAAE;gBACL,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;aAC/C;SACD,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACb,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ComponentFactory, Guards } from \"@twin.org/core\";\nimport type { ILoggingComponent } from \"@twin.org/logging-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport {\n\tOdrlPolicyHelper,\n\ttype IPolicyObligationEnforcer,\n\ttype IRightsManagementInformation,\n\ttype IRightsManagementPolicy\n} from \"@twin.org/rights-management-models\";\nimport type { OdrlActionType, IOdrlDuty } from \"@twin.org/standards-w3c-odrl\";\nimport type { IPassThroughPolicyObligationEnforcerConstructorOptions } from \"../models/IPassThroughPolicyObligationEnforcerConstructorOptions.js\";\n\n/**\n * Pass Through Policy Obligation Enforcer.\n */\nexport class PassThroughPolicyObligationEnforcer implements IPolicyObligationEnforcer {\n\t/**\n\t * The class name of the Pass Through Policy Obligation Enforcer.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<PassThroughPolicyObligationEnforcer>();\n\n\t/**\n\t * The logging component.\n\t * @internal\n\t */\n\tprivate readonly _logging?: ILoggingComponent;\n\n\t/**\n\t * Create a new instance of Pass Through Policy Obligation Enforcer.\n\t * @param options The options for the pass through policy obligation enforcer.\n\t */\n\tconstructor(options?: IPassThroughPolicyObligationEnforcerConstructorOptions) {\n\t\tthis._logging = ComponentFactory.getIfExists<ILoggingComponent>(options?.loggingComponentType);\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn PassThroughPolicyObligationEnforcer.CLASS_NAME;\n\t}\n\n\t/**\n\t * Enforces obligations regarding policy access to data.\n\t * @param policy The policy to evaluate.\n\t * @param duty The duty to enforce.\n\t * @param information Information provided by the requester to determine if a policy can be created.\n\t * @param data The data to make a decision on.\n\t * @param action Optional action to make a decision on, if not provided, the enforcer will evaluate all actions in the duty.\n\t * @returns Whether the obligations were successfully enforced.\n\t */\n\tpublic async enforce<D = unknown>(\n\t\tpolicy: IRightsManagementPolicy,\n\t\tduty: IOdrlDuty,\n\t\tinformation?: IRightsManagementInformation,\n\t\tdata?: D,\n\t\taction?: OdrlActionType | string\n\t): Promise<boolean> {\n\t\tGuards.object<IRightsManagementPolicy>(\n\t\t\tPassThroughPolicyObligationEnforcer.CLASS_NAME,\n\t\t\tnameof(policy),\n\t\t\tpolicy\n\t\t);\n\t\tGuards.object<IOdrlDuty>(PassThroughPolicyObligationEnforcer.CLASS_NAME, nameof(duty), duty);\n\n\t\tawait this._logging?.log({\n\t\t\tlevel: \"info\",\n\t\t\tsource: PassThroughPolicyObligationEnforcer.CLASS_NAME,\n\t\t\tts: Date.now(),\n\t\t\tmessage: \"enforcingDuty\",\n\t\t\tdata: {\n\t\t\t\tpolicyId: OdrlPolicyHelper.getUid(policy) ?? \"\"\n\t\t\t}\n\t\t});\n\n\t\treturn true;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// Copyright 2025 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
4
|
+
import { OdrlPolicyHelper } from "@twin.org/rights-management-models";
|
|
5
|
+
/**
|
|
6
|
+
* Pass Through Policy Requester.
|
|
7
|
+
*/
|
|
8
|
+
export class PassThroughPolicyRequester {
|
|
9
|
+
/**
|
|
10
|
+
* The class name of the Pass Through Policy Requester.
|
|
11
|
+
*/
|
|
12
|
+
static CLASS_NAME = "PassThroughPolicyRequester";
|
|
13
|
+
/**
|
|
14
|
+
* The logging component.
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
_logging;
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of PassThroughPolicyRequester.
|
|
20
|
+
* @param options The options for the pass through policy Requester.
|
|
21
|
+
*/
|
|
22
|
+
constructor(options) {
|
|
23
|
+
this._logging = ComponentFactory.getIfExists(options?.loggingComponentType);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns the class name of the component.
|
|
27
|
+
* @returns The class name of the component.
|
|
28
|
+
*/
|
|
29
|
+
className() {
|
|
30
|
+
return PassThroughPolicyRequester.CLASS_NAME;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A policy has been offered by a provider, let the request handler know about it.
|
|
34
|
+
* @param negotiationId The id of the negotiation.
|
|
35
|
+
* @param offer The offer sent by the provider.
|
|
36
|
+
* @returns True if the offer was accepted, false otherwise.
|
|
37
|
+
*/
|
|
38
|
+
async offer(negotiationId, offer) {
|
|
39
|
+
await this._logging?.log({
|
|
40
|
+
level: "info",
|
|
41
|
+
source: PassThroughPolicyRequester.CLASS_NAME,
|
|
42
|
+
ts: Date.now(),
|
|
43
|
+
message: "offer",
|
|
44
|
+
data: {
|
|
45
|
+
negotiationId,
|
|
46
|
+
offerId: OdrlPolicyHelper.getUid(offer) ?? ""
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A policy agreement has been sent by a provider, let the request handler know about it.
|
|
53
|
+
* @param negotiationId The id of the negotiation.
|
|
54
|
+
* @param agreement The agreement sent by the provider.
|
|
55
|
+
* @returns True if the agreement was accepted, false otherwise.
|
|
56
|
+
*/
|
|
57
|
+
async agreement(negotiationId, agreement) {
|
|
58
|
+
await this._logging?.log({
|
|
59
|
+
level: "info",
|
|
60
|
+
source: PassThroughPolicyRequester.CLASS_NAME,
|
|
61
|
+
ts: Date.now(),
|
|
62
|
+
message: "agreement",
|
|
63
|
+
data: {
|
|
64
|
+
negotiationId,
|
|
65
|
+
agreementId: OdrlPolicyHelper.getUid(agreement) ?? ""
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A policy finalisation has been sent by a provider, let the request handler know about it.
|
|
72
|
+
* @param negotiationId The id of the negotiation.
|
|
73
|
+
* @returns A promise that resolves when the finalisation has been processed.
|
|
74
|
+
*/
|
|
75
|
+
async finalised(negotiationId) {
|
|
76
|
+
await this._logging?.log({
|
|
77
|
+
level: "info",
|
|
78
|
+
source: PassThroughPolicyRequester.CLASS_NAME,
|
|
79
|
+
ts: Date.now(),
|
|
80
|
+
message: "finalised",
|
|
81
|
+
data: {
|
|
82
|
+
negotiationId
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* A policy termination has been sent by a provider, let the request handler know about it.
|
|
88
|
+
* @param negotiationId The id of the negotiation.
|
|
89
|
+
* @returns A promise that resolves when the termination has been processed.
|
|
90
|
+
*/
|
|
91
|
+
async terminated(negotiationId) {
|
|
92
|
+
await this._logging?.log({
|
|
93
|
+
level: "info",
|
|
94
|
+
source: PassThroughPolicyRequester.CLASS_NAME,
|
|
95
|
+
ts: Date.now(),
|
|
96
|
+
message: "terminated",
|
|
97
|
+
data: {
|
|
98
|
+
negotiationId
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=passThroughPolicyRequester.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"passThroughPolicyRequester.js","sourceRoot":"","sources":["../../../src/policyRequesters/passThroughPolicyRequester.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,EAAE,gBAAgB,EAAyB,MAAM,oCAAoC,CAAC;AAO7F;;GAEG;AACH,MAAM,OAAO,0BAA0B;IACtC;;OAEG;IACI,MAAM,CAAU,UAAU,gCAAgD;IAEjF;;;OAGG;IACc,QAAQ,CAAqB;IAE9C;;;OAGG;IACH,YAAY,OAAuD;QAClE,IAAI,CAAC,QAAQ,GAAG,gBAAgB,CAAC,WAAW,CAAoB,OAAO,EAAE,oBAAoB,CAAC,CAAC;IAChG,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,0BAA0B,CAAC,UAAU,CAAC;IAC9C,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,KAAK,CAAC,aAAqB,EAAE,KAA8B;QACvE,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC;YACxB,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,0BAA0B,CAAC,UAAU;YAC7C,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;YACd,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE;gBACL,aAAa;gBACb,OAAO,EAAE,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE;aAC7C;SACD,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,SAAS,CACrB,aAAqB,EACrB,SAAsC;QAEtC,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC;YACxB,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,0BAA0B,CAAC,UAAU;YAC7C,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;YACd,OAAO,EAAE,WAAW;YACpB,IAAI,EAAE;gBACL,aAAa;gBACb,WAAW,EAAE,gBAAgB,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE;aACrD;SACD,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,SAAS,CAAC,aAAqB;QAC3C,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC;YACxB,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,0BAA0B,CAAC,UAAU;YAC7C,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;YACd,OAAO,EAAE,WAAW;YACpB,IAAI,EAAE;gBACL,aAAa;aACb;SACD,CAAC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,UAAU,CAAC,aAAqB;QAC5C,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC;YACxB,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,0BAA0B,CAAC,UAAU;YAC7C,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;YACd,OAAO,EAAE,YAAY;YACrB,IAAI,EAAE;gBACL,aAAa;aACb;SACD,CAAC,CAAC;IACJ,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ComponentFactory } from \"@twin.org/core\";\nimport type { ILoggingComponent } from \"@twin.org/logging-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { OdrlPolicyHelper, type IPolicyRequester } from \"@twin.org/rights-management-models\";\nimport type {\n\tIDataspaceProtocolAgreement,\n\tIDataspaceProtocolOffer\n} from \"@twin.org/standards-dataspace-protocol\";\nimport type { IPassThroughPolicyRequesterConstructorOptions } from \"../models/IPassThroughPolicyRequesterConstructorOptions.js\";\n\n/**\n * Pass Through Policy Requester.\n */\nexport class PassThroughPolicyRequester implements IPolicyRequester {\n\t/**\n\t * The class name of the Pass Through Policy Requester.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<PassThroughPolicyRequester>();\n\n\t/**\n\t * The logging component.\n\t * @internal\n\t */\n\tprivate readonly _logging?: ILoggingComponent;\n\n\t/**\n\t * Create a new instance of PassThroughPolicyRequester.\n\t * @param options The options for the pass through policy Requester.\n\t */\n\tconstructor(options?: IPassThroughPolicyRequesterConstructorOptions) {\n\t\tthis._logging = ComponentFactory.getIfExists<ILoggingComponent>(options?.loggingComponentType);\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn PassThroughPolicyRequester.CLASS_NAME;\n\t}\n\n\t/**\n\t * A policy has been offered by a provider, let the request handler know about it.\n\t * @param negotiationId The id of the negotiation.\n\t * @param offer The offer sent by the provider.\n\t * @returns True if the offer was accepted, false otherwise.\n\t */\n\tpublic async offer(negotiationId: string, offer: IDataspaceProtocolOffer): Promise<boolean> {\n\t\tawait this._logging?.log({\n\t\t\tlevel: \"info\",\n\t\t\tsource: PassThroughPolicyRequester.CLASS_NAME,\n\t\t\tts: Date.now(),\n\t\t\tmessage: \"offer\",\n\t\t\tdata: {\n\t\t\t\tnegotiationId,\n\t\t\t\tofferId: OdrlPolicyHelper.getUid(offer) ?? \"\"\n\t\t\t}\n\t\t});\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * A policy agreement has been sent by a provider, let the request handler know about it.\n\t * @param negotiationId The id of the negotiation.\n\t * @param agreement The agreement sent by the provider.\n\t * @returns True if the agreement was accepted, false otherwise.\n\t */\n\tpublic async agreement(\n\t\tnegotiationId: string,\n\t\tagreement: IDataspaceProtocolAgreement\n\t): Promise<boolean> {\n\t\tawait this._logging?.log({\n\t\t\tlevel: \"info\",\n\t\t\tsource: PassThroughPolicyRequester.CLASS_NAME,\n\t\t\tts: Date.now(),\n\t\t\tmessage: \"agreement\",\n\t\t\tdata: {\n\t\t\t\tnegotiationId,\n\t\t\t\tagreementId: OdrlPolicyHelper.getUid(agreement) ?? \"\"\n\t\t\t}\n\t\t});\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * A policy finalisation has been sent by a provider, let the request handler know about it.\n\t * @param negotiationId The id of the negotiation.\n\t * @returns A promise that resolves when the finalisation has been processed.\n\t */\n\tpublic async finalised(negotiationId: string): Promise<void> {\n\t\tawait this._logging?.log({\n\t\t\tlevel: \"info\",\n\t\t\tsource: PassThroughPolicyRequester.CLASS_NAME,\n\t\t\tts: Date.now(),\n\t\t\tmessage: \"finalised\",\n\t\t\tdata: {\n\t\t\t\tnegotiationId\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * A policy termination has been sent by a provider, let the request handler know about it.\n\t * @param negotiationId The id of the negotiation.\n\t * @returns A promise that resolves when the termination has been processed.\n\t */\n\tpublic async terminated(negotiationId: string): Promise<void> {\n\t\tawait this._logging?.log({\n\t\t\tlevel: \"info\",\n\t\t\tsource: PassThroughPolicyRequester.CLASS_NAME,\n\t\t\tts: Date.now(),\n\t\t\tmessage: \"terminated\",\n\t\t\tdata: {\n\t\t\t\tnegotiationId\n\t\t\t}\n\t\t});\n\t}\n}\n"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,19 +1,29 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./models/
|
|
3
|
-
export * from "./models/
|
|
4
|
-
export * from "./models/
|
|
5
|
-
export * from "./models/
|
|
6
|
-
export * from "./models/IExamplePolicyRequesterConstructorOptions.js";
|
|
1
|
+
export * from "./models/IAutomationPolicyExecutionActionConfig.js";
|
|
2
|
+
export * from "./models/IAutomationPolicyExecutionActionConstructorOptions.js";
|
|
3
|
+
export * from "./models/IDefaultPolicyArbiterConfig.js";
|
|
4
|
+
export * from "./models/IDefaultPolicyArbiterConstructorOptions.js";
|
|
5
|
+
export * from "./models/IDefaultPolicyEnforcementProcessorConstructorOptions.js";
|
|
7
6
|
export * from "./models/IIdentityPolicyInformationSourceConstructorOptions.js";
|
|
7
|
+
export * from "./models/IIdentityProfilePolicyInformationSourceConstructorOptions.js";
|
|
8
8
|
export * from "./models/ILoggingPolicyExecutionActionConfig.js";
|
|
9
9
|
export * from "./models/ILoggingPolicyExecutionActionConstructorOptions.js";
|
|
10
|
+
export * from "./models/IPassThroughPolicyArbiterConstructorOptions.js";
|
|
11
|
+
export * from "./models/IPassThroughPolicyEnforcementProcessorConstructorOptions.js";
|
|
12
|
+
export * from "./models/IPassThroughPolicyNegotiatorConstructorOptions.js";
|
|
13
|
+
export * from "./models/IPassThroughPolicyObligationEnforcerConstructorOptions.js";
|
|
14
|
+
export * from "./models/IPassThroughPolicyRequesterConstructorOptions.js";
|
|
10
15
|
export * from "./models/IStaticPolicyInformationSource.js";
|
|
11
16
|
export * from "./models/IStaticPolicyInformationSourceConfig.js";
|
|
12
17
|
export * from "./models/IStaticPolicyInformationSourceConstructorOptions.js";
|
|
13
|
-
export * from "./policyArbiters/
|
|
14
|
-
export * from "./
|
|
18
|
+
export * from "./policyArbiters/defaultPolicyArbiter.js";
|
|
19
|
+
export * from "./policyArbiters/passThroughPolicyArbiter.js";
|
|
20
|
+
export * from "./policyEnforcementProcessor/defaultPolicyEnforcementProcessor.js";
|
|
21
|
+
export * from "./policyEnforcementProcessor/passThroughPolicyEnforcementProcessor.js";
|
|
22
|
+
export * from "./policyExecutionActions/automationPolicyExecutionAction.js";
|
|
15
23
|
export * from "./policyExecutionActions/loggingPolicyExecutionAction.js";
|
|
16
24
|
export * from "./policyInformationSources/identityPolicyInformationSource.js";
|
|
25
|
+
export * from "./policyInformationSources/identityProfilePolicyInformationSource.js";
|
|
17
26
|
export * from "./policyInformationSources/staticPolicyInformationSource.js";
|
|
18
|
-
export * from "./policyNegotiators/
|
|
19
|
-
export * from "./
|
|
27
|
+
export * from "./policyNegotiators/passThroughPolicyNegotiator.js";
|
|
28
|
+
export * from "./policyObligationEnforcers/passThroughPolicyObligationEnforcer.js";
|
|
29
|
+
export * from "./policyRequesters/passThroughPolicyRequester.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for the Automation Policy Execution Action Component.
|
|
3
|
+
*/
|
|
4
|
+
export interface IAutomationPolicyExecutionActionConfig {
|
|
5
|
+
/**
|
|
6
|
+
* The policy decision stages to trigger the automation actions, if undefined defaults to "inform".
|
|
7
|
+
*/
|
|
8
|
+
triggerActions?: string[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IAutomationPolicyExecutionActionConfig } from "./IAutomationPolicyExecutionActionConfig.js";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the Automation Policy Execution Action.
|
|
4
|
+
*/
|
|
5
|
+
export interface IAutomationPolicyExecutionActionConstructorOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The automation component for executing automation policies.
|
|
8
|
+
* @default automation
|
|
9
|
+
*/
|
|
10
|
+
automationComponentType?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The configuration for the automation policy execution.
|
|
13
|
+
*/
|
|
14
|
+
config?: IAutomationPolicyExecutionActionConfig;
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
*/
|
|
9
|
+
loggingComponentType?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The policy administration point component for retrieving inherited policies.
|
|
12
|
+
* @default policy-administration-point
|
|
13
|
+
*/
|
|
14
|
+
policyAdministrationPointComponentType?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The configuration options for the default policy arbiter.
|
|
17
|
+
*/
|
|
18
|
+
config?: IDefaultPolicyArbiterConfig;
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for the Identity Profile Policy Information Source Component.
|
|
3
|
+
*/
|
|
4
|
+
export interface IIdentityProfilePolicyInformationSourceConstructorOptions {
|
|
5
|
+
/**
|
|
6
|
+
* The logging component for logging policy source.
|
|
7
|
+
*/
|
|
8
|
+
loggingComponentType?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The component for retrieving identity profiles.
|
|
11
|
+
* @default identity-profile
|
|
12
|
+
*/
|
|
13
|
+
identityProfileComponentType?: string;
|
|
14
|
+
}
|
|
@@ -13,10 +13,10 @@ export interface ILoggingPolicyExecutionActionConfig {
|
|
|
13
13
|
*/
|
|
14
14
|
includeData?: boolean;
|
|
15
15
|
/**
|
|
16
|
-
* Whether to include the
|
|
16
|
+
* Whether to include the policy in the log.
|
|
17
17
|
* @default false
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
includePolicy?: boolean;
|
|
20
20
|
/**
|
|
21
21
|
* Whether to include the decisions in the log.
|
|
22
22
|
* @default false
|
|
@@ -5,7 +5,6 @@ import type { ILoggingPolicyExecutionActionConfig } from "./ILoggingPolicyExecut
|
|
|
5
5
|
export interface ILoggingPolicyExecutionActionConstructorOptions {
|
|
6
6
|
/**
|
|
7
7
|
* The logging component for logging policy execution.
|
|
8
|
-
* @default logging
|
|
9
8
|
*/
|
|
10
9
|
loggingComponentType?: string;
|
|
11
10
|
/**
|