@twin.org/blob-storage-connector-aws-s3 0.0.2-next.3 → 0.0.2-next.4

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 CHANGED
@@ -13,7 +13,7 @@ npm install @twin.org/blob-storage-connector-aws-s3
13
13
  The tests developed are functional tests and need an instance of AWS S3 up and running. To run AWS S3 locally using local stack:
14
14
 
15
15
  ```shell
16
- docker run -p 4566:4566 -p 4510-4559:4510-4559 --name twin-blob-aws-s3 -d localstack/localstack -e AWS_DEFAULT_REGION='eu-central-1' -e AWS_ACCESS_KEY_ID='test' -e AWS_SECRET_ACCESS_KEY='test' -e SERVICE='S3'
16
+ docker run -p 4566:4566 --name twin-blob-aws-s3 -d localstack/localstack -e AWS_DEFAULT_REGION='eu-central-1' -e AWS_ACCESS_KEY_ID='test' -e AWS_SECRET_ACCESS_KEY='test' -e SERVICE='S3'
17
17
  ```
18
18
 
19
19
  Afterwards you can run the tests as follows:
@@ -38,16 +38,21 @@ class S3BlobStorageConnector {
38
38
  core.Guards.object(this.CLASS_NAME, "options.config", options.config);
39
39
  core.Guards.stringValue(this.CLASS_NAME, "options.config.region", options.config.region);
40
40
  core.Guards.stringValue(this.CLASS_NAME, "options.config.bucketName", options.config.bucketName);
41
- core.Guards.stringValue(this.CLASS_NAME, "options.config.accessKeyId", options.config.accessKeyId);
42
- core.Guards.stringValue(this.CLASS_NAME, "options.config.secretAccessKey", options.config.secretAccessKey);
41
+ options.config.authMode ??= "credentials";
42
+ let credentials;
43
+ if (options.config.authMode === "credentials") {
44
+ core.Guards.stringValue(this.CLASS_NAME, "options.config.accessKeyId", options.config.accessKeyId);
45
+ core.Guards.stringValue(this.CLASS_NAME, "options.config.secretAccessKey", options.config.secretAccessKey);
46
+ credentials = {
47
+ accessKeyId: options.config.accessKeyId,
48
+ secretAccessKey: options.config.secretAccessKey
49
+ };
50
+ }
43
51
  this._config = options.config;
44
52
  this._s3Client = new clientS3.S3Client({
45
53
  region: this._config.region,
46
54
  endpoint: this._config.endpoint,
47
- credentials: {
48
- accessKeyId: this._config.accessKeyId,
49
- secretAccessKey: this._config.secretAccessKey
50
- },
55
+ credentials,
51
56
  forcePathStyle: true
52
57
  });
53
58
  }
@@ -36,16 +36,21 @@ class S3BlobStorageConnector {
36
36
  Guards.object(this.CLASS_NAME, "options.config", options.config);
37
37
  Guards.stringValue(this.CLASS_NAME, "options.config.region", options.config.region);
38
38
  Guards.stringValue(this.CLASS_NAME, "options.config.bucketName", options.config.bucketName);
39
- Guards.stringValue(this.CLASS_NAME, "options.config.accessKeyId", options.config.accessKeyId);
40
- Guards.stringValue(this.CLASS_NAME, "options.config.secretAccessKey", options.config.secretAccessKey);
39
+ options.config.authMode ??= "credentials";
40
+ let credentials;
41
+ if (options.config.authMode === "credentials") {
42
+ Guards.stringValue(this.CLASS_NAME, "options.config.accessKeyId", options.config.accessKeyId);
43
+ Guards.stringValue(this.CLASS_NAME, "options.config.secretAccessKey", options.config.secretAccessKey);
44
+ credentials = {
45
+ accessKeyId: options.config.accessKeyId,
46
+ secretAccessKey: options.config.secretAccessKey
47
+ };
48
+ }
41
49
  this._config = options.config;
42
50
  this._s3Client = new S3Client({
43
51
  region: this._config.region,
44
52
  endpoint: this._config.endpoint,
45
- credentials: {
46
- accessKeyId: this._config.accessKeyId,
47
- secretAccessKey: this._config.secretAccessKey
48
- },
53
+ credentials,
49
54
  forcePathStyle: true
50
55
  });
51
56
  }
