@twin.org/entity-storage-connector-dynamodb 0.0.2-next.8 → 0.0.2-next.9
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/cjs/index.cjs
CHANGED
|
@@ -54,8 +54,11 @@ class DynamoDbEntityStorageConnector {
|
|
|
54
54
|
core.Guards.object(this.CLASS_NAME, "options", options);
|
|
55
55
|
core.Guards.stringValue(this.CLASS_NAME, "options.entitySchema", options.entitySchema);
|
|
56
56
|
core.Guards.object(this.CLASS_NAME, "options.config", options.config);
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
options.config.authMode ??= "credentials";
|
|
58
|
+
if (options.config.authMode === "credentials") {
|
|
59
|
+
core.Guards.stringValue(this.CLASS_NAME, "options.config.accessKeyId", options.config.accessKeyId);
|
|
60
|
+
core.Guards.stringValue(this.CLASS_NAME, "options.config.secretAccessKey", options.config.secretAccessKey);
|
|
61
|
+
}
|
|
59
62
|
core.Guards.stringValue(this.CLASS_NAME, "options.config.region", options.config.region);
|
|
60
63
|
core.Guards.stringValue(this.CLASS_NAME, "options.config.tableName", options.config.tableName);
|
|
61
64
|
this._entitySchema = entity.EntitySchemaFactory.get(options.entitySchema);
|
|
@@ -584,11 +587,19 @@ class DynamoDbEntityStorageConnector {
|
|
|
584
587
|
* @internal
|
|
585
588
|
*/
|
|
586
589
|
createConnectionConfig() {
|
|
590
|
+
if (core.Is.stringValue(this._config.secretAccessKey) &&
|
|
591
|
+
core.Is.stringValue(this._config.accessKeyId) &&
|
|
592
|
+
this._config.authMode === "credentials") {
|
|
593
|
+
return {
|
|
594
|
+
credentials: {
|
|
595
|
+
accessKeyId: this._config.accessKeyId,
|
|
596
|
+
secretAccessKey: this._config.secretAccessKey
|
|
597
|
+
},
|
|
598
|
+
endpoint: this._config.endpoint,
|
|
599
|
+
region: this._config.region
|
|
600
|
+
};
|
|
601
|
+
}
|
|
587
602
|
return {
|
|
588
|
-
credentials: {
|
|
589
|
-
accessKeyId: this._config.accessKeyId,
|
|
590
|
-
secretAccessKey: this._config.secretAccessKey
|
|
591
|
-
},
|
|
592
603
|
endpoint: this._config.endpoint,
|
|
593
604
|
region: this._config.region
|
|
594
605
|
};
|
package/dist/esm/index.mjs
CHANGED
|
@@ -52,8 +52,11 @@ class DynamoDbEntityStorageConnector {
|
|
|
52
52
|
Guards.object(this.CLASS_NAME, "options", options);
|
|
53
53
|
Guards.stringValue(this.CLASS_NAME, "options.entitySchema", options.entitySchema);
|
|
54
54
|
Guards.object(this.CLASS_NAME, "options.config", options.config);
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
options.config.authMode ??= "credentials";
|
|
56
|
+
if (options.config.authMode === "credentials") {
|
|
57
|
+
Guards.stringValue(this.CLASS_NAME, "options.config.accessKeyId", options.config.accessKeyId);
|
|
58
|
+
Guards.stringValue(this.CLASS_NAME, "options.config.secretAccessKey", options.config.secretAccessKey);
|
|
59
|
+
}
|
|
57
60
|
Guards.stringValue(this.CLASS_NAME, "options.config.region", options.config.region);
|
|
58
61
|
Guards.stringValue(this.CLASS_NAME, "options.config.tableName", options.config.tableName);
|
|
59
62
|
this._entitySchema = EntitySchemaFactory.get(options.entitySchema);
|
|
@@ -582,11 +585,19 @@ class DynamoDbEntityStorageConnector {
|
|
|
582
585
|
* @internal
|
|
583
586
|
*/
|
|
584
587
|
createConnectionConfig() {
|
|
588
|
+
if (Is.stringValue(this._config.secretAccessKey) &&
|
|
589
|
+
Is.stringValue(this._config.accessKeyId) &&
|
|
590
|
+
this._config.authMode === "credentials") {
|
|
591
|
+
return {
|
|
592
|
+
credentials: {
|
|
593
|
+
accessKeyId: this._config.accessKeyId,
|
|
594
|
+
secretAccessKey: this._config.secretAccessKey
|
|
595
|
+
},
|
|
596
|
+
endpoint: this._config.endpoint,
|
|
597
|
+
region: this._config.region
|
|
598
|
+
};
|
|
599
|
+
}
|
|
585
600
|
return {
|
|
586
|
-
credentials: {
|
|
587
|
-
accessKeyId: this._config.accessKeyId,
|
|
588
|
-
secretAccessKey: this._config.secretAccessKey
|
|
589
|
-
},
|
|
590
601
|
endpoint: this._config.endpoint,
|
|
591
602
|
region: this._config.region
|
|
592
603
|
};
|
|
@@ -7,13 +7,20 @@ export interface IDynamoDbEntityStorageConnectorConfig {
|
|
|
7
7
|
*/
|
|
8
8
|
region: string;
|
|
9
9
|
/**
|
|
10
|
-
* The
|
|
10
|
+
* The authentication mode.
|
|
11
|
+
* - "credentials": Use access key ID and secret access key.
|
|
12
|
+
* - "pod": Use IAM role attached to the pod (e.g., in EKS).
|
|
13
|
+
* @default credentials
|
|
11
14
|
*/
|
|
12
|
-
|
|
15
|
+
authMode?: "credentials" | "pod";
|
|
16
|
+
/**
|
|
17
|
+
* The AWS access key ID.
|
|
18
|
+
*/
|
|
19
|
+
accessKeyId?: string;
|
|
13
20
|
/**
|
|
14
21
|
* The AWS secret access key.
|
|
15
22
|
*/
|
|
16
|
-
secretAccessKey
|
|
23
|
+
secretAccessKey?: string;
|
|
17
24
|
/**
|
|
18
25
|
* The name of the table for the storage.
|
|
19
26
|
*/
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @twin.org/entity-storage-connector-dynamodb - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.9](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-dynamodb-v0.0.2-next.8...entity-storage-connector-dynamodb-v0.0.2-next.9) (2025-10-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add AWS pod authentication mode ([caaae36](https://github.com/twinfoundation/entity-storage/commit/caaae368ca104cd9994e1af7b6c4c20e603c2021))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/entity-storage-models bumped from 0.0.2-next.8 to 0.0.2-next.9
|
|
16
|
+
* devDependencies
|
|
17
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.8 to 0.0.2-next.9
|
|
18
|
+
|
|
3
19
|
## [0.0.2-next.8](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-dynamodb-v0.0.2-next.7...entity-storage-connector-dynamodb-v0.0.2-next.8) (2025-08-29)
|
|
4
20
|
|
|
5
21
|
|
|
@@ -12,17 +12,33 @@ The region for the AWS connection.
|
|
|
12
12
|
|
|
13
13
|
***
|
|
14
14
|
|
|
15
|
-
###
|
|
15
|
+
### authMode?
|
|
16
16
|
|
|
17
|
-
> **
|
|
17
|
+
> `optional` **authMode**: `"credentials"` \| `"pod"`
|
|
18
18
|
|
|
19
|
-
The
|
|
19
|
+
The authentication mode.
|
|
20
|
+
- "credentials": Use access key ID and secret access key.
|
|
21
|
+
- "pod": Use IAM role attached to the pod (e.g., in EKS).
|
|
22
|
+
|
|
23
|
+
#### Default
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
credentials
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
***
|
|
30
|
+
|
|
31
|
+
### accessKeyId?
|
|
32
|
+
|
|
33
|
+
> `optional` **accessKeyId**: `string`
|
|
34
|
+
|
|
35
|
+
The AWS access key ID.
|
|
20
36
|
|
|
21
37
|
***
|
|
22
38
|
|
|
23
|
-
### secretAccessKey
|
|
39
|
+
### secretAccessKey?
|
|
24
40
|
|
|
25
|
-
> **secretAccessKey**: `string`
|
|
41
|
+
> `optional` **secretAccessKey**: `string`
|
|
26
42
|
|
|
27
43
|
The AWS secret access key.
|
|
28
44
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/entity-storage-connector-dynamodb",
|
|
3
|
-
"version": "0.0.2-next.
|
|
3
|
+
"version": "0.0.2-next.9",
|
|
4
4
|
"description": "Entity Storage connector implementation using DynamoDb storage",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@aws-sdk/client-dynamodb": "3.
|
|
18
|
-
"@aws-sdk/lib-dynamodb": "3.
|
|
19
|
-
"@aws-sdk/util-dynamodb": "3.
|
|
17
|
+
"@aws-sdk/client-dynamodb": "3.896",
|
|
18
|
+
"@aws-sdk/lib-dynamodb": "3.896",
|
|
19
|
+
"@aws-sdk/util-dynamodb": "3.896",
|
|
20
20
|
"@twin.org/core": "next",
|
|
21
21
|
"@twin.org/entity": "next",
|
|
22
|
-
"@twin.org/entity-storage-models": "0.0.2-next.
|
|
22
|
+
"@twin.org/entity-storage-models": "0.0.2-next.9",
|
|
23
23
|
"@twin.org/logging-models": "next",
|
|
24
24
|
"@twin.org/nameof": "next"
|
|
25
25
|
},
|
|
@@ -40,5 +40,20 @@
|
|
|
40
40
|
"dist/types",
|
|
41
41
|
"locales",
|
|
42
42
|
"docs"
|
|
43
|
+
],
|
|
44
|
+
"keywords": [
|
|
45
|
+
"twin",
|
|
46
|
+
"trade",
|
|
47
|
+
"iota",
|
|
48
|
+
"framework",
|
|
49
|
+
"blockchain",
|
|
50
|
+
"entity-storage",
|
|
51
|
+
"entity",
|
|
52
|
+
"storage",
|
|
53
|
+
"persistence",
|
|
54
|
+
"database",
|
|
55
|
+
"connector",
|
|
56
|
+
"adapter",
|
|
57
|
+
"integration"
|
|
43
58
|
]
|
|
44
59
|
}
|