@twin.org/rights-management-plugins 0.0.3-next.10

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.
Files changed (82) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +21 -0
  3. package/dist/es/index.js +21 -0
  4. package/dist/es/index.js.map +1 -0
  5. package/dist/es/models/IExampleDataAccessHandlerConstructorOptions.js +4 -0
  6. package/dist/es/models/IExampleDataAccessHandlerConstructorOptions.js.map +1 -0
  7. package/dist/es/models/IExamplePolicyArbiterConstructorOptions.js +4 -0
  8. package/dist/es/models/IExamplePolicyArbiterConstructorOptions.js.map +1 -0
  9. package/dist/es/models/IExamplePolicyEnforcementProcessorConstructorOptions.js +4 -0
  10. package/dist/es/models/IExamplePolicyEnforcementProcessorConstructorOptions.js.map +1 -0
  11. package/dist/es/models/IExamplePolicyNegotiatorConstructorOptions.js +4 -0
  12. package/dist/es/models/IExamplePolicyNegotiatorConstructorOptions.js.map +1 -0
  13. package/dist/es/models/IExamplePolicyRequesterConstructorOptions.js +4 -0
  14. package/dist/es/models/IExamplePolicyRequesterConstructorOptions.js.map +1 -0
  15. package/dist/es/models/IIdentityPolicyInformationSourceConstructorOptions.js +4 -0
  16. package/dist/es/models/IIdentityPolicyInformationSourceConstructorOptions.js.map +1 -0
  17. package/dist/es/models/ILoggingPolicyExecutionActionConfig.js +2 -0
  18. package/dist/es/models/ILoggingPolicyExecutionActionConfig.js.map +1 -0
  19. package/dist/es/models/ILoggingPolicyExecutionActionConstructorOptions.js +2 -0
  20. package/dist/es/models/ILoggingPolicyExecutionActionConstructorOptions.js.map +1 -0
  21. package/dist/es/models/IStaticPolicyInformationSource.js +2 -0
  22. package/dist/es/models/IStaticPolicyInformationSource.js.map +1 -0
  23. package/dist/es/models/IStaticPolicyInformationSourceConfig.js +2 -0
  24. package/dist/es/models/IStaticPolicyInformationSourceConfig.js.map +1 -0
  25. package/dist/es/models/IStaticPolicyInformationSourceConstructorOptions.js +2 -0
  26. package/dist/es/models/IStaticPolicyInformationSourceConstructorOptions.js.map +1 -0
  27. package/dist/es/policyArbiters/examplePolicyArbiter.js +50 -0
  28. package/dist/es/policyArbiters/examplePolicyArbiter.js.map +1 -0
  29. package/dist/es/policyEnforcementProcessor/examplePolicyEnforcementProcessor.js +42 -0
  30. package/dist/es/policyEnforcementProcessor/examplePolicyEnforcementProcessor.js.map +1 -0
  31. package/dist/es/policyExecutionActions/loggingPolicyExecutionAction.js +117 -0
  32. package/dist/es/policyExecutionActions/loggingPolicyExecutionAction.js.map +1 -0
  33. package/dist/es/policyInformationSources/identityPolicyInformationSource.js +79 -0
  34. package/dist/es/policyInformationSources/identityPolicyInformationSource.js.map +1 -0
  35. package/dist/es/policyInformationSources/staticPolicyInformationSource.js +94 -0
  36. package/dist/es/policyInformationSources/staticPolicyInformationSource.js.map +1 -0
  37. package/dist/es/policyNegotiators/examplePolicyNegotiator.js +61 -0
  38. package/dist/es/policyNegotiators/examplePolicyNegotiator.js.map +1 -0
  39. package/dist/es/policyRequesters/examplePolicyRequester.js +69 -0
  40. package/dist/es/policyRequesters/examplePolicyRequester.js.map +1 -0
  41. package/dist/types/index.d.ts +18 -0
  42. package/dist/types/models/IExampleDataAccessHandlerConstructorOptions.d.ts +10 -0
  43. package/dist/types/models/IExamplePolicyArbiterConstructorOptions.d.ts +10 -0
  44. package/dist/types/models/IExamplePolicyEnforcementProcessorConstructorOptions.d.ts +10 -0
  45. package/dist/types/models/IExamplePolicyNegotiatorConstructorOptions.d.ts +10 -0
  46. package/dist/types/models/IExamplePolicyRequesterConstructorOptions.d.ts +10 -0
  47. package/dist/types/models/IIdentityPolicyInformationSourceConstructorOptions.d.ts +15 -0
  48. package/dist/types/models/ILoggingPolicyExecutionActionConfig.d.ts +25 -0
  49. package/dist/types/models/ILoggingPolicyExecutionActionConstructorOptions.d.ts +15 -0
  50. package/dist/types/models/IStaticPolicyInformationSource.d.ts +20 -0
  51. package/dist/types/models/IStaticPolicyInformationSourceConfig.d.ts +10 -0
  52. package/dist/types/models/IStaticPolicyInformationSourceConstructorOptions.d.ts +15 -0
  53. package/dist/types/policyArbiters/examplePolicyArbiter.d.ts +36 -0
  54. package/dist/types/policyEnforcementProcessor/examplePolicyEnforcementProcessor.d.ts +29 -0
  55. package/dist/types/policyExecutionActions/loggingPolicyExecutionAction.d.ts +49 -0
  56. package/dist/types/policyInformationSources/identityPolicyInformationSource.d.ts +32 -0
  57. package/dist/types/policyInformationSources/staticPolicyInformationSource.d.ts +38 -0
  58. package/dist/types/policyNegotiators/examplePolicyNegotiator.d.ts +45 -0
  59. package/dist/types/policyRequesters/examplePolicyRequester.d.ts +53 -0
  60. package/docs/changelog.md +102 -0
  61. package/docs/examples.md +1 -0
  62. package/docs/reference/classes/ExamplePolicyArbiter.md +121 -0
  63. package/docs/reference/classes/ExamplePolicyEnforcementProcessor.md +101 -0
  64. package/docs/reference/classes/ExamplePolicyNegotiator.md +143 -0
  65. package/docs/reference/classes/ExamplePolicyRequester.md +187 -0
  66. package/docs/reference/classes/IdentityPolicyInformationSource.md +103 -0
  67. package/docs/reference/classes/LoggingPolicyExecutionAction.md +127 -0
  68. package/docs/reference/classes/StaticPolicyInformationSource.md +123 -0
  69. package/docs/reference/index.md +25 -0
  70. package/docs/reference/interfaces/IExampleDataAccessHandlerConstructorOptions.md +17 -0
  71. package/docs/reference/interfaces/IExamplePolicyArbiterConstructorOptions.md +17 -0
  72. package/docs/reference/interfaces/IExamplePolicyEnforcementProcessorConstructorOptions.md +17 -0
  73. package/docs/reference/interfaces/IExamplePolicyNegotiatorConstructorOptions.md +17 -0
  74. package/docs/reference/interfaces/IExamplePolicyRequesterConstructorOptions.md +17 -0
  75. package/docs/reference/interfaces/IIdentityPolicyInformationSourceConstructorOptions.md +31 -0
  76. package/docs/reference/interfaces/ILoggingPolicyExecutionActionConfig.md +53 -0
  77. package/docs/reference/interfaces/ILoggingPolicyExecutionActionConstructorOptions.md +25 -0
  78. package/docs/reference/interfaces/IStaticPolicyInformationSource.md +28 -0
  79. package/docs/reference/interfaces/IStaticPolicyInformationSourceConfig.md +11 -0
  80. package/docs/reference/interfaces/IStaticPolicyInformationSourceConstructorOptions.md +25 -0
  81. package/locales/en.json +20 -0
  82. package/package.json +57 -0
