@activepieces/piece-amazon-s3 0.5.10 → 0.6.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/package.json +5 -4
- package/src/index.d.ts +7 -3
- package/src/index.d.ts.map +1 -1
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/lib/actions/decrypt-pgp-file.d.ts +7 -3
- package/src/lib/actions/decrypt-pgp-file.d.ts.map +1 -1
- package/src/lib/actions/decrypt-pgp-file.js +25 -20
- package/src/lib/actions/decrypt-pgp-file.js.map +1 -1
- package/src/lib/actions/delete-file.d.ts +7 -3
- package/src/lib/actions/delete-file.d.ts.map +1 -1
- package/src/lib/actions/delete-file.js +4 -3
- package/src/lib/actions/delete-file.js.map +1 -1
- package/src/lib/actions/generate-signed-upload-url.d.ts +7 -3
- package/src/lib/actions/generate-signed-upload-url.d.ts.map +1 -1
- package/src/lib/actions/generate-signed-upload-url.js +26 -13
- package/src/lib/actions/generate-signed-upload-url.js.map +1 -1
- package/src/lib/actions/generate-signed-url.d.ts +7 -3
- package/src/lib/actions/generate-signed-url.d.ts.map +1 -1
- package/src/lib/actions/generate-signed-url.js +26 -21
- package/src/lib/actions/generate-signed-url.js.map +1 -1
- package/src/lib/actions/list-files.d.ts +7 -3
- package/src/lib/actions/list-files.d.ts.map +1 -1
- package/src/lib/actions/list-files.js +4 -3
- package/src/lib/actions/list-files.js.map +1 -1
- package/src/lib/actions/move-file.d.ts +7 -3
- package/src/lib/actions/move-file.d.ts.map +1 -1
- package/src/lib/actions/move-file.js +4 -3
- package/src/lib/actions/move-file.js.map +1 -1
- package/src/lib/actions/read-file.d.ts +7 -3
- package/src/lib/actions/read-file.d.ts.map +1 -1
- package/src/lib/actions/read-file.js +4 -3
- package/src/lib/actions/read-file.js.map +1 -1
- package/src/lib/actions/upload-file.d.ts +7 -3
- package/src/lib/actions/upload-file.d.ts.map +1 -1
- package/src/lib/actions/upload-file.js +4 -3
- package/src/lib/actions/upload-file.js.map +1 -1
- package/src/lib/auth.d.ts +30 -1
- package/src/lib/auth.d.ts.map +1 -1
- package/src/lib/auth.js +210 -145
- package/src/lib/auth.js.map +1 -1
- package/src/lib/common.d.ts +25 -9
- package/src/lib/common.d.ts.map +1 -1
- package/src/lib/common.js +93 -0
- package/src/lib/common.js.map +1 -1
- package/src/lib/triggers/new-file.d.ts +28 -12
- package/src/lib/triggers/new-file.d.ts.map +1 -1
- package/src/lib/triggers/new-file.js +60 -46
- package/src/lib/triggers/new-file.js.map +1 -1
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
export declare const readFile: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
1
|
+
export declare const readFile: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
2
|
accessKeyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
3
|
secretAccessKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
-
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
4
|
endpoint: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
5
|
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
7
|
-
|
|
6
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
+
}> | import("@activepieces/pieces-framework").OIDCProperty<{
|
|
8
|
+
roleArn: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
9
|
+
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
10
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
11
|
+
}>)[], {
|
|
8
12
|
key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
9
13
|
}>;
|
|
10
14
|
//# sourceMappingURL=read-file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-file.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/read-file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"read-file.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/read-file.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ;;;;;;;;;;;;EAoCnB,CAAC"}
|
|
@@ -6,7 +6,7 @@ const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
|
6
6
|
const auth_1 = require("../auth");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
8
|
exports.readFile = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: auth_1.
|
|
9
|
+
auth: auth_1.amazonS3CombinedAuth,
|
|
10
10
|
name: 'read-file',
|
|
11
11
|
displayName: 'Read File',
|
|
12
12
|
description: 'Read a file from S3 to use it in other steps',
|
|
@@ -25,9 +25,10 @@ exports.readFile = (0, pieces_framework_1.createAction)({
|
|
|
25
25
|
run(context) {
|
|
26
26
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
27
27
|
var _a;
|
|
28
|
-
const
|
|
28
|
+
const authProps = context.auth.props;
|
|
29
|
+
const { bucket } = authProps;
|
|
29
30
|
const { key } = context.propsValue;
|
|
30
|
-
const s3 = (0, common_1.
|
|
31
|
+
const s3 = yield (0, common_1.resolveS3Client)({ authProps, server: context.server });
|
|
31
32
|
const file = yield s3.getObject({
|
|
32
33
|
Bucket: bucket,
|
|
33
34
|
Key: key,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-file.js","sourceRoot":"","sources":["../../../../src/lib/actions/read-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;
|
|
1
|
+
{"version":3,"file":"read-file.js","sourceRoot":"","sources":["../../../../src/lib/actions/read-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAA4D;AAC5D,sCAA4C;AAE/B,QAAA,QAAQ,GAAG,IAAA,+BAAY,EAAC;IACnC,IAAI,EAAE,2BAAoB;IAC1B,IAAI,EAAE,WA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ework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
1
|
+
export declare const amazons3UploadFile: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
2
|
accessKeyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
3
|
secretAccessKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
-
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
4
|
endpoint: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
5
|
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
7
|
-
|
|
6
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
+
}> | import("@activepieces/pieces-framework").OIDCProperty<{
|
|
8
|
+
roleArn: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
9
|
+
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
10
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
11
|
+
}>)[], {
|
|
8
12
|
file: import("@activepieces/pieces-framework").FileProperty<true>;
|
|
9
13
|
fileName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
14
|
acl: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-file.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/upload-file.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"upload-file.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/upload-file.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;EAyG7B,CAAC"}
|
|
@@ -7,7 +7,7 @@ const auth_1 = require("../auth");
|
|
|
7
7
|
const common_1 = require("../common");
|
|
8
8
|
const mime_types_1 = tslib_1.__importDefault(require("mime-types"));
|
|
9
9
|
exports.amazons3UploadFile = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.
|
|
10
|
+
auth: auth_1.amazonS3CombinedAuth,
|
|
11
11
|
name: 'upload-file',
|
|
12
12
|
displayName: 'Upload File',
|
|
13
13
|
description: 'Upload an File to S3',
|
|
@@ -72,9 +72,10 @@ exports.amazons3UploadFile = (0, pieces_framework_1.createAction)({
|
|
|
72
72
|
},
|
|
73
73
|
run(context) {
|
|
74
74
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
const
|
|
75
|
+
const authProps = context.auth.props;
|
|
76
|
+
const { bucket } = authProps;
|
|
76
77
|
const { file, fileName, acl, type } = context.propsValue;
|
|
77
|
-
const s3 = (0, common_1.
|
|
78
|
+
const s3 = yield (0, common_1.resolveS3Client)({ authProps, server: context.server });
|
|
78
79
|
let contentType, extension = null;
|
|
79
80
|
if (!type) {
|
|
80
81
|
if (!file.extension || file.extension === undefined || !mime_types_1.default.contentType(file.extension)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-file.js","sourceRoot":"","sources":["../../../../src/lib/actions/upload-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,
|
|
1
|
+
{"version":3,"file":"upload-file.js","sourceRoot":"","sources":["../../../../src/lib/actions/upload-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAA4D;AAC5D,sCAA4C;AAE5C,oEAA8B;AAEjB,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,2BAAoB;IAC1B,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,sBAAsB;IACnC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,4SAA4S;QACzT,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,E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C,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAC,CAAC;YAEH,OAAO;gBACL,QAAQ,EAAE,aAAa;gBACvB,IAAI,EAAE,cAAc,CAAC,IAAI;aAC1B,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
package/src/lib/auth.d.ts
CHANGED
|
@@ -1,8 +1,37 @@
|
|
|
1
1
|
export declare const amazonS3Auth: import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
2
|
accessKeyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
3
|
secretAccessKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
-
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
4
|
endpoint: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
5
|
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
6
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const amazonS3OidcAuth: import("@activepieces/pieces-framework").OIDCProperty<{
|
|
9
|
+
roleArn: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
+
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
11
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
12
|
}>;
|
|
13
|
+
export declare const amazonS3CombinedAuth: (import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
14
|
+
accessKeyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
15
|
+
secretAccessKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
16
|
+
endpoint: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
17
|
+
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
18
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
19
|
+
}> | import("@activepieces/pieces-framework").OIDCProperty<{
|
|
20
|
+
roleArn: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
21
|
+
region: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
22
|
+
bucket: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
23
|
+
}>)[];
|
|
24
|
+
export type AccessKeyAuthProps = {
|
|
25
|
+
accessKeyId: string | undefined;
|
|
26
|
+
secretAccessKey: string | undefined;
|
|
27
|
+
endpoint: string | undefined;
|
|
28
|
+
bucket: string;
|
|
29
|
+
region: string;
|
|
30
|
+
};
|
|
31
|
+
export type OidcAuthProps = {
|
|
32
|
+
roleArn: string | undefined;
|
|
33
|
+
bucket: string;
|
|
34
|
+
region: string;
|
|
35
|
+
};
|
|
36
|
+
export type S3AuthProps = AccessKeyAuthProps | OidcAuthProps;
|
|
8
37
|
//# sourceMappingURL=auth.d.ts.map
|
package/src/lib/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"AA4KA,eAAO,MAAM,YAAY;;;;;;EA6CvB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;EAiC3B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;KAAmC,CAAC;AAErE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,kBAAkB,GAAG,aAAa,CAAC"}
|
package/src/lib/auth.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.amazonS3Auth = void 0;
|
|
3
|
+
exports.amazonS3CombinedAuth = exports.amazonS3OidcAuth = exports.amazonS3Auth = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const common_1 = require("./common");
|
|
7
|
-
const
|
|
8
|
-
Connect your Amazon S3 account
|
|
7
|
+
const accessKeyDescription = `
|
|
8
|
+
Connect your Amazon S3 account using AWS Access Key credentials.
|
|
9
9
|
|
|
10
10
|
**How to get your credentials:**
|
|
11
11
|
1. Open the [AWS IAM Console](https://console.aws.amazon.com/iam/) and go to **Users**.
|
|
@@ -15,8 +15,164 @@ Connect your Amazon S3 account to read, write, and manage files in your buckets.
|
|
|
15
15
|
|
|
16
16
|
Using a non-AWS S3-compatible service (MinIO, DigitalOcean Spaces, Backblaze B2, etc.)? Set the **Endpoint** field to your service URL.
|
|
17
17
|
`;
|
|
18
|
+
const oidcDescription = `
|
|
19
|
+
Connect your Amazon S3 account using an IAM Role via OIDC — no permanent keys required.
|
|
20
|
+
|
|
21
|
+
Activepieces acts as an OIDC identity provider. AWS trusts this provider and issues temporary credentials via \`AssumeRoleWithWebIdentity\`.
|
|
22
|
+
|
|
23
|
+
**Setup steps:**
|
|
24
|
+
1. In AWS IAM → Identity Providers → Create Provider:
|
|
25
|
+
- Provider type: **OpenID Connect**
|
|
26
|
+
- Provider URL: \`{{frontendUrl}}\`
|
|
27
|
+
- Audience: \`sts.amazonaws.com\`
|
|
28
|
+
|
|
29
|
+
> AWS fetches \`{{frontendUrl}}/.well-known/openid-configuration\` to discover the OIDC metadata. If your frontend and API run on different domains, make sure the API server is reachable at \`{{frontendUrl}}\` (or that your frontend proxies \`/.well-known/*\` to the API), otherwise \`AssumeRoleWithWebIdentity\` will fail.
|
|
30
|
+
2. Create an IAM Role with this trust policy:
|
|
31
|
+
\`\`\`json
|
|
32
|
+
{
|
|
33
|
+
"Version": "2012-10-17",
|
|
34
|
+
"Statement": [{
|
|
35
|
+
"Effect": "Allow",
|
|
36
|
+
"Principal": { "Federated": "arn:aws:iam::YOUR_ACCOUNT_ID:oidc-provider/{{frontendHost}}" },
|
|
37
|
+
"Action": "sts:AssumeRoleWithWebIdentity",
|
|
38
|
+
"Condition": {
|
|
39
|
+
"StringEquals": {
|
|
40
|
+
"{{frontendHost}}:aud": "sts.amazonaws.com"
|
|
41
|
+
},
|
|
42
|
+
"StringLike": {
|
|
43
|
+
"{{frontendHost}}:sub": "platform:{{platformId}}:project:{{projectId}}"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}]
|
|
47
|
+
}
|
|
48
|
+
\`\`\`
|
|
49
|
+
3. Attach S3 permissions to the role and paste the **Role ARN** below.
|
|
50
|
+
`;
|
|
51
|
+
const AWS_REGIONS = [
|
|
52
|
+
{
|
|
53
|
+
label: 'Default',
|
|
54
|
+
value: 'us-east-1',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: 'US East (N. Virginia) [us-east-1]',
|
|
58
|
+
value: 'us-east-1',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: 'US East (Ohio) [us-east-2]',
|
|
62
|
+
value: 'us-east-2',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: 'US West (N. California) [us-west-1]',
|
|
66
|
+
value: 'us-west-1',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: 'US West (Oregon) [us-west-2]',
|
|
70
|
+
value: 'us-west-2',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: 'Africa (Cape Town) [af-south-1]',
|
|
74
|
+
value: 'af-south-1',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: 'Asia Pacific (Hong Kong) [ap-east-1]',
|
|
78
|
+
value: 'ap-east-1',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
label: 'Asia Pacific (Mumbai) [ap-south-1]',
|
|
82
|
+
value: 'ap-south-1',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
label: 'Asia Pacific (Osaka-Local) [ap-northeast-3]',
|
|
86
|
+
value: 'ap-northeast-3',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
label: 'Asia Pacific (Seoul) [ap-northeast-2]',
|
|
90
|
+
value: 'ap-northeast-2',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
label: 'Asia Pacific (Singapore) [ap-southeast-1]',
|
|
94
|
+
value: 'ap-southeast-1',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
label: 'Asia Pacific (Sydney) [ap-southeast-2]',
|
|
98
|
+
value: 'ap-southeast-2',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
label: 'Asia Pacific (Tokyo) [ap-northeast-1]',
|
|
102
|
+
value: 'ap-northeast-1',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
label: 'Canada (Central) [ca-central-1]',
|
|
106
|
+
value: 'ca-central-1',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
label: 'Europe (Frankfurt) [eu-central-1]',
|
|
110
|
+
value: 'eu-central-1',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
label: 'Europe (Ireland) [eu-west-1]',
|
|
114
|
+
value: 'eu-west-1',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
label: 'Europe (London) [eu-west-2]',
|
|
118
|
+
value: 'eu-west-2',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
label: 'Europe (Milan) [eu-south-1]',
|
|
122
|
+
value: 'eu-south-1',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
label: 'Europe (Paris) [eu-west-3]',
|
|
126
|
+
value: 'eu-west-3',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
label: 'Europe (Stockholm) [eu-north-1]',
|
|
130
|
+
value: 'eu-north-1',
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
label: 'Middle East (Bahrain) [me-south-1]',
|
|
134
|
+
value: 'me-south-1',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
label: 'South America (São Paulo) [sa-east-1]',
|
|
138
|
+
value: 'sa-east-1',
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
label: 'Europe (Spain) [eu-south-2]',
|
|
142
|
+
value: 'eu-south-2',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
label: 'Asia Pacific (Hyderabad) [ap-south-2]',
|
|
146
|
+
value: 'ap-south-2',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
label: 'Asia Pacific (Jakarta) [ap-southeast-3]',
|
|
150
|
+
value: 'ap-southeast-3',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
label: 'Asia Pacific (Melbourne) [ap-southeast-4]',
|
|
154
|
+
value: 'ap-southeast-4',
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
label: 'China (Beijing) [cn-north-1]',
|
|
158
|
+
value: 'cn-north-1',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
label: 'China (Ningxia) [cn-northwest-1]',
|
|
162
|
+
value: 'cn-northwest-1',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
label: 'Europe (Zurich) [eu-central-2]',
|
|
166
|
+
value: 'eu-central-2',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
label: 'Middle East (UAE) [me-central-1]',
|
|
170
|
+
value: 'me-central-1',
|
|
171
|
+
},
|
|
172
|
+
];
|
|
18
173
|
exports.amazonS3Auth = pieces_framework_1.PieceAuth.CustomAuth({
|
|
19
|
-
|
|
174
|
+
displayName: 'Amazon S3 (Access Key)',
|
|
175
|
+
description: accessKeyDescription,
|
|
20
176
|
props: {
|
|
21
177
|
accessKeyId: pieces_framework_1.Property.ShortText({
|
|
22
178
|
displayName: 'Access Key ID',
|
|
@@ -25,166 +181,75 @@ exports.amazonS3Auth = pieces_framework_1.PieceAuth.CustomAuth({
|
|
|
25
181
|
}),
|
|
26
182
|
secretAccessKey: pieces_framework_1.PieceAuth.SecretText({
|
|
27
183
|
displayName: 'Secret Access Key',
|
|
28
|
-
description: 'Your AWS secret access key. Only shown once when you create the access key
|
|
29
|
-
required: true,
|
|
30
|
-
}),
|
|
31
|
-
bucket: pieces_framework_1.Property.ShortText({
|
|
32
|
-
displayName: 'Bucket Name',
|
|
33
|
-
description: 'The name of your S3 bucket (e.g. "my-company-files"). Found in the AWS S3 Console.',
|
|
184
|
+
description: 'Your AWS secret access key. Only shown once when you create the access key.',
|
|
34
185
|
required: true,
|
|
35
186
|
}),
|
|
36
187
|
endpoint: pieces_framework_1.Property.ShortText({
|
|
37
188
|
displayName: 'Endpoint (Optional)',
|
|
38
|
-
description: 'Leave blank for Amazon S3. Only set
|
|
189
|
+
description: 'Leave blank for Amazon S3. Only set when using MinIO, DigitalOcean Spaces, Backblaze B2, etc.',
|
|
39
190
|
required: false,
|
|
40
191
|
}),
|
|
41
192
|
region: pieces_framework_1.Property.StaticDropdown({
|
|
42
193
|
displayName: 'Region',
|
|
43
194
|
options: {
|
|
44
|
-
options:
|
|
45
|
-
{
|
|
46
|
-
label: 'Default',
|
|
47
|
-
value: 'us-east-1',
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
label: 'US East (N. Virginia) [us-east-1]',
|
|
51
|
-
value: 'us-east-1',
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
label: 'US East (Ohio) [us-east-2]',
|
|
55
|
-
value: 'us-east-2',
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
label: 'US West (N. California) [us-west-1]',
|
|
59
|
-
value: 'us-west-1',
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
label: 'US West (Oregon) [us-west-2]',
|
|
63
|
-
value: 'us-west-2',
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
label: 'Africa (Cape Town) [af-south-1]',
|
|
67
|
-
value: 'af-south-1',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
label: 'Asia Pacific (Hong Kong) [ap-east-1]',
|
|
71
|
-
value: 'ap-east-1',
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
label: 'Asia Pacific (Mumbai) [ap-south-1]',
|
|
75
|
-
value: 'ap-south-1',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
label: 'Asia Pacific (Osaka-Local) [ap-northeast-3]',
|
|
79
|
-
value: 'ap-northeast-3',
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
label: 'Asia Pacific (Seoul) [ap-northeast-2]',
|
|
83
|
-
value: 'ap-northeast-2',
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
label: 'Asia Pacific (Singapore) [ap-southeast-1]',
|
|
87
|
-
value: 'ap-southeast-1',
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
label: 'Asia Pacific (Sydney) [ap-southeast-2]',
|
|
91
|
-
value: 'ap-southeast-2',
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
label: 'Asia Pacific (Tokyo) [ap-northeast-1]',
|
|
95
|
-
value: 'ap-northeast-1',
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
label: 'Canada (Central) [ca-central-1]',
|
|
99
|
-
value: 'ca-central-1',
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
label: 'Europe (Frankfurt) [eu-central-1]',
|
|
103
|
-
value: 'eu-central-1',
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
label: 'Europe (Ireland) [eu-west-1]',
|
|
107
|
-
value: 'eu-west-1',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
label: 'Europe (London) [eu-west-2]',
|
|
111
|
-
value: 'eu-west-2',
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
label: 'Europe (Milan) [eu-south-1]',
|
|
115
|
-
value: 'eu-south-1',
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
label: 'Europe (Paris) [eu-west-3]',
|
|
119
|
-
value: 'eu-west-3',
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
label: 'Europe (Stockholm) [eu-north-1]',
|
|
123
|
-
value: 'eu-north-1',
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
label: 'Middle East (Bahrain) [me-south-1]',
|
|
127
|
-
value: 'me-south-1',
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
label: 'South America (São Paulo) [sa-east-1]',
|
|
131
|
-
value: 'sa-east-1',
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
label: 'Europe (Spain) [eu-south-2]',
|
|
135
|
-
value: 'eu-south-2',
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
label: 'Asia Pacific (Hyderabad) [ap-south-2]',
|
|
139
|
-
value: 'ap-south-2',
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
label: 'Asia Pacific (Jakarta) [ap-southeast-3]',
|
|
143
|
-
value: 'ap-southeast-3',
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
label: 'Asia Pacific (Melbourne) [ap-southeast-4]',
|
|
147
|
-
value: 'ap-southeast-4',
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
label: 'China (Beijing) [cn-north-1]',
|
|
151
|
-
value: 'cn-north-1',
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
label: 'China (Ningxia) [cn-northwest-1]',
|
|
155
|
-
value: 'cn-northwest-1',
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
label: 'Europe (Zurich) [eu-central-2]',
|
|
159
|
-
value: 'eu-central-2',
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
label: 'Middle East (UAE) [me-central-1]',
|
|
163
|
-
value: 'me-central-1',
|
|
164
|
-
},
|
|
165
|
-
],
|
|
195
|
+
options: AWS_REGIONS,
|
|
166
196
|
},
|
|
167
197
|
required: true,
|
|
168
198
|
}),
|
|
199
|
+
bucket: pieces_framework_1.Property.ShortText({
|
|
200
|
+
displayName: 'Bucket Name',
|
|
201
|
+
description: 'The name of your S3 bucket (e.g. "my-company-files").',
|
|
202
|
+
required: true,
|
|
203
|
+
}),
|
|
169
204
|
},
|
|
170
205
|
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
171
|
-
|
|
206
|
+
if (!auth.accessKeyId || !auth.secretAccessKey) {
|
|
207
|
+
return { valid: false, error: 'Access Key ID and Secret Access Key are required.' };
|
|
208
|
+
}
|
|
172
209
|
try {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
});
|
|
177
|
-
return {
|
|
178
|
-
valid: true,
|
|
179
|
-
};
|
|
210
|
+
const s3 = (0, common_1.createS3)(auth);
|
|
211
|
+
yield s3.listObjectsV2({ Bucket: auth.bucket, MaxKeys: 1 });
|
|
212
|
+
return { valid: true };
|
|
180
213
|
}
|
|
181
214
|
catch (e) {
|
|
182
|
-
return {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
215
|
+
return { valid: false, error: e === null || e === void 0 ? void 0 : e.message };
|
|
216
|
+
}
|
|
217
|
+
}),
|
|
218
|
+
required: true,
|
|
219
|
+
});
|
|
220
|
+
exports.amazonS3OidcAuth = pieces_framework_1.PieceAuth.OIDC({
|
|
221
|
+
displayName: 'Amazon S3 (IAM Role / OIDC)',
|
|
222
|
+
description: oidcDescription,
|
|
223
|
+
props: {
|
|
224
|
+
roleArn: pieces_framework_1.Property.ShortText({
|
|
225
|
+
displayName: 'Role ARN',
|
|
226
|
+
description: 'The ARN of the IAM role to assume (e.g. arn:aws:iam::123456789012:role/MyRole).',
|
|
227
|
+
required: true,
|
|
228
|
+
}),
|
|
229
|
+
region: pieces_framework_1.Property.StaticDropdown({
|
|
230
|
+
displayName: 'Region',
|
|
231
|
+
options: {
|
|
232
|
+
options: AWS_REGIONS,
|
|
233
|
+
},
|
|
234
|
+
required: true,
|
|
235
|
+
}),
|
|
236
|
+
bucket: pieces_framework_1.Property.ShortText({
|
|
237
|
+
displayName: 'Bucket Name',
|
|
238
|
+
description: 'The name of your S3 bucket (e.g. "my-company-files").',
|
|
239
|
+
required: true,
|
|
240
|
+
}),
|
|
241
|
+
},
|
|
242
|
+
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
243
|
+
if (!auth.roleArn) {
|
|
244
|
+
return { valid: false, error: 'Role ARN is required for IAM Role authentication.' };
|
|
245
|
+
}
|
|
246
|
+
const arnRegex = /^arn:(?:aws|aws-us-gov|aws-cn):iam::\d{12}:role\/[\w+=,.@\-/]{1,512}$/;
|
|
247
|
+
if (!arnRegex.test(auth.roleArn)) {
|
|
248
|
+
return { valid: false, error: 'Invalid IAM Role ARN format. Expected: arn:aws:iam::123456789012:role/RoleName' };
|
|
186
249
|
}
|
|
250
|
+
return { valid: true };
|
|
187
251
|
}),
|
|
188
252
|
required: true,
|
|
189
253
|
});
|
|
254
|
+
exports.amazonS3CombinedAuth = [exports.amazonS3Auth, exports.amazonS3OidcAuth];
|
|
190
255
|
//# sourceMappingURL=auth.js.map
|
package/src/lib/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;;AAAA,qEAAqE;AACrE,qCAAoC;AAEpC,MAAM,
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;;AAAA,qEAAqE;AACrE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AAU;YACvB,WAAW,EAAE,iFAAiF;YAC9F,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC9B,WAAW,EAAE,QAAQ;YACrB,OAAO,EAAE;gBACP,OAAO,EAAE,WAAW;aACrB;YACD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,uDAAuD;YACpE,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,mDAAmD,EAAE,CAAC;QACtF,CAAC;QACD,MAAM,QAAQ,GAAG,uEAAuE,CAAC;QACzF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YACjC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,gFAAgF,EAAE,CAAC;QACnH,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACzB,CAAC,CAAA;IACD,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEU,QAAA,oBAAoB,GAAG,CAAC,oBAAY,EAAE,wBAAgB,CAAC,CAAC"}
|
package/src/lib/common.d.ts
CHANGED
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
import { S3 } from '@aws-sdk/client-s3';
|
|
2
2
|
import { SecretsManagerClient } from '@aws-sdk/client-secrets-manager';
|
|
3
|
-
|
|
3
|
+
import { ServerContext } from '@activepieces/pieces-framework';
|
|
4
|
+
import { AccessKeyAuthProps, OidcAuthProps, S3AuthProps } from './auth';
|
|
5
|
+
export declare function createS3(auth: AccessKeyAuthProps): S3;
|
|
6
|
+
export declare function createSecretsManagerClient(auth: AccessKeyAuthProps): SecretsManagerClient;
|
|
7
|
+
export declare function createS3WithAssumeRole({ auth, server, durationSeconds, }: {
|
|
8
|
+
auth: OidcAuthProps;
|
|
9
|
+
server: ServerContext;
|
|
10
|
+
durationSeconds?: number;
|
|
11
|
+
}): Promise<S3>;
|
|
12
|
+
export declare function isOidcAuth(authProps: S3AuthProps): authProps is OidcAuthProps;
|
|
13
|
+
export declare function resolveS3Client({ authProps, server, }: {
|
|
14
|
+
authProps: S3AuthProps;
|
|
15
|
+
server: ServerContext;
|
|
16
|
+
}): Promise<S3>;
|
|
17
|
+
export declare function getTemporaryCredentials({ auth, server, durationSeconds, }: {
|
|
18
|
+
auth: OidcAuthProps;
|
|
19
|
+
server: ServerContext;
|
|
20
|
+
durationSeconds?: number;
|
|
21
|
+
}): Promise<TemporaryCredentials>;
|
|
22
|
+
export declare const MIN_STS_DURATION_SECONDS = 900;
|
|
23
|
+
export declare const MAX_STS_DURATION_SECONDS = 43200;
|
|
24
|
+
type TemporaryCredentials = {
|
|
4
25
|
accessKeyId: string;
|
|
5
26
|
secretAccessKey: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
export declare function createSecretsManagerClient(auth: {
|
|
10
|
-
accessKeyId: string;
|
|
11
|
-
secretAccessKey: string;
|
|
12
|
-
region: string | undefined;
|
|
13
|
-
}): SecretsManagerClient;
|
|
27
|
+
sessionToken: string | undefined;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
14
30
|
//# sourceMappingURL=common.d.ts.map
|
package/src/lib/common.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/lib/common.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,wBAAgB,QAAQ,CAAC,IA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