@twin.org/node-core 0.0.3-next.52 → 0.0.3-next.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/builders/engineEnvBuilder.js +19 -38
- package/dist/es/builders/engineEnvBuilder.js.map +1 -1
- package/dist/es/builders/engineServerEnvBuilder.js +16 -4
- package/dist/es/builders/engineServerEnvBuilder.js.map +1 -1
- package/dist/es/cli.js +6 -2
- package/dist/es/cli.js.map +1 -1
- package/dist/es/commands/bootstrapLegacy.js +76 -30
- package/dist/es/commands/bootstrapLegacy.js.map +1 -1
- package/dist/es/commands/identityCreate.js +29 -0
- package/dist/es/commands/identityCreate.js.map +1 -1
- package/dist/es/commands/identityImports.js +1 -0
- package/dist/es/commands/identityImports.js.map +1 -1
- package/dist/es/commands/identityVerifiableCredentialCreate.js +1 -0
- package/dist/es/commands/identityVerifiableCredentialCreate.js.map +1 -1
- package/dist/es/commands/identityVerificationMethodCreate.js +1 -0
- package/dist/es/commands/identityVerificationMethodCreate.js.map +1 -1
- package/dist/es/commands/identityVerificationMethodImport.js +1 -0
- package/dist/es/commands/identityVerificationMethodImport.js.map +1 -1
- package/dist/es/commands/nodeSetIdentity.js +1 -0
- package/dist/es/commands/nodeSetIdentity.js.map +1 -1
- package/dist/es/commands/removeTenantOrgAlias.js +81 -0
- package/dist/es/commands/removeTenantOrgAlias.js.map +1 -0
- package/dist/es/commands/setNodeOrgId.js +60 -0
- package/dist/es/commands/setNodeOrgId.js.map +1 -0
- package/dist/es/commands/setTenantOrgId.js +158 -0
- package/dist/es/commands/setTenantOrgId.js.map +1 -0
- package/dist/es/commands/tenantCreate.js +41 -7
- package/dist/es/commands/tenantCreate.js.map +1 -1
- package/dist/es/commands/vaultKeyCreate.js +1 -0
- package/dist/es/commands/vaultKeyCreate.js.map +1 -1
- package/dist/es/commands/vaultKeyImport.js +1 -0
- package/dist/es/commands/vaultKeyImport.js.map +1 -1
- package/dist/es/defaults.js +1 -3
- package/dist/es/defaults.js.map +1 -1
- package/dist/es/models/ICliCommandDefinition.js.map +1 -1
- package/dist/es/models/IEngineEnvironmentVariables.js.map +1 -1
- package/dist/es/models/INodeEngineState.js.map +1 -1
- package/dist/es/node.js +2 -2
- package/dist/es/node.js.map +1 -1
- package/dist/es/start.js +74 -9
- package/dist/es/start.js.map +1 -1
- package/dist/types/builders/engineEnvBuilder.d.ts +1 -12
- package/dist/types/commands/bootstrapLegacy.d.ts +2 -2
- package/dist/types/commands/identityCreate.d.ts +4 -0
- package/dist/types/commands/removeTenantOrgAlias.d.ts +22 -0
- package/dist/types/commands/setNodeOrgId.d.ts +22 -0
- package/dist/types/commands/setTenantOrgId.d.ts +55 -0
- package/dist/types/commands/tenantCreate.d.ts +3 -0
- package/dist/types/defaults.d.ts +0 -1
- package/dist/types/models/ICliCommandDefinition.d.ts +5 -0
- package/dist/types/models/IEngineEnvironmentVariables.d.ts +8 -4
- package/dist/types/models/INodeEngineState.d.ts +5 -0
- package/docs/changelog.md +7 -0
- package/docs/reference/functions/buildEngineConfiguration.md +1 -7
- package/docs/reference/index.md +0 -2
- package/docs/reference/interfaces/ICliCommandDefinition.md +14 -0
- package/docs/reference/interfaces/IEngineEnvironmentVariables.md +16 -8
- package/docs/reference/interfaces/IEngineServerEnvironmentVariables.md +24 -12
- package/docs/reference/interfaces/INodeEngineState.md +9 -0
- package/docs/reference/interfaces/INodeEnvironmentVariables.md +24 -12
- package/locales/en.json +96 -34
- package/package.json +1 -1
- package/dist/es/commands/tenantToken.js +0 -97
- package/dist/es/commands/tenantToken.js.map +0 -1
- package/dist/types/commands/tenantToken.d.ts +0 -28
- package/docs/reference/functions/isUrlTransformerRequired.md +0 -20
- package/docs/reference/variables/URL_TRANSFORMER_ENCRYPTION_KEY_ID.md +0 -3
|
@@ -15,6 +15,7 @@ export declare function getCommandDefinitionTenantCreate(commandDefinitions: {
|
|
|
15
15
|
* @param params The parameters for the command.
|
|
16
16
|
* @param params.apiKey The api key to add.
|
|
17
17
|
* @param params.tenantId The tenant ID to add the api key to.
|
|
18
|
+
* @param params.organizationId The organization DID to associate with the tenant.
|
|
18
19
|
* @param params.label The label for the api key.
|
|
19
20
|
* @param params.publicOrigin The public URL origin for the tenant.
|
|
20
21
|
* @param params.outputJson The output .json file to store the command output.
|
|
@@ -25,6 +26,7 @@ export declare function getCommandDefinitionTenantCreate(commandDefinitions: {
|
|
|
25
26
|
export declare function tenantCreate(engineCore: IEngineCore, envVars: INodeEnvironmentVariables, params: {
|
|
26
27
|
apiKey?: string;
|
|
27
28
|
tenantId?: string;
|
|
29
|
+
organizationId?: string;
|
|
28
30
|
label?: string;
|
|
29
31
|
publicOrigin?: string;
|
|
30
32
|
outputJson?: string;
|
|
@@ -33,6 +35,7 @@ export declare function tenantCreate(engineCore: IEngineCore, envVars: INodeEnvi
|
|
|
33
35
|
}): Promise<{
|
|
34
36
|
apiKey: string;
|
|
35
37
|
tenantId: string;
|
|
38
|
+
organizationId?: string;
|
|
36
39
|
label: string;
|
|
37
40
|
publicOrigin: string;
|
|
38
41
|
}>;
|
package/dist/types/defaults.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export declare const IMMUTABLE_PROOF_VERIFICATION_METHOD_ID = "immutable-proof-a
|
|
|
3
3
|
export declare const BLOB_STORAGE_ENCRYPTION_KEY_ID = "blob-encryption";
|
|
4
4
|
export declare const TRUST_VERIFICATION_METHOD_ID = "trust-assertion";
|
|
5
5
|
export declare const AUTH_SIGNING_KEY_ID = "auth-signing";
|
|
6
|
-
export declare const URL_TRANSFORMER_ENCRYPTION_KEY_ID = "param-encryption";
|
|
7
6
|
export declare const CONTEXT_ID_HANDLER_FEATURE_DID = "did";
|
|
8
7
|
export declare const CONTEXT_ID_HANDLER_FEATURE_TENANT = "tenant";
|
|
9
8
|
/**
|
|
@@ -288,6 +288,10 @@ export interface IEngineEnvironmentVariables {
|
|
|
288
288
|
* The batch flush interval in seconds for the logging task, how often to flush the logs when using batching, defaults to 5 seconds.
|
|
289
289
|
*/
|
|
290
290
|
loggingBatchFlushIntervalSeconds?: string;
|
|
291
|
+
/**
|
|
292
|
+
* A list of components to exclude from logging, can be a comma separated list of component Class names e.g. "ComponentA,ComponentB".
|
|
293
|
+
*/
|
|
294
|
+
loggingSilentComponents?: string;
|
|
291
295
|
/**
|
|
292
296
|
* The type of event bus connector: local.
|
|
293
297
|
*/
|
|
@@ -464,6 +468,10 @@ export interface IEngineEnvironmentVariables {
|
|
|
464
468
|
* The type of the default data extractor, can be a comma separated list: json-path.
|
|
465
469
|
*/
|
|
466
470
|
dataExtractorConnectors?: string;
|
|
471
|
+
/**
|
|
472
|
+
* Enable the task scheduler regardless of which other components are active, defaults to false.
|
|
473
|
+
*/
|
|
474
|
+
taskSchedulerEnabled?: string;
|
|
467
475
|
/**
|
|
468
476
|
* Is the auditable item graph enabled, defaults to false.
|
|
469
477
|
*/
|
|
@@ -587,10 +595,6 @@ export interface IEngineEnvironmentVariables {
|
|
|
587
595
|
* This allows components that take a long time to initialize to be healthy before the first health check is performed.
|
|
588
596
|
*/
|
|
589
597
|
healthStartupIntervalSeconds?: string;
|
|
590
|
-
/**
|
|
591
|
-
* The id of the key in the vault to use for encrypting parameters in url transformer.
|
|
592
|
-
*/
|
|
593
|
-
urlTransformerEncryptionKeyId?: string;
|
|
594
598
|
/**
|
|
595
599
|
* The type of the automation action to create, comma separate for more than one connector.
|
|
596
600
|
* values: fetch
|
|
@@ -7,4 +7,9 @@ export interface INodeEngineState extends IEngineState {
|
|
|
7
7
|
* The identity for the node.
|
|
8
8
|
*/
|
|
9
9
|
nodeId?: string;
|
|
10
|
+
/**
|
|
11
|
+
* This is the default organization used in the context ids when a user is not authenticated.
|
|
12
|
+
* It is not used in multi-tenant mode, which gets the organization from the tenant table.
|
|
13
|
+
*/
|
|
14
|
+
nodeOrganizationId?: string;
|
|
10
15
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.53](https://github.com/iotaledger/twin-node/compare/node-core-v0.0.3-next.52...node-core-v0.0.3-next.53) (2026-06-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* organization identifiers ([#203](https://github.com/iotaledger/twin-node/issues/203)) ([1a6b176](https://github.com/iotaledger/twin-node/commit/1a6b1760d9f8e43a769407668426c70e1c8e1aa8))
|
|
9
|
+
|
|
3
10
|
## [0.0.3-next.52](https://github.com/iotaledger/twin-node/compare/node-core-v0.0.3-next.51...node-core-v0.0.3-next.52) (2026-06-09)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Function: buildEngineConfiguration()
|
|
2
2
|
|
|
3
|
-
> **buildEngineConfiguration**(`envVars
|
|
3
|
+
> **buildEngineConfiguration**(`envVars`): `Promise`\<`IEngineConfig`\>
|
|
4
4
|
|
|
5
5
|
Build the engine core configuration from environment variables.
|
|
6
6
|
|
|
@@ -12,12 +12,6 @@ Build the engine core configuration from environment variables.
|
|
|
12
12
|
|
|
13
13
|
The environment variables.
|
|
14
14
|
|
|
15
|
-
### contextIdKeys
|
|
16
|
-
|
|
17
|
-
`object`[]
|
|
18
|
-
|
|
19
|
-
The context ID keys.
|
|
20
|
-
|
|
21
15
|
## Returns
|
|
22
16
|
|
|
23
17
|
`Promise`\<`IEngineConfig`\>
|
package/docs/reference/index.md
CHANGED
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
- [BLOB\_STORAGE\_ENCRYPTION\_KEY\_ID](variables/BLOB_STORAGE_ENCRYPTION_KEY_ID.md)
|
|
33
33
|
- [TRUST\_VERIFICATION\_METHOD\_ID](variables/TRUST_VERIFICATION_METHOD_ID.md)
|
|
34
34
|
- [AUTH\_SIGNING\_KEY\_ID](variables/AUTH_SIGNING_KEY_ID.md)
|
|
35
|
-
- [URL\_TRANSFORMER\_ENCRYPTION\_KEY\_ID](variables/URL_TRANSFORMER_ENCRYPTION_KEY_ID.md)
|
|
36
35
|
- [CONTEXT\_ID\_HANDLER\_FEATURE\_DID](variables/CONTEXT_ID_HANDLER_FEATURE_DID.md)
|
|
37
36
|
- [CONTEXT\_ID\_HANDLER\_FEATURE\_TENANT](variables/CONTEXT_ID_HANDLER_FEATURE_TENANT.md)
|
|
38
37
|
- [ModuleProtocol](variables/ModuleProtocol.md)
|
|
@@ -41,7 +40,6 @@
|
|
|
41
40
|
|
|
42
41
|
- [buildEngineConfiguration](functions/buildEngineConfiguration.md)
|
|
43
42
|
- [isTrustRequired](functions/isTrustRequired.md)
|
|
44
|
-
- [isUrlTransformerRequired](functions/isUrlTransformerRequired.md)
|
|
45
43
|
- [isBackgroundTasksRequired](functions/isBackgroundTasksRequired.md)
|
|
46
44
|
- [isImmutableProofRequired](functions/isImmutableProofRequired.md)
|
|
47
45
|
- [isFederatedCatalogueRequired](functions/isFederatedCatalogueRequired.md)
|
|
@@ -85,3 +85,17 @@ Indicates whether the engine needs the node identity to be set if configured to
|
|
|
85
85
|
```ts
|
|
86
86
|
true
|
|
87
87
|
```
|
|
88
|
+
|
|
89
|
+
***
|
|
90
|
+
|
|
91
|
+
### requiresOrgIdentity? {#requiresorgidentity}
|
|
92
|
+
|
|
93
|
+
> `optional` **requiresOrgIdentity?**: `boolean`
|
|
94
|
+
|
|
95
|
+
Indicates whether the engine needs the organization identity to be set.
|
|
96
|
+
|
|
97
|
+
#### Default
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
true
|
|
101
|
+
```
|
|
@@ -578,6 +578,14 @@ The batch flush interval in seconds for the logging task, how often to flush the
|
|
|
578
578
|
|
|
579
579
|
***
|
|
580
580
|
|
|
581
|
+
### loggingSilentComponents? {#loggingsilentcomponents}
|
|
582
|
+
|
|
583
|
+
> `optional` **loggingSilentComponents?**: `string`
|
|
584
|
+
|
|
585
|
+
A list of components to exclude from logging, can be a comma separated list of component Class names e.g. "ComponentA,ComponentB".
|
|
586
|
+
|
|
587
|
+
***
|
|
588
|
+
|
|
581
589
|
### eventBusConnector? {#eventbusconnector}
|
|
582
590
|
|
|
583
591
|
> `optional` **eventBusConnector?**: `string`
|
|
@@ -930,6 +938,14 @@ The type of the default data extractor, can be a comma separated list: json-path
|
|
|
930
938
|
|
|
931
939
|
***
|
|
932
940
|
|
|
941
|
+
### taskSchedulerEnabled? {#taskschedulerenabled}
|
|
942
|
+
|
|
943
|
+
> `optional` **taskSchedulerEnabled?**: `string`
|
|
944
|
+
|
|
945
|
+
Enable the task scheduler regardless of which other components are active, defaults to false.
|
|
946
|
+
|
|
947
|
+
***
|
|
948
|
+
|
|
933
949
|
### auditableItemGraphEnabled? {#auditableitemgraphenabled}
|
|
934
950
|
|
|
935
951
|
> `optional` **auditableItemGraphEnabled?**: `string`
|
|
@@ -1171,14 +1187,6 @@ This allows components that take a long time to initialize to be healthy before
|
|
|
1171
1187
|
|
|
1172
1188
|
***
|
|
1173
1189
|
|
|
1174
|
-
### urlTransformerEncryptionKeyId? {#urltransformerencryptionkeyid}
|
|
1175
|
-
|
|
1176
|
-
> `optional` **urlTransformerEncryptionKeyId?**: `string`
|
|
1177
|
-
|
|
1178
|
-
The id of the key in the vault to use for encrypting parameters in url transformer.
|
|
1179
|
-
|
|
1180
|
-
***
|
|
1181
|
-
|
|
1182
1190
|
### automationActionTypes? {#automationactiontypes}
|
|
1183
1191
|
|
|
1184
1192
|
> `optional` **automationActionTypes?**: `string`
|
|
@@ -866,6 +866,18 @@ The batch flush interval in seconds for the logging task, how often to flush the
|
|
|
866
866
|
|
|
867
867
|
***
|
|
868
868
|
|
|
869
|
+
### loggingSilentComponents? {#loggingsilentcomponents}
|
|
870
|
+
|
|
871
|
+
> `optional` **loggingSilentComponents?**: `string`
|
|
872
|
+
|
|
873
|
+
A list of components to exclude from logging, can be a comma separated list of component Class names e.g. "ComponentA,ComponentB".
|
|
874
|
+
|
|
875
|
+
#### Inherited from
|
|
876
|
+
|
|
877
|
+
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`loggingSilentComponents`](IEngineEnvironmentVariables.md#loggingsilentcomponents)
|
|
878
|
+
|
|
879
|
+
***
|
|
880
|
+
|
|
869
881
|
### eventBusConnector? {#eventbusconnector}
|
|
870
882
|
|
|
871
883
|
> `optional` **eventBusConnector?**: `string`
|
|
@@ -1394,6 +1406,18 @@ The type of the default data extractor, can be a comma separated list: json-path
|
|
|
1394
1406
|
|
|
1395
1407
|
***
|
|
1396
1408
|
|
|
1409
|
+
### taskSchedulerEnabled? {#taskschedulerenabled}
|
|
1410
|
+
|
|
1411
|
+
> `optional` **taskSchedulerEnabled?**: `string`
|
|
1412
|
+
|
|
1413
|
+
Enable the task scheduler regardless of which other components are active, defaults to false.
|
|
1414
|
+
|
|
1415
|
+
#### Inherited from
|
|
1416
|
+
|
|
1417
|
+
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`taskSchedulerEnabled`](IEngineEnvironmentVariables.md#taskschedulerenabled)
|
|
1418
|
+
|
|
1419
|
+
***
|
|
1420
|
+
|
|
1397
1421
|
### auditableItemGraphEnabled? {#auditableitemgraphenabled}
|
|
1398
1422
|
|
|
1399
1423
|
> `optional` **auditableItemGraphEnabled?**: `string`
|
|
@@ -1743,18 +1767,6 @@ This allows components that take a long time to initialize to be healthy before
|
|
|
1743
1767
|
|
|
1744
1768
|
***
|
|
1745
1769
|
|
|
1746
|
-
### urlTransformerEncryptionKeyId? {#urltransformerencryptionkeyid}
|
|
1747
|
-
|
|
1748
|
-
> `optional` **urlTransformerEncryptionKeyId?**: `string`
|
|
1749
|
-
|
|
1750
|
-
The id of the key in the vault to use for encrypting parameters in url transformer.
|
|
1751
|
-
|
|
1752
|
-
#### Inherited from
|
|
1753
|
-
|
|
1754
|
-
[`IEngineEnvironmentVariables`](IEngineEnvironmentVariables.md).[`urlTransformerEncryptionKeyId`](IEngineEnvironmentVariables.md#urltransformerencryptionkeyid)
|
|
1755
|
-
|
|
1756
|
-
***
|
|
1757
|
-
|
|
1758
1770
|
### automationActionTypes? {#automationactiontypes}
|
|
1759
1771
|
|
|
1760
1772
|
> `optional` **automationActionTypes?**: `string`
|
|
@@ -13,3 +13,12 @@ The engine state for the node.
|
|
|
13
13
|
> `optional` **nodeId?**: `string`
|
|
14
14
|
|
|
15
15
|
The identity for the node.
|
|
16
|
+
|
|
17
|
+
***
|
|
18
|
+
|
|
19
|
+
### nodeOrganizationId? {#nodeorganizationid}
|
|
20
|
+
|
|
21
|
+
> `optional` **nodeOrganizationId?**: `string`
|
|
22
|
+
|
|
23
|
+
This is the default organization used in the context ids when a user is not authenticated.
|
|
24
|
+
It is not used in multi-tenant mode, which gets the organization from the tenant table.
|
|
@@ -862,6 +862,18 @@ The batch flush interval in seconds for the logging task, how often to flush the
|
|
|
862
862
|
|
|
863
863
|
***
|
|
864
864
|
|
|
865
|
+
### loggingSilentComponents? {#loggingsilentcomponents}
|
|
866
|
+
|
|
867
|
+
> `optional` **loggingSilentComponents?**: `string`
|
|
868
|
+
|
|
869
|
+
A list of components to exclude from logging, can be a comma separated list of component Class names e.g. "ComponentA,ComponentB".
|
|
870
|
+
|
|
871
|
+
#### Inherited from
|
|
872
|
+
|
|
873
|
+
[`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`loggingSilentComponents`](IEngineServerEnvironmentVariables.md#loggingsilentcomponents)
|
|
874
|
+
|
|
875
|
+
***
|
|
876
|
+
|
|
865
877
|
### eventBusConnector? {#eventbusconnector}
|
|
866
878
|
|
|
867
879
|
> `optional` **eventBusConnector?**: `string`
|
|
@@ -1390,6 +1402,18 @@ The type of the default data extractor, can be a comma separated list: json-path
|
|
|
1390
1402
|
|
|
1391
1403
|
***
|
|
1392
1404
|
|
|
1405
|
+
### taskSchedulerEnabled? {#taskschedulerenabled}
|
|
1406
|
+
|
|
1407
|
+
> `optional` **taskSchedulerEnabled?**: `string`
|
|
1408
|
+
|
|
1409
|
+
Enable the task scheduler regardless of which other components are active, defaults to false.
|
|
1410
|
+
|
|
1411
|
+
#### Inherited from
|
|
1412
|
+
|
|
1413
|
+
[`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`taskSchedulerEnabled`](IEngineServerEnvironmentVariables.md#taskschedulerenabled)
|
|
1414
|
+
|
|
1415
|
+
***
|
|
1416
|
+
|
|
1393
1417
|
### auditableItemGraphEnabled? {#auditableitemgraphenabled}
|
|
1394
1418
|
|
|
1395
1419
|
> `optional` **auditableItemGraphEnabled?**: `string`
|
|
@@ -1739,18 +1763,6 @@ This allows components that take a long time to initialize to be healthy before
|
|
|
1739
1763
|
|
|
1740
1764
|
***
|
|
1741
1765
|
|
|
1742
|
-
### urlTransformerEncryptionKeyId? {#urltransformerencryptionkeyid}
|
|
1743
|
-
|
|
1744
|
-
> `optional` **urlTransformerEncryptionKeyId?**: `string`
|
|
1745
|
-
|
|
1746
|
-
The id of the key in the vault to use for encrypting parameters in url transformer.
|
|
1747
|
-
|
|
1748
|
-
#### Inherited from
|
|
1749
|
-
|
|
1750
|
-
[`IEngineServerEnvironmentVariables`](IEngineServerEnvironmentVariables.md).[`urlTransformerEncryptionKeyId`](IEngineServerEnvironmentVariables.md#urltransformerencryptionkeyid)
|
|
1751
|
-
|
|
1752
|
-
***
|
|
1753
|
-
|
|
1754
1766
|
### automationActionTypes? {#automationactiontypes}
|
|
1755
1767
|
|
|
1756
1768
|
> `optional` **automationActionTypes?**: `string`
|
package/locales/en.json
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
"error": {
|
|
3
3
|
"node": {
|
|
4
4
|
"nodeIdentityNotSet": "The node identity is enabled in config but is not set, please set it using the \"node-set-identity\" CLI command.",
|
|
5
|
+
"nodeOrganizationIdNotSet": "The node organization is not set, please set it using the \"set-node-org-id\".",
|
|
6
|
+
"tenantsWithoutOrganizationId": "The following tenants have no organization ID assigned. Use the \"set-tenant-org-id\" command to assign one before starting the node: {tenantIds}",
|
|
5
7
|
"storageFileRootNotSet": "{storageFileRoot} is not set, the server will not start without it, please set it in the shell or create a .env file",
|
|
6
8
|
"extensionLoadingError": "Failed to load extension \"{extension}\"",
|
|
7
9
|
"insecureProtocol": "Cannot load extension from insecure protocol: {protocol}. Only HTTPS is allowed for remote extensions.",
|
|
@@ -15,10 +17,12 @@
|
|
|
15
17
|
"invalidPublicOrigin": "The public origin \"{publicOrigin}\" is not a valid origin URL, it should be in the format \"protocol://host[:port]\"."
|
|
16
18
|
},
|
|
17
19
|
"bootstrapLegacy": {
|
|
18
|
-
"noFeaturesEnabled": "No features are enabled in legacy bootstrap mode, at least one feature must be enabled."
|
|
20
|
+
"noFeaturesEnabled": "No features are enabled in legacy bootstrap mode, at least one feature must be enabled.",
|
|
21
|
+
"organizationNotSet": "The organisation identity has not been set. Run bootstrap with the \"node-identity\" feature first."
|
|
19
22
|
},
|
|
20
23
|
"identityCreate": {
|
|
21
|
-
"invalidMnemonic": "The mnemonic is invalid, it should be 24 words from the standard wordlist."
|
|
24
|
+
"invalidMnemonic": "The mnemonic is invalid, it should be 24 words from the standard wordlist.",
|
|
25
|
+
"nodeOrganizationIdNotAvailableInMultiTenantMode": "The node-organization-id option is not available in multi-tenant mode, use tenant-organization-id instead."
|
|
22
26
|
},
|
|
23
27
|
"identityImport": {
|
|
24
28
|
"identityNotFound": "The identity was not found, it must be created on-chain already.",
|
|
@@ -33,11 +37,6 @@
|
|
|
33
37
|
"tenantCreate": {
|
|
34
38
|
"tenantAdminComponentNotRegistered": "Multi-tenant support must be enabled to use this command."
|
|
35
39
|
},
|
|
36
|
-
"tenantToken": {
|
|
37
|
-
"tenantIdOrApiKeyRequired": "Either a tenant ID or an API key must be provided.",
|
|
38
|
-
"urlTransformerComponentNotRegistered": "The URL transformer component is not registered, ensure the node is configured correctly.",
|
|
39
|
-
"tenantAdminComponentNotRegistered": "Multi-tenant support must be enabled to use this command."
|
|
40
|
-
},
|
|
41
40
|
"tenantImport": {
|
|
42
41
|
"tenantAdminComponentNotRegistered": "Multi-tenant support must be enabled to use this command."
|
|
43
42
|
},
|
|
@@ -57,6 +56,17 @@
|
|
|
57
56
|
},
|
|
58
57
|
"nodeSetIdentity": {
|
|
59
58
|
"identityNotFound": "The identity with DID \"{notFoundId}\" was not found in the system."
|
|
59
|
+
},
|
|
60
|
+
"setNodeOrgId": {
|
|
61
|
+
"notAvailableInMultiTenantMode": "The set-node-org-id command is not available in multi-tenant mode, use set-tenant-org-id instead."
|
|
62
|
+
},
|
|
63
|
+
"applyOrganizationIdToTenant": {
|
|
64
|
+
"tenantAdminComponentNotRegistered": "Multi-tenant support must be enabled to use this command.",
|
|
65
|
+
"organizationIdAlreadyInUse": "The organization ID \"{organizationId}\" is already assigned to tenant \"{conflictingTenantId}\"."
|
|
66
|
+
},
|
|
67
|
+
"removeTenantOrgAlias": {
|
|
68
|
+
"tenantAdminComponentNotRegistered": "Multi-tenant support must be enabled to use this command.",
|
|
69
|
+
"aliasNotFound": "The alias \"{alias}\" was not found in the tenant organization legacy list."
|
|
60
70
|
}
|
|
61
71
|
},
|
|
62
72
|
"node": {
|
|
@@ -71,6 +81,7 @@
|
|
|
71
81
|
"extensionHttpsDownloading": "Downloading HTTPS extension",
|
|
72
82
|
"extensionCacheExpired": "Cache expired for extension: {url}",
|
|
73
83
|
"extensionForceRefresh": "Force refresh enabled for extension: {url}",
|
|
84
|
+
"tenantOrganizationIdAutoAssigned": "Legacy migration: automatically assigned organization ID \"{organizationId}\" to tenant \"{tenantId}\".",
|
|
74
85
|
"cli": {
|
|
75
86
|
"commands": {
|
|
76
87
|
"command": "Command",
|
|
@@ -99,16 +110,18 @@
|
|
|
99
110
|
"labels": {
|
|
100
111
|
"nodeIdentityCreate": "Creating node identity",
|
|
101
112
|
"nodeAuthKeyCreate": "Creating node auth key",
|
|
102
|
-
"trustVerificationMethodCreate": "Creating trust verification method for
|
|
113
|
+
"trustVerificationMethodCreate": "Creating trust verification method for organisation identity",
|
|
103
114
|
"nodeIdentitySet": "Setting node identity",
|
|
104
115
|
"nodeTenantCreate": "Creating node tenant",
|
|
105
116
|
"organisationCreate": "Creating organisation identity",
|
|
106
117
|
"blobStorageKeyCreate": "Creating blob storage encryption key for organisation identity",
|
|
107
118
|
"attestationMethodCreate": "Creating attestation method for organisation identity",
|
|
108
119
|
"immutableProofMethodCreate": "Creating immutable proof method for organisation identity",
|
|
120
|
+
"nodeOrganizationIdSet": "Setting node organisation ID",
|
|
121
|
+
"tenantOrganizationIdSet": "Setting tenant organisation ID",
|
|
109
122
|
"adminIdentityCreate": "Creating admin user identity",
|
|
110
123
|
"adminUserCreate": "Creating admin user",
|
|
111
|
-
"
|
|
124
|
+
"tenantFallback": "No Node-labelled tenant found; using first available tenant"
|
|
112
125
|
}
|
|
113
126
|
},
|
|
114
127
|
"identity-create": {
|
|
@@ -141,6 +154,12 @@
|
|
|
141
154
|
},
|
|
142
155
|
"output-env-prefix": {
|
|
143
156
|
"description": "Prefix to use for variables in the output .env file."
|
|
157
|
+
},
|
|
158
|
+
"node-organization-id": {
|
|
159
|
+
"description": "If true, set the created identity DID as the node organization ID (not available in multi-tenant mode)."
|
|
160
|
+
},
|
|
161
|
+
"tenant-organization-id": {
|
|
162
|
+
"description": "The tenant ID to set the created identity DID as the organization ID for (requires multi-tenant mode)."
|
|
144
163
|
}
|
|
145
164
|
},
|
|
146
165
|
"labels": {
|
|
@@ -335,7 +354,7 @@
|
|
|
335
354
|
},
|
|
336
355
|
"tenant-create": {
|
|
337
356
|
"description": "Create a tenant with associated api key",
|
|
338
|
-
"example": "tenant-create --tenant-id=\"0011..aabb\" --api-key=\"aabb..0099\" --label=\"My Tenant\" --public-origin=\"https://example.com:1234\"",
|
|
357
|
+
"example": "tenant-create --tenant-id=\"0011..aabb\" --api-key=\"aabb..0099\" --organization-id=\"did:iota:...\" --label=\"My Tenant\" --public-origin=\"https://example.com:1234\"",
|
|
339
358
|
"params": {
|
|
340
359
|
"env-prefix": {
|
|
341
360
|
"description": "Prefix to use for standard .env files e.g. TWIN_."
|
|
@@ -346,6 +365,9 @@
|
|
|
346
365
|
"api-key": {
|
|
347
366
|
"description": "The API key to associate with the tenant id. If not provided, a random key will be generated."
|
|
348
367
|
},
|
|
368
|
+
"organization-id": {
|
|
369
|
+
"description": "The organization DID to associate with the tenant."
|
|
370
|
+
},
|
|
349
371
|
"label": {
|
|
350
372
|
"description": "A descriptive label for the tenant."
|
|
351
373
|
},
|
|
@@ -369,6 +391,7 @@
|
|
|
369
391
|
"creating": "Creating tenant",
|
|
370
392
|
"tenantId": "Tenant ID",
|
|
371
393
|
"apiKey": "API Key",
|
|
394
|
+
"organizationId": "Organization ID",
|
|
372
395
|
"label": "Label",
|
|
373
396
|
"publicOrigin": "Public Origin"
|
|
374
397
|
}
|
|
@@ -429,30 +452,6 @@
|
|
|
429
452
|
"updated": "Updated tenant"
|
|
430
453
|
}
|
|
431
454
|
},
|
|
432
|
-
"tenant-token": {
|
|
433
|
-
"description": "Generate the x-enc-tenant-token token value for a tenant",
|
|
434
|
-
"example": "tenant-token --tenant-id=\"0011..aabb\"",
|
|
435
|
-
"params": {
|
|
436
|
-
"tenant-id": {
|
|
437
|
-
"description": "The tenant ID to generate the token for."
|
|
438
|
-
},
|
|
439
|
-
"api-key": {
|
|
440
|
-
"description": "The API key to look up the tenant ID from."
|
|
441
|
-
},
|
|
442
|
-
"load-env": {
|
|
443
|
-
"description": "Comma separated list of paths to .env files to read input parameters from."
|
|
444
|
-
},
|
|
445
|
-
"output-json": {
|
|
446
|
-
"description": "Path to a .json file to store the command output."
|
|
447
|
-
}
|
|
448
|
-
},
|
|
449
|
-
"labels": {
|
|
450
|
-
"lookingUp": "Looking up tenant",
|
|
451
|
-
"generating": "Generating tenant token",
|
|
452
|
-
"tenantId": "Tenant ID",
|
|
453
|
-
"token": "Token"
|
|
454
|
-
}
|
|
455
|
-
},
|
|
456
455
|
"user-create": {
|
|
457
456
|
"description": "Create a user",
|
|
458
457
|
"example": "user-create --user-identity=\"did:iota:....\" --organization-identity=\"did:iota:....\" --email=\"bob@examples.com\" --password=\"pass1234\" --scope=\"tenant-admin\" --givenName=\"Bob\" --familyName=\"Smith\"",
|
|
@@ -595,6 +594,69 @@
|
|
|
595
594
|
"publicKeyHex": "Public Key Hex"
|
|
596
595
|
}
|
|
597
596
|
},
|
|
597
|
+
"set-node-org-id": {
|
|
598
|
+
"description": "Set the node organization ID",
|
|
599
|
+
"example": "set-node-org-id --organization-id=\"did:iota:...\"",
|
|
600
|
+
"params": {
|
|
601
|
+
"env-prefix": {
|
|
602
|
+
"description": "Prefix to use for standard .env files e.g. TWIN_."
|
|
603
|
+
},
|
|
604
|
+
"organization-id": {
|
|
605
|
+
"description": "The organization DID to set as the node organization ID."
|
|
606
|
+
},
|
|
607
|
+
"load-env": {
|
|
608
|
+
"description": "Comma separated list of paths to .env files to read input parameters from."
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
"labels": {
|
|
612
|
+
"stored": "The node organization ID has been stored"
|
|
613
|
+
}
|
|
614
|
+
},
|
|
615
|
+
"set-tenant-org-id": {
|
|
616
|
+
"description": "Set the organization ID for a tenant",
|
|
617
|
+
"example": "set-tenant-org-id --tenant-id=\"0011..aabb\" --organization-id=\"did:iota:...\"",
|
|
618
|
+
"params": {
|
|
619
|
+
"env-prefix": {
|
|
620
|
+
"description": "Prefix to use for standard .env files e.g. TWIN_."
|
|
621
|
+
},
|
|
622
|
+
"tenant-id": {
|
|
623
|
+
"description": "The tenant ID to update."
|
|
624
|
+
},
|
|
625
|
+
"organization-id": {
|
|
626
|
+
"description": "The organization DID to set as the tenant organization ID."
|
|
627
|
+
},
|
|
628
|
+
"load-env": {
|
|
629
|
+
"description": "Comma separated list of paths to .env files to read input parameters from."
|
|
630
|
+
}
|
|
631
|
+
},
|
|
632
|
+
"labels": {
|
|
633
|
+
"updating": "Updating tenant organization ID",
|
|
634
|
+
"stored": "The tenant organization ID has been stored"
|
|
635
|
+
}
|
|
636
|
+
},
|
|
637
|
+
"remove-tenant-org-alias": {
|
|
638
|
+
"description": "Remove an alias from the tenant organization ID legacy list",
|
|
639
|
+
"example": "remove-tenant-org-alias --tenant-id=\"0011..aabb\" --alias=\"did:iota:...\"",
|
|
640
|
+
"params": {
|
|
641
|
+
"env-prefix": {
|
|
642
|
+
"description": "Prefix to use for standard .env files e.g. TWIN_."
|
|
643
|
+
},
|
|
644
|
+
"tenant-id": {
|
|
645
|
+
"description": "The tenant ID to update."
|
|
646
|
+
},
|
|
647
|
+
"alias": {
|
|
648
|
+
"description": "The organization DID alias to remove from the legacy list."
|
|
649
|
+
},
|
|
650
|
+
"load-env": {
|
|
651
|
+
"description": "Comma separated list of paths to .env files to read input parameters from."
|
|
652
|
+
}
|
|
653
|
+
},
|
|
654
|
+
"labels": {
|
|
655
|
+
"reading": "Reading tenant",
|
|
656
|
+
"updating": "Removing alias from tenant organization legacy list",
|
|
657
|
+
"removed": "The alias has been removed from the tenant organization legacy list"
|
|
658
|
+
}
|
|
659
|
+
},
|
|
598
660
|
"vault-key-import": {
|
|
599
661
|
"description": "Import a vault key for an identity",
|
|
600
662
|
"example": "vault-key-import --identity=\"did:iota:....\" --key-id=\"my-key\" --key-type=Ed25519 --private-key-hex=\"15...a2\"",
|
package/package.json
CHANGED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { CLIDisplay, CLIUtils } from "@twin.org/cli-core";
|
|
2
|
-
import { ComponentFactory, GeneralError, Guards, I18n, Is } from "@twin.org/core";
|
|
3
|
-
const COMMAND_NAME = "tenant-token";
|
|
4
|
-
/**
|
|
5
|
-
* Get the command definition parameters.
|
|
6
|
-
* @param commandDefinitions The registered command definitions.
|
|
7
|
-
*/
|
|
8
|
-
export function getCommandDefinitionTenantToken(commandDefinitions) {
|
|
9
|
-
commandDefinitions[COMMAND_NAME] = {
|
|
10
|
-
command: COMMAND_NAME,
|
|
11
|
-
description: I18n.formatMessage("node.cli.commands.tenant-token.description"),
|
|
12
|
-
example: I18n.formatMessage("node.cli.commands.tenant-token.example"),
|
|
13
|
-
params: [
|
|
14
|
-
{
|
|
15
|
-
key: "tenant-id",
|
|
16
|
-
type: "string",
|
|
17
|
-
extendedType: "hex(32)",
|
|
18
|
-
description: I18n.formatMessage("node.cli.commands.tenant-token.params.tenant-id.description"),
|
|
19
|
-
required: false
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
key: "api-key",
|
|
23
|
-
type: "string",
|
|
24
|
-
extendedType: "hex(32)",
|
|
25
|
-
description: I18n.formatMessage("node.cli.commands.tenant-token.params.api-key.description"),
|
|
26
|
-
required: false
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
key: "load-env",
|
|
30
|
-
type: "string",
|
|
31
|
-
description: I18n.formatMessage("node.cli.commands.tenant-token.params.load-env.description"),
|
|
32
|
-
required: false
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
key: "output-json",
|
|
36
|
-
type: "string",
|
|
37
|
-
description: I18n.formatMessage("node.cli.commands.tenant-token.params.output-json.description"),
|
|
38
|
-
required: false
|
|
39
|
-
}
|
|
40
|
-
],
|
|
41
|
-
action: async (engineCore, envVars, params) => tenantToken(engineCore, envVars, params)
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Command for generating the x-enc-tenant-token token value for a tenant.
|
|
46
|
-
* @param engineCore The engine core.
|
|
47
|
-
* @param envVars The environment variables for the node.
|
|
48
|
-
* @param params The parameters for the command.
|
|
49
|
-
* @param params.tenantId The tenant ID to generate the token for.
|
|
50
|
-
* @param params.apiKey The API key to look up the tenant ID from.
|
|
51
|
-
* @param params.outputJson The output .json file to store the command output.
|
|
52
|
-
* @returns The tenant ID and generated encrypted token.
|
|
53
|
-
*/
|
|
54
|
-
export async function tenantToken(engineCore, envVars, params) {
|
|
55
|
-
if (!Is.stringValue(params.tenantId) && !Is.stringValue(params.apiKey)) {
|
|
56
|
-
throw new GeneralError("tenantToken", "tenantIdOrApiKeyRequired");
|
|
57
|
-
}
|
|
58
|
-
if (Is.stringValue(params.tenantId)) {
|
|
59
|
-
Guards.stringHexLength("tenantToken", "tenant-id", params.tenantId, 32);
|
|
60
|
-
}
|
|
61
|
-
if (Is.stringValue(params.apiKey)) {
|
|
62
|
-
Guards.stringHexLength("tenantToken", "api-key", params.apiKey, 32);
|
|
63
|
-
}
|
|
64
|
-
const urlTransformerComponentType = engineCore.getRegisteredInstanceTypeOptional("urlTransformerComponent");
|
|
65
|
-
if (!Is.stringValue(urlTransformerComponentType)) {
|
|
66
|
-
throw new GeneralError("tenantToken", "urlTransformerComponentNotRegistered");
|
|
67
|
-
}
|
|
68
|
-
const urlTransformer = ComponentFactory.get(urlTransformerComponentType);
|
|
69
|
-
// CLI commands skip component starts (engineCore.start(true)), so the URL transformer
|
|
70
|
-
// service's _nodeId is never initialized. Starting it here within the ContextIdStore
|
|
71
|
-
// context (set by executeCommand) lets it pick up the nodeId correctly.
|
|
72
|
-
await urlTransformer.start?.();
|
|
73
|
-
let tenantId = params.tenantId;
|
|
74
|
-
if (!Is.stringValue(tenantId)) {
|
|
75
|
-
const tenantAdminServiceComponentType = engineCore.getRegisteredInstanceTypeOptional("tenantAdminComponent");
|
|
76
|
-
if (!Is.stringValue(tenantAdminServiceComponentType)) {
|
|
77
|
-
throw new GeneralError("tenantToken", "tenantAdminComponentNotRegistered");
|
|
78
|
-
}
|
|
79
|
-
const tenantAdminService = ComponentFactory.get(tenantAdminServiceComponentType);
|
|
80
|
-
CLIDisplay.task(I18n.formatMessage("node.cli.commands.tenant-token.labels.lookingUp"));
|
|
81
|
-
const tenant = await tenantAdminService.getByApiKey(params.apiKey);
|
|
82
|
-
tenantId = tenant.id;
|
|
83
|
-
}
|
|
84
|
-
CLIDisplay.task(I18n.formatMessage("node.cli.commands.tenant-token.labels.generating"));
|
|
85
|
-
const token = await urlTransformer.encryptParam(tenantId);
|
|
86
|
-
CLIDisplay.break();
|
|
87
|
-
CLIDisplay.value(I18n.formatMessage("node.cli.commands.tenant-token.labels.tenantId"), tenantId);
|
|
88
|
-
CLIDisplay.value(I18n.formatMessage("node.cli.commands.tenant-token.labels.token"), token);
|
|
89
|
-
CLIDisplay.break();
|
|
90
|
-
const json = { tenantId, token };
|
|
91
|
-
if (Is.stringValue(params.outputJson)) {
|
|
92
|
-
await CLIUtils.writeJsonFile(params.outputJson, json, false);
|
|
93
|
-
}
|
|
94
|
-
CLIDisplay.done();
|
|
95
|
-
return json;
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=tenantToken.js.map
|