@@ -10,14 +10,21 @@ export interface IS3BlobStorageConnectorConfig {
10
10
  * The S3 bucket name.
11
11
  */
12
12
  bucketName: string;
13
+ /**
14
+ * The authentication mode.
15
+ * - "credentials": Use access key ID and secret access key.
16
+ * - "pod": Use IAM role attached to the pod (e.g., in EKS).
17
+ * @default credentials
18
+ */
19
+ authMode?: "credentials" | "pod";
13
20
  /**
14
21
  * The AWS access key ID.
15
22
  */
16
- accessKeyId: string;
23
+ accessKeyId?: string;
17
24
  /**
18
25
  * The AWS secret access key.
19
26
  */
20
- secretAccessKey: string;
27
+ secretAccessKey?: string;
21
28
  /**
22
29
  * Optional endpoint for S3-compatible storage (e.g., MinIO).
23
30
  */
package/docs/changelog.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @twin.org/blob-storage-connector-aws-s3 - Changelog
2
2
 
3
+ ## [0.0.2-next.4](https://github.com/twinfoundation/blob-storage/compare/blob-storage-connector-aws-s3-v0.0.2-next.3...blob-storage-connector-aws-s3-v0.0.2-next.4) (2025-10-02)
4
+
5
+
6
+ ### Features
7
+
8
+ * add AWS pod authentication mode ([c34b11c](https://github.com/twinfoundation/blob-storage/commit/c34b11cb32d3310a9e59840341a2b0b4221bc780))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/blob-storage-models bumped from 0.0.2-next.3 to 0.0.2-next.4
16
+
3
17
  ## [0.0.2-next.3](https://github.com/twinfoundation/blob-storage/compare/blob-storage-connector-aws-s3-v0.0.2-next.2...blob-storage-connector-aws-s3-v0.0.2-next.3) (2025-08-29)
4
18
 
5
19
 
@@ -20,17 +20,33 @@ The S3 bucket name.
20
20
 
21
21
  ***
22
22
 
23
- ### accessKeyId
23
+ ### authMode?
24
24
 
25
- > **accessKeyId**: `string`
25
+ > `optional` **authMode**: `"credentials"` \| `"pod"`
26
+
27
+ The authentication mode.
28
+ - "credentials": Use access key ID and secret access key.
29
+ - "pod": Use IAM role attached to the pod (e.g., in EKS).
30
+
31
+ #### Default
32
+
33
+ ```ts
34
+ credentials
35
+ ```
36
+
37
+ ***
38
+
39
+ ### accessKeyId?
40
+
41
+ > `optional` **accessKeyId**: `string`
26
42
 
27
43
  The AWS access key ID.
28
44
 
29
45
  ***
30
46
 
31
- ### secretAccessKey
47
+ ### secretAccessKey?
32
48
 
33
- > **secretAccessKey**: `string`
49
+ > `optional` **secretAccessKey**: `string`
34
50
 
35
51
  The AWS secret access key.
36
52
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/blob-storage-connector-aws-s3",
3
- "version": "0.0.2-next.3",
3
+ "version": "0.0.2-next.4",
4
4
  "description": "Blob Storage connector implementation using AWS S3",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,8 +14,8 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@aws-sdk/client-s3": "3.878.0",
18
- "@twin.org/blob-storage-models": "0.0.2-next.3",
17
+ "@aws-sdk/client-s3": "3.896.0",
18
+ "@twin.org/blob-storage-models": "0.0.2-next.4",
19
19
  "@twin.org/core": "next",
20
20
  "@twin.org/crypto": "next",
21
21
  "@twin.org/logging-models": "next",
@@ -38,5 +38,20 @@
38
38
  "dist/types",
39
39
  "locales",
40
40
  "docs"
41
+ ],
42
+ "keywords": [
43
+ "twin",
44
+ "trade",
45
+ "iota",
46
+ "framework",
47
+ "blockchain",
48
+ "blob-storage",
49
+ "blob",
50
+ "storage",
51
+ "files",
52
+ "binary",
53
+ "connector",
54
+ "adapter",
55
+ "integration"
41
56
  ]
42
57
  }