@@ -0,0 +1,53 @@
1
+ # Interface: ILoggingPolicyExecutionActionConfig
2
+
3
+ Options for the Logging Policy Execution Action Component.
4
+
5
+ ## Properties
6
+
7
+ ### stages?
8
+
9
+ > `optional` **stages**: `PolicyDecisionStage`[]
10
+
11
+ The policy decision stages to log, if undefined defaults to all.
12
+
13
+ ***
14
+
15
+ ### includeData?
16
+
17
+ > `optional` **includeData**: `boolean`
18
+
19
+ Whether to include the data in the log.
20
+
21
+ #### Default
22
+
23
+ ```ts
24
+ false
25
+ ```
26
+
27
+ ***
28
+
29
+ ### includePolicies?
30
+
31
+ > `optional` **includePolicies**: `boolean`
32
+
33
+ Whether to include the policies in the log.
34
+
35
+ #### Default
36
+
37
+ ```ts
38
+ false
39
+ ```
40
+
41
+ ***
42
+
43
+ ### includeDecisions?
44
+
45
+ > `optional` **includeDecisions**: `boolean`
46
+
47
+ Whether to include the decisions in the log.
48
+
49
+ #### Default
50
+
51
+ ```ts
52
+ false
53
+ ```
@@ -0,0 +1,25 @@
1
+ # Interface: ILoggingPolicyExecutionActionConstructorOptions
2
+
3
+ Options for the Logging Policy Execution Action.
4
+
5
+ ## Properties
6
+
7
+ ### loggingComponentType?
8
+
9
+ > `optional` **loggingComponentType**: `string`
10
+
11
+ The logging component for logging policy execution.
12
+
13
+ #### Default
14
+
15
+ ```ts
16
+ logging
17
+ ```
18
+
19
+ ***
20
+
21
+ ### config?
22
+
23
+ > `optional` **config**: [`ILoggingPolicyExecutionActionConfig`](ILoggingPolicyExecutionActionConfig.md)
24
+
25
+ The configuration for the logging policy execution.
@@ -0,0 +1,28 @@
1
+ # Interface: IStaticPolicyInformationSource
2
+
3
+ Configuration for the Static Policy Information Source Component.
4
+
5
+ ## Properties
6
+
7
+ ### accessMode
8
+
9
+ > **accessMode**: `PolicyInformationAccessMode`
10
+
11
+ Is the information public, if so it will be shared with negotiation requests.
12
+
13
+ ***
14
+
15
+ ### matchLocators?
16
+
17
+ > `optional` **matchLocators**: `IPolicyLocator`[]
18
+
19
+ Information is only provided for the specified locator combination.
20
+ If undefined is provided matches all resources.
21
+
22
+ ***
23
+
24
+ ### objects
25
+
26
+ > **objects**: `IJsonLdNodeObject`[]
27
+
28
+ The objects containing the information.
@@ -0,0 +1,11 @@
1
+ # Interface: IStaticPolicyInformationSourceConfig
2
+
3
+ Configuration for the Static Policy Information Source Component.
4
+
5
+ ## Properties
6
+
7
+ ### information?
8
+
9
+ > `optional` **information**: [`IStaticPolicyInformationSource`](IStaticPolicyInformationSource.md)[]
10
+
11
+ The information to return from the PIP.
@@ -0,0 +1,25 @@
1
+ # Interface: IStaticPolicyInformationSourceConstructorOptions
2
+
3
+ Options for the Static Policy Information Source Component.
4
+
5
+ ## Properties
6
+
7
+ ### loggingComponentType?
8
+
9
+ > `optional` **loggingComponentType**: `string`
10
+
11
+ The logging component for logging policy source.
12
+
13
+ #### Default
14
+
15
+ ```ts
16
+ logging
17
+ ```
18
+
19
+ ***
20
+
21
+ ### config?
22
+
23
+ > `optional` **config**: [`IStaticPolicyInformationSourceConfig`](IStaticPolicyInformationSourceConfig.md)
24
+
25
+ The configuration.
@@ -0,0 +1,20 @@
1
+ {
2
+ "error": {
3
+ "identityPolicyInformationSource": {
4
+ "identityRetrievalFailed": "Failed to retrieve identity information for locator: \"{locator}\""
5
+ }
6
+ },
7
+ "info": {
8
+ "identityPolicyInformationSource": {
9
+ "identityRetrieving": "Retrieving identity information for locator: \"{locator}\""
10
+ },
11
+ "staticPolicyInformationSource": {
12
+ "staticRetrieving": "Retrieving static policy information for locator \"{locator}\" with access mode: \"{accessMode}\"",
13
+ "staticRetrieved": "Retrieved static policy information for locator: \"{locator}\" with access mode: \"{accessMode}\", item count: {itemCount}"
14
+ },
15
+ "loggingPolicyExecutionAction": {
16
+ "policyActionExecutedBefore": "Policy executed for locator: \"{locator}\", stage: \"{stage}\", data: \"{data}\", policies: \"{policies}\"",
17
+ "policyActionExecutedAfter": "Policy executed for locator: \"{locator}\", stage: \"{stage}\", data: \"{data}\", policies: \"{policies}\", decisions: \"{decisions}\""
18
+ }
19
+ }
20
+ }
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@twin.org/rights-management-plugins",
3
+ "version": "0.0.3-next.10",
4
+ "description": "Rights management plugin implementations",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/twinfoundation/rights-management.git",
8
+ "directory": "packages/rights-management-plugins"
9
+ },
10
+ "contributors": [
11
+ "cornel.filip@iota.org",
12
+ "adrian.sanchez.sequeira@iota.org",
13
+ "martyn.janes@iota.org"
14
+ ],
15
+ "license": "Apache-2.0",
16
+ "type": "module",
17
+ "engines": {
18
+ "node": ">=20.0.0"
19
+ },
20
+ "dependencies": {
21
+ "@twin.org/context": "next",
22
+ "@twin.org/core": "next",
23
+ "@twin.org/data-json-ld": "next",
24
+ "@twin.org/logging-models": "next",
25
+ "@twin.org/nameof": "next",
26
+ "@twin.org/rights-management-models": "0.0.3-next.10",
27
+ "@twin.org/standards-w3c-odrl": "next"
28
+ },
29
+ "main": "./dist/es/index.js",
30
+ "types": "./dist/types/index.d.ts",
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/types/index.d.ts",
34
+ "import": "./dist/es/index.js",
35
+ "default": "./dist/es/index.js"
36
+ },
37
+ "./locales/*.json": "./locales/*.json"
38
+ },
39
+ "files": [
40
+ "dist/es",
41
+ "dist/types",
42
+ "locales",
43
+ "docs"
44
+ ],
45
+ "keywords": [
46
+ "twin",
47
+ "trade",
48
+ "iota",
49
+ "framework",
50
+ "blockchain",
51
+ "rights-management"
52
+ ],
53
+ "bugs": {
54
+ "url": "git+https://github.com/twinfoundation/rights-management/issues"
55
+ },
56
+ "homepage": "https://twindev.org"
57
+ }