@mavogel/awscdk-rootmail 0.1.33 → 0.1.35
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/.jsii +8 -8
- package/lib/rootmail.js +1 -1
- package/lib/ses-receive.js +1 -1
- package/node_modules/@aws-sdk/checksums/dist-cjs/submodules/flexible-checksums/index.js +2 -1
- package/node_modules/@aws-sdk/checksums/dist-cjs/submodules/sha/index.js +464 -40
- package/node_modules/@aws-sdk/checksums/dist-cjs/submodules/xxh/index.js +914 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/flexible-checksums/stringUnionSelector.js +2 -1
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/index.browser.js +2 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/index.js +3 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/sha512/Sha512.js +71 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/sha512/Sha512Js.js +276 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/sha512/Sha512WebCrypto.js +76 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/U64.js +190 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/Xxh3.js +274 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/index.js +3 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/xxhash3_128/Xxh3_128.js +179 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/xxhash3_64/Xxh3_64.js +117 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/xxhash64/Xxh64.js +150 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/index.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/index.d.ts +3 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/sha512/Sha512.d.ts +17 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/sha512/Sha512Js.d.ts +29 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/sha512/Sha512WebCrypto.d.ts +22 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/U64.d.ts +110 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/Xxh3.d.ts +139 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/index.d.ts +3 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/xxhash3_128/Xxh3_128.d.ts +37 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/xxhash3_64/Xxh3_64.d.ts +27 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/xxhash64/Xxh64.d.ts +41 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/index.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/index.d.ts +3 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/sha512/Sha512.d.ts +12 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/sha512/Sha512Js.d.ts +22 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/sha512/Sha512WebCrypto.d.ts +14 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/U64.d.ts +27 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/Xxh3.d.ts +65 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/index.d.ts +3 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/xxhash3_128/Xxh3_128.d.ts +12 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/xxhash3_64/Xxh3_64.d.ts +10 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/xxhash64/Xxh64.d.ts +17 -0
- package/node_modules/@aws-sdk/checksums/package.json +13 -3
- package/node_modules/@aws-sdk/checksums/xxh.d.ts +5 -0
- package/node_modules/@aws-sdk/checksums/xxh.js +5 -0
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-cloudwatch-logs/package.json +3 -3
- package/node_modules/@aws-sdk/client-route-53/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-route-53/package.json +3 -3
- package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-s3/package.json +7 -7
- package/node_modules/@aws-sdk/client-ses/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-ses/package.json +3 -3
- package/node_modules/@aws-sdk/client-ssm/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-ssm/package.json +3 -3
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +26 -13
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +6 -3
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +51 -1
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +2 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js +4 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/parseArn.js +4 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.js +18 -9
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js +6 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.js +51 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/util-arn-parser/arn.js +2 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.d.ts +25 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.d.ts +36 -0
- package/node_modules/@aws-sdk/core/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/submodules/s3/index.js +34 -16
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/submodules/s3-control/index.js +6 -3
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3/middleware-bucket-endpoint/bucketHostnameUtils.js +6 -3
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityCache.js +8 -4
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityProviderImpl.js +18 -8
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3/middleware-ssec/middleware-ssec.js +2 -1
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3-control/middleware-process-arnables/parse-outpost-arnables.js +4 -2
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3-control/middleware-redirect-from-postid/redirect-from-postid.js +2 -1
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityCache.d.ts +1 -0
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityProviderImpl.d.ts +3 -1
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/ts3.4/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityCache.d.ts +1 -0
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/ts3.4/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityProviderImpl.d.ts +3 -1
- package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +3 -3
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +1 -1
- package/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@aws-sdk/xml-builder/package.json +1 -1
- package/node_modules/mailparser/CHANGELOG.md +26 -0
- package/node_modules/mailparser/README.md +21 -1
- package/node_modules/mailparser/dist/cjs/index.d.ts +3 -1
- package/node_modules/mailparser/dist/cjs/index.js +4 -2
- package/node_modules/mailparser/dist/cjs/mail-parser.d.ts +8 -1
- package/node_modules/mailparser/dist/cjs/mail-parser.js +5 -0
- package/node_modules/mailparser/dist/cjs/otp-token.d.ts +9 -0
- package/node_modules/mailparser/dist/cjs/otp-token.js +186 -0
- package/node_modules/mailparser/dist/cjs/simple-parser.js +3 -0
- package/node_modules/mailparser/dist/cjs/types.d.ts +21 -0
- package/node_modules/mailparser/dist/esm/index.d.ts +3 -1
- package/node_modules/mailparser/dist/esm/index.js +3 -2
- package/node_modules/mailparser/dist/esm/mail-parser.d.ts +8 -1
- package/node_modules/mailparser/dist/esm/mail-parser.js +5 -0
- package/node_modules/mailparser/dist/esm/otp-token.d.ts +9 -0
- package/node_modules/mailparser/dist/esm/otp-token.js +180 -0
- package/node_modules/mailparser/dist/esm/simple-parser.js +3 -0
- package/node_modules/mailparser/dist/esm/types.d.ts +21 -0
- package/node_modules/mailparser/package.json +3 -3
- package/node_modules/nodemailer/CHANGELOG.md +19 -0
- package/node_modules/nodemailer/dist/cjs/dkim/sign.js +1 -1
- package/node_modules/nodemailer/dist/cjs/errors.d.ts +2 -0
- package/node_modules/nodemailer/dist/cjs/errors.js +3 -1
- package/node_modules/nodemailer/dist/cjs/mail-composer/index.d.ts +12 -0
- package/node_modules/nodemailer/dist/cjs/mail-composer/index.js +53 -0
- package/node_modules/nodemailer/dist/cjs/mailer/index.d.ts +3 -2
- package/node_modules/nodemailer/dist/cjs/mime-node/index.js +10 -2
- package/node_modules/nodemailer/dist/cjs/nodemailer.d.ts +1 -1
- package/node_modules/nodemailer/dist/cjs/package-info.d.ts +1 -1
- package/node_modules/nodemailer/dist/cjs/package-info.js +1 -1
- package/node_modules/nodemailer/dist/cjs/well-known/services.js +7 -0
- package/node_modules/nodemailer/dist/esm/dkim/sign.js +1 -1
- package/node_modules/nodemailer/dist/esm/errors.d.ts +2 -0
- package/node_modules/nodemailer/dist/esm/errors.js +2 -0
- package/node_modules/nodemailer/dist/esm/mail-composer/index.d.ts +12 -0
- package/node_modules/nodemailer/dist/esm/mail-composer/index.js +53 -0
- package/node_modules/nodemailer/dist/esm/mailer/index.d.ts +3 -2
- package/node_modules/nodemailer/dist/esm/mime-node/index.js +10 -2
- package/node_modules/nodemailer/dist/esm/nodemailer.d.ts +1 -1
- package/node_modules/nodemailer/dist/esm/package-info.d.ts +1 -1
- package/node_modules/nodemailer/dist/esm/package-info.js +1 -1
- package/node_modules/nodemailer/dist/esm/well-known/services.js +7 -0
- package/node_modules/nodemailer/dist/well-known/services.json +8 -0
- package/node_modules/nodemailer/package.json +5 -5
- package/package.json +7 -7
|
@@ -6,16 +6,19 @@ export const NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = {
|
|
|
6
6
|
environmentVariableSelector: (env, options) => {
|
|
7
7
|
if (options?.signingName) {
|
|
8
8
|
const bearerTokenKey = getBearerTokenEnvKey(options.signingName);
|
|
9
|
-
if (bearerTokenKey in env)
|
|
9
|
+
if (bearerTokenKey in env) {
|
|
10
10
|
return ["httpBearerAuth"];
|
|
11
|
+
}
|
|
11
12
|
}
|
|
12
|
-
if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env))
|
|
13
|
+
if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env)) {
|
|
13
14
|
return undefined;
|
|
15
|
+
}
|
|
14
16
|
return getArrayForCommaSeparatedString(env[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]);
|
|
15
17
|
},
|
|
16
18
|
configFileSelector: (profile) => {
|
|
17
|
-
if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile))
|
|
19
|
+
if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile)) {
|
|
18
20
|
return undefined;
|
|
21
|
+
}
|
|
19
22
|
return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]);
|
|
20
23
|
},
|
|
21
24
|
default: [],
|
|
@@ -3,6 +3,7 @@ export { AwsJson1_0Protocol } from "./json/AwsJson1_0Protocol";
|
|
|
3
3
|
export { AwsJson1_1Protocol } from "./json/AwsJson1_1Protocol";
|
|
4
4
|
export { AwsJsonRpcProtocol } from "./json/AwsJsonRpcProtocol";
|
|
5
5
|
export { AwsRestJsonProtocol } from "./json/AwsRestJsonProtocol";
|
|
6
|
+
export { AwsSmithyRpcV2JsonProtocol } from "./json/AwsSmithyRpcV2JsonProtocol";
|
|
6
7
|
export { JsonCodec, JsonCodec2, JsonShapeDeserializer, JsonShapeDeserializer2, JsonShapeSerializer, JsonShapeSerializer2, loadJsonRpcErrorCode, loadRestJsonErrorCode, parseJsonBody, parseJsonErrorBody, } from "@smithy/core/protocols";
|
|
7
8
|
export { AwsEc2QueryProtocol } from "./query/AwsEc2QueryProtocol";
|
|
8
9
|
export { AwsQueryProtocol } from "./query/AwsQueryProtocol";
|
package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { loadSmithyRpcV2JsonErrorCode, SmithyRpcV2JsonProtocol } from "@smithy/core/protocols";
|
|
2
|
+
import { NormalizedSchema } from "@smithy/core/schema";
|
|
3
|
+
import { ProtocolLib } from "../ProtocolLib";
|
|
4
|
+
export class AwsSmithyRpcV2JsonProtocol extends SmithyRpcV2JsonProtocol {
|
|
5
|
+
awsQueryCompatible;
|
|
6
|
+
mixin;
|
|
7
|
+
constructor({ defaultNamespace, errorTypeRegistries, awsQueryCompatible, }) {
|
|
8
|
+
super({ defaultNamespace, errorTypeRegistries });
|
|
9
|
+
this.awsQueryCompatible = !!awsQueryCompatible;
|
|
10
|
+
this.mixin = new ProtocolLib(this.awsQueryCompatible);
|
|
11
|
+
}
|
|
12
|
+
async serializeRequest(operationSchema, input, context) {
|
|
13
|
+
const request = await super.serializeRequest(operationSchema, input, context);
|
|
14
|
+
if (this.awsQueryCompatible) {
|
|
15
|
+
request.headers["x-amzn-query-mode"] = "true";
|
|
16
|
+
}
|
|
17
|
+
return request;
|
|
18
|
+
}
|
|
19
|
+
async handleError(operationSchema, context, response, dataObject, metadata) {
|
|
20
|
+
if (this.awsQueryCompatible) {
|
|
21
|
+
this.mixin.setQueryCompatError(dataObject, response);
|
|
22
|
+
}
|
|
23
|
+
const errorName = (() => {
|
|
24
|
+
const compatHeader = response.headers["x-amzn-query-error"];
|
|
25
|
+
if (compatHeader && this.awsQueryCompatible) {
|
|
26
|
+
return compatHeader.split(";")[0];
|
|
27
|
+
}
|
|
28
|
+
return loadSmithyRpcV2JsonErrorCode(response, dataObject) ?? "Unknown";
|
|
29
|
+
})();
|
|
30
|
+
this.mixin.compose(this.compositeErrorRegistry, errorName, this.options.defaultNamespace);
|
|
31
|
+
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined);
|
|
32
|
+
const ns = NormalizedSchema.of(errorSchema);
|
|
33
|
+
const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
|
|
34
|
+
const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
|
|
35
|
+
const exception = new ErrorCtor({});
|
|
36
|
+
const output = {};
|
|
37
|
+
const errorDeserializer = this.getPayloadCodec().createDeserializer();
|
|
38
|
+
for (const [name, member] of ns.structIterator()) {
|
|
39
|
+
if (dataObject[name] != null) {
|
|
40
|
+
output[name] = errorDeserializer.readObject(member, dataObject[name]);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (this.awsQueryCompatible) {
|
|
44
|
+
this.mixin.queryCompatOutput(dataObject, output);
|
|
45
|
+
}
|
|
46
|
+
throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
|
|
47
|
+
$fault: ns.getMergedTraits().error,
|
|
48
|
+
message,
|
|
49
|
+
}, output), dataObject);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export const validate = (str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6;
|
|
2
2
|
export const parse = (arn) => {
|
|
3
3
|
const segments = arn.split(":");
|
|
4
|
-
if (segments.length < 6 || segments[0] !== "arn")
|
|
4
|
+
if (segments.length < 6 || segments[0] !== "arn") {
|
|
5
5
|
throw new Error("Malformed ARN");
|
|
6
|
+
}
|
|
6
7
|
const [, partition, service, region, accountId, ...resource] = segments;
|
|
7
8
|
return {
|
|
8
9
|
partition,
|
|
@@ -3,6 +3,7 @@ export { AwsJson1_0Protocol } from "./json/AwsJson1_0Protocol";
|
|
|
3
3
|
export { AwsJson1_1Protocol } from "./json/AwsJson1_1Protocol";
|
|
4
4
|
export { AwsJsonRpcProtocol } from "./json/AwsJsonRpcProtocol";
|
|
5
5
|
export { AwsRestJsonProtocol } from "./json/AwsRestJsonProtocol";
|
|
6
|
+
export { AwsSmithyRpcV2JsonProtocol } from "./json/AwsSmithyRpcV2JsonProtocol";
|
|
6
7
|
export { JsonCodec, JsonCodec2, JsonShapeDeserializer, JsonShapeDeserializer2, JsonShapeSerializer, JsonShapeSerializer2, loadJsonRpcErrorCode, loadRestJsonErrorCode, parseJsonBody, parseJsonErrorBody, } from "@smithy/core/protocols";
|
|
7
8
|
export type { JsonSettings } from "@smithy/core/protocols";
|
|
8
9
|
export { AwsEc2QueryProtocol } from "./query/AwsEc2QueryProtocol";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SmithyRpcV2JsonProtocol } from "@smithy/core/protocols";
|
|
2
|
+
import type { TypeRegistry } from "@smithy/core/schema";
|
|
3
|
+
import type { EndpointBearer, HandlerExecutionContext, HttpRequest, HttpResponse, OperationSchema, ResponseMetadata, SerdeFunctions } from "@smithy/types";
|
|
4
|
+
/**
|
|
5
|
+
* Extends the Smithy implementation to add AwsQueryCompatibility support.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export declare class AwsSmithyRpcV2JsonProtocol extends SmithyRpcV2JsonProtocol {
|
|
10
|
+
private readonly awsQueryCompatible;
|
|
11
|
+
private readonly mixin;
|
|
12
|
+
constructor({ defaultNamespace, errorTypeRegistries, awsQueryCompatible, }: {
|
|
13
|
+
defaultNamespace: string;
|
|
14
|
+
errorTypeRegistries?: TypeRegistry[];
|
|
15
|
+
awsQueryCompatible?: boolean;
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* @override
|
|
19
|
+
*/
|
|
20
|
+
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<HttpRequest>;
|
|
21
|
+
/**
|
|
22
|
+
* @override
|
|
23
|
+
*/
|
|
24
|
+
protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: HttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
|
|
25
|
+
}
|
|
@@ -3,6 +3,7 @@ export { AwsJson1_0Protocol } from "./json/AwsJson1_0Protocol";
|
|
|
3
3
|
export { AwsJson1_1Protocol } from "./json/AwsJson1_1Protocol";
|
|
4
4
|
export { AwsJsonRpcProtocol } from "./json/AwsJsonRpcProtocol";
|
|
5
5
|
export { AwsRestJsonProtocol } from "./json/AwsRestJsonProtocol";
|
|
6
|
+
export { AwsSmithyRpcV2JsonProtocol } from "./json/AwsSmithyRpcV2JsonProtocol";
|
|
6
7
|
export {
|
|
7
8
|
JsonCodec,
|
|
8
9
|
JsonCodec2,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { SmithyRpcV2JsonProtocol } from "@smithy/core/protocols";
|
|
2
|
+
import { TypeRegistry } from "@smithy/core/schema";
|
|
3
|
+
import {
|
|
4
|
+
EndpointBearer,
|
|
5
|
+
HandlerExecutionContext,
|
|
6
|
+
HttpRequest,
|
|
7
|
+
HttpResponse,
|
|
8
|
+
OperationSchema,
|
|
9
|
+
ResponseMetadata,
|
|
10
|
+
SerdeFunctions,
|
|
11
|
+
} from "@smithy/types";
|
|
12
|
+
export declare class AwsSmithyRpcV2JsonProtocol extends SmithyRpcV2JsonProtocol {
|
|
13
|
+
private readonly awsQueryCompatible;
|
|
14
|
+
private readonly mixin;
|
|
15
|
+
constructor({
|
|
16
|
+
defaultNamespace,
|
|
17
|
+
errorTypeRegistries,
|
|
18
|
+
awsQueryCompatible,
|
|
19
|
+
}: {
|
|
20
|
+
defaultNamespace: string;
|
|
21
|
+
errorTypeRegistries?: TypeRegistry[];
|
|
22
|
+
awsQueryCompatible?: boolean;
|
|
23
|
+
});
|
|
24
|
+
serializeRequest<Input extends object>(
|
|
25
|
+
operationSchema: OperationSchema,
|
|
26
|
+
input: Input,
|
|
27
|
+
context: HandlerExecutionContext & SerdeFunctions & EndpointBearer,
|
|
28
|
+
): Promise<HttpRequest>;
|
|
29
|
+
protected handleError(
|
|
30
|
+
operationSchema: OperationSchema,
|
|
31
|
+
context: HandlerExecutionContext & SerdeFunctions,
|
|
32
|
+
response: HttpResponse,
|
|
33
|
+
dataObject: any,
|
|
34
|
+
metadata: ResponseMetadata,
|
|
35
|
+
): Promise<never>;
|
|
36
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.979.0",
|
|
4
4
|
"description": "Core functions & classes shared by multiple AWS SDK clients.",
|
|
5
5
|
"homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages-internal/core",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
},
|
|
126
126
|
"dependencies": {
|
|
127
127
|
"@aws-sdk/types": "^3.975.0",
|
|
128
|
-
"@aws-sdk/xml-builder": "^3.972.
|
|
128
|
+
"@aws-sdk/xml-builder": "^3.972.42",
|
|
129
129
|
"@aws/lambda-invoke-store": "^0.3.0",
|
|
130
130
|
"@smithy/core": "^3.37.0",
|
|
131
131
|
"@smithy/signature-v4": "^5.7.4",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-env",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.79",
|
|
4
4
|
"description": "AWS credential provider that sources credentials from known environment variables",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aws",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"test:watch": "yarn g:vitest watch"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@aws-sdk/core": "^3.
|
|
46
|
+
"@aws-sdk/core": "^3.979.0",
|
|
47
47
|
"@aws-sdk/types": "^3.975.0",
|
|
48
48
|
"@smithy/core": "^3.37.0",
|
|
49
49
|
"@smithy/types": "^4.19.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-http",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.81",
|
|
4
4
|
"description": "AWS credential provider for containers and HTTP sources",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aws",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@aws-sdk/core": "^3.
|
|
56
|
+
"@aws-sdk/core": "^3.979.0",
|
|
57
57
|
"@aws-sdk/types": "^3.975.0",
|
|
58
58
|
"@smithy/core": "^3.37.0",
|
|
59
59
|
"@smithy/fetch-http-handler": "^5.8.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-ini",
|
|
3
|
-
"version": "3.973.
|
|
3
|
+
"version": "3.973.24",
|
|
4
4
|
"description": "AWS credential provider that sources credentials from ~/.aws/credentials and ~/.aws/config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aws",
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
"test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@aws-sdk/core": "^3.
|
|
49
|
-
"@aws-sdk/credential-provider-env": "^3.972.
|
|
50
|
-
"@aws-sdk/credential-provider-http": "^3.972.
|
|
51
|
-
"@aws-sdk/credential-provider-login": "^3.972.
|
|
52
|
-
"@aws-sdk/credential-provider-process": "^3.972.
|
|
53
|
-
"@aws-sdk/credential-provider-sso": "^3.973.
|
|
54
|
-
"@aws-sdk/credential-provider-web-identity": "^3.972.
|
|
55
|
-
"@aws-sdk/nested-clients": "^3.997.
|
|
48
|
+
"@aws-sdk/core": "^3.979.0",
|
|
49
|
+
"@aws-sdk/credential-provider-env": "^3.972.79",
|
|
50
|
+
"@aws-sdk/credential-provider-http": "^3.972.81",
|
|
51
|
+
"@aws-sdk/credential-provider-login": "^3.972.86",
|
|
52
|
+
"@aws-sdk/credential-provider-process": "^3.972.79",
|
|
53
|
+
"@aws-sdk/credential-provider-sso": "^3.973.23",
|
|
54
|
+
"@aws-sdk/credential-provider-web-identity": "^3.972.85",
|
|
55
|
+
"@aws-sdk/nested-clients": "^3.997.53",
|
|
56
56
|
"@aws-sdk/types": "^3.975.0",
|
|
57
57
|
"@smithy/core": "^3.37.0",
|
|
58
58
|
"@smithy/credential-provider-imds": "^4.5.2",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-login",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.86",
|
|
4
4
|
"description": "AWS credential provider that sources credentials from aws login cached tokens",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aws",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"test:watch": "yarn g:vitest watch"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@aws-sdk/core": "^3.
|
|
49
|
-
"@aws-sdk/nested-clients": "^3.997.
|
|
48
|
+
"@aws-sdk/core": "^3.979.0",
|
|
49
|
+
"@aws-sdk/nested-clients": "^3.997.53",
|
|
50
50
|
"@aws-sdk/types": "^3.975.0",
|
|
51
51
|
"@smithy/core": "^3.37.0",
|
|
52
52
|
"@smithy/types": "^4.19.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-node",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.91",
|
|
4
4
|
"description": "AWS credential provider that sources credentials from a Node.JS environment. ",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aws",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@aws-sdk/credential-provider-env": "^3.972.
|
|
49
|
-
"@aws-sdk/credential-provider-http": "^3.972.
|
|
50
|
-
"@aws-sdk/credential-provider-ini": "^3.973.
|
|
51
|
-
"@aws-sdk/credential-provider-process": "^3.972.
|
|
52
|
-
"@aws-sdk/credential-provider-sso": "^3.973.
|
|
53
|
-
"@aws-sdk/credential-provider-web-identity": "^3.972.
|
|
48
|
+
"@aws-sdk/credential-provider-env": "^3.972.79",
|
|
49
|
+
"@aws-sdk/credential-provider-http": "^3.972.81",
|
|
50
|
+
"@aws-sdk/credential-provider-ini": "^3.973.24",
|
|
51
|
+
"@aws-sdk/credential-provider-process": "^3.972.79",
|
|
52
|
+
"@aws-sdk/credential-provider-sso": "^3.973.23",
|
|
53
|
+
"@aws-sdk/credential-provider-web-identity": "^3.972.85",
|
|
54
54
|
"@aws-sdk/types": "^3.975.0",
|
|
55
55
|
"@smithy/core": "^3.37.0",
|
|
56
56
|
"@smithy/credential-provider-imds": "^4.5.2",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-process",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.79",
|
|
4
4
|
"description": "AWS credential provider that sources credential_process from ~/.aws/credentials and ~/.aws/config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aws",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"test:watch": "yarn g:vitest watch"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@aws-sdk/core": "^3.
|
|
46
|
+
"@aws-sdk/core": "^3.979.0",
|
|
47
47
|
"@aws-sdk/types": "^3.975.0",
|
|
48
48
|
"@smithy/core": "^3.37.0",
|
|
49
49
|
"@smithy/types": "^4.19.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-sso",
|
|
3
|
-
"version": "3.973.
|
|
3
|
+
"version": "3.973.23",
|
|
4
4
|
"description": "AWS credential provider that exchanges a resolved SSO login token file for temporary AWS credentials",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aws",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@aws-sdk/core": "^3.
|
|
49
|
-
"@aws-sdk/nested-clients": "^3.997.
|
|
50
|
-
"@aws-sdk/token-providers": "3.
|
|
48
|
+
"@aws-sdk/core": "^3.979.0",
|
|
49
|
+
"@aws-sdk/nested-clients": "^3.997.53",
|
|
50
|
+
"@aws-sdk/token-providers": "3.1160.0",
|
|
51
51
|
"@aws-sdk/types": "^3.975.0",
|
|
52
52
|
"@smithy/core": "^3.37.0",
|
|
53
53
|
"@smithy/types": "^4.19.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-web-identity",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.85",
|
|
4
4
|
"description": "AWS credential provider that calls STS assumeRole for temporary AWS credentials",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aws",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"test:watch": "yarn g:vitest watch"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@aws-sdk/core": "^3.
|
|
54
|
-
"@aws-sdk/nested-clients": "^3.997.
|
|
53
|
+
"@aws-sdk/core": "^3.979.0",
|
|
54
|
+
"@aws-sdk/nested-clients": "^3.997.53",
|
|
55
55
|
"@aws-sdk/types": "^3.975.0",
|
|
56
56
|
"@smithy/core": "^3.37.0",
|
|
57
57
|
"@smithy/types": "^4.19.0",
|
|
@@ -147,18 +147,22 @@ class S3ExpressIdentityCache {
|
|
|
147
147
|
delete(key) {
|
|
148
148
|
delete this.data[key];
|
|
149
149
|
}
|
|
150
|
+
clear() {
|
|
151
|
+
this.data = {};
|
|
152
|
+
}
|
|
150
153
|
async purgeExpired() {
|
|
151
154
|
const now = Date.now();
|
|
152
155
|
if (this.lastPurgeTime + S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS > now) {
|
|
153
156
|
return;
|
|
154
157
|
}
|
|
155
|
-
|
|
156
|
-
|
|
158
|
+
const data = this.data;
|
|
159
|
+
for (const key in data) {
|
|
160
|
+
const entry = data[key];
|
|
157
161
|
if (!entry.isRefreshing) {
|
|
158
162
|
const credential = await entry.identity;
|
|
159
163
|
if (credential.expiration) {
|
|
160
|
-
if (credential.expiration.getTime() < now) {
|
|
161
|
-
delete
|
|
164
|
+
if (credential.expiration.getTime() < now && data[key] === entry) {
|
|
165
|
+
delete data[key];
|
|
162
166
|
}
|
|
163
167
|
}
|
|
164
168
|
}
|
|
@@ -185,37 +189,47 @@ class S3ExpressIdentityProviderImpl {
|
|
|
185
189
|
createSessionFn;
|
|
186
190
|
cache;
|
|
187
191
|
static REFRESH_WINDOW_MS = 60_000;
|
|
192
|
+
accessKeyId;
|
|
193
|
+
cacheGeneration = 0;
|
|
188
194
|
constructor(createSessionFn, cache = new S3ExpressIdentityCache()) {
|
|
189
195
|
this.createSessionFn = createSessionFn;
|
|
190
196
|
this.cache = cache;
|
|
191
197
|
}
|
|
192
198
|
async getS3ExpressIdentity(awsIdentity, identityProperties) {
|
|
193
|
-
const
|
|
199
|
+
const bucket = identityProperties.Bucket;
|
|
194
200
|
const { cache } = this;
|
|
195
|
-
|
|
201
|
+
if (awsIdentity.accessKeyId !== this.accessKeyId) {
|
|
202
|
+
this.accessKeyId = awsIdentity.accessKeyId;
|
|
203
|
+
this.cacheGeneration++;
|
|
204
|
+
cache.clear();
|
|
205
|
+
}
|
|
206
|
+
const cacheGeneration = this.cacheGeneration;
|
|
207
|
+
const entry = cache.get(bucket);
|
|
196
208
|
if (entry) {
|
|
197
209
|
return entry.identity.then((identity) => {
|
|
198
210
|
const isExpired = (identity.expiration?.getTime() ?? 0) < Date.now();
|
|
199
211
|
if (isExpired) {
|
|
200
|
-
return cache.set(
|
|
212
|
+
return cache.set(bucket, new S3ExpressIdentityCacheEntry(this.getIdentity(bucket))).identity;
|
|
201
213
|
}
|
|
202
214
|
const isExpiringSoon = (identity.expiration?.getTime() ?? 0) < Date.now() + S3ExpressIdentityProviderImpl.REFRESH_WINDOW_MS;
|
|
203
215
|
if (isExpiringSoon && !entry.isRefreshing) {
|
|
204
216
|
entry.isRefreshing = true;
|
|
205
|
-
this.getIdentity(
|
|
206
|
-
|
|
217
|
+
this.getIdentity(bucket).then((id) => {
|
|
218
|
+
if (cacheGeneration === this.cacheGeneration) {
|
|
219
|
+
cache.set(bucket, new S3ExpressIdentityCacheEntry(Promise.resolve(id)));
|
|
220
|
+
}
|
|
207
221
|
});
|
|
208
222
|
}
|
|
209
223
|
return identity;
|
|
210
224
|
});
|
|
211
225
|
}
|
|
212
|
-
return cache.set(
|
|
226
|
+
return cache.set(bucket, new S3ExpressIdentityCacheEntry(this.getIdentity(bucket))).identity;
|
|
213
227
|
}
|
|
214
|
-
async getIdentity(
|
|
228
|
+
async getIdentity(bucket) {
|
|
215
229
|
await this.cache.purgeExpired().catch((error) => {
|
|
216
230
|
console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n" + error);
|
|
217
231
|
});
|
|
218
|
-
const session = await this.createSessionFn(
|
|
232
|
+
const session = await this.createSessionFn(bucket);
|
|
219
233
|
if (!session.Credentials?.AccessKeyId || !session.Credentials?.SecretAccessKey) {
|
|
220
234
|
throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");
|
|
221
235
|
}
|
|
@@ -601,10 +615,12 @@ const validateDNSHostLabel = (label, options = { tlsCompatible: true }) => {
|
|
|
601
615
|
};
|
|
602
616
|
const validateCustomEndpoint = (options) => {
|
|
603
617
|
if (options.isCustomEndpoint) {
|
|
604
|
-
if (options.dualstackEndpoint)
|
|
618
|
+
if (options.dualstackEndpoint) {
|
|
605
619
|
throw new Error("Dualstack endpoint is not supported with custom endpoint");
|
|
606
|
-
|
|
620
|
+
}
|
|
621
|
+
if (options.accelerateEndpoint) {
|
|
607
622
|
throw new Error("Accelerate endpoint is not supported with custom endpoint");
|
|
623
|
+
}
|
|
608
624
|
}
|
|
609
625
|
};
|
|
610
626
|
const getArnResources = (resource) => {
|
|
@@ -629,8 +645,9 @@ const getArnResources = (resource) => {
|
|
|
629
645
|
};
|
|
630
646
|
const validateNoDualstack = (dualstackEndpoint) => { };
|
|
631
647
|
const validateNoFIPS = (useFipsEndpoint) => {
|
|
632
|
-
if (useFipsEndpoint)
|
|
648
|
+
if (useFipsEndpoint) {
|
|
633
649
|
throw new Error(`FIPS region is not supported with Outpost.`);
|
|
650
|
+
}
|
|
634
651
|
};
|
|
635
652
|
const validateMrapAlias = (name) => {
|
|
636
653
|
try {
|
|
@@ -967,8 +984,9 @@ const getSsecPlugin = (config) => ({
|
|
|
967
984
|
});
|
|
968
985
|
function isValidBase64EncodedSSECustomerKey(str, options) {
|
|
969
986
|
const base64Regex = /^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
|
|
970
|
-
if (!base64Regex.test(str))
|
|
987
|
+
if (!base64Regex.test(str)) {
|
|
971
988
|
return false;
|
|
989
|
+
}
|
|
972
990
|
try {
|
|
973
991
|
const decodedBytes = options.base64Decoder(str);
|
|
974
992
|
return decodedBytes.length === 32;
|
|
@@ -19,8 +19,9 @@ const CONTEXT_SIGNING_REGION = "signing_region";
|
|
|
19
19
|
const parseOutpostArnablesMiddleaware = (options) => (next, context) => async (args) => {
|
|
20
20
|
const { input } = args;
|
|
21
21
|
const parameter = input.Name && validate(input.Name) ? "Name" : input.Bucket && validate(input.Bucket) ? "Bucket" : undefined;
|
|
22
|
-
if (!parameter)
|
|
22
|
+
if (!parameter) {
|
|
23
23
|
return next(args);
|
|
24
|
+
}
|
|
24
25
|
const clientRegion = await options.region();
|
|
25
26
|
const useArnRegion = await options.useArnRegion();
|
|
26
27
|
const useFipsEndpoint = await options.useFipsEndpoint();
|
|
@@ -60,8 +61,9 @@ const parseOutpostArnablesMiddleaware = (options) => (next, context) => async (a
|
|
|
60
61
|
if (!input.AccountId) {
|
|
61
62
|
input.AccountId = arn.accountId;
|
|
62
63
|
}
|
|
63
|
-
if (useArnRegion)
|
|
64
|
+
if (useArnRegion) {
|
|
64
65
|
context[CONTEXT_ARN_REGION] = arn.region;
|
|
66
|
+
}
|
|
65
67
|
return next(args);
|
|
66
68
|
};
|
|
67
69
|
const parseOutpostArnablesMiddleawareOptions = {
|
|
@@ -176,8 +178,9 @@ const getHostPrefixDeduplicationPlugin = (config) => ({
|
|
|
176
178
|
|
|
177
179
|
const redirectFromPostIdMiddleware = (config) => (next, context) => async (args) => {
|
|
178
180
|
const { input, request } = args;
|
|
179
|
-
if (!HttpRequest.isInstance(request))
|
|
181
|
+
if (!HttpRequest.isInstance(request)) {
|
|
180
182
|
return next(args);
|
|
183
|
+
}
|
|
181
184
|
if (input.OutpostId) {
|
|
182
185
|
const { isCustomEndpoint } = config;
|
|
183
186
|
const useFipsEndpoint = await config.useFipsEndpoint();
|
|
@@ -68,10 +68,12 @@ export const validateDNSHostLabel = (label, options = { tlsCompatible: true }) =
|
|
|
68
68
|
};
|
|
69
69
|
export const validateCustomEndpoint = (options) => {
|
|
70
70
|
if (options.isCustomEndpoint) {
|
|
71
|
-
if (options.dualstackEndpoint)
|
|
71
|
+
if (options.dualstackEndpoint) {
|
|
72
72
|
throw new Error("Dualstack endpoint is not supported with custom endpoint");
|
|
73
|
-
|
|
73
|
+
}
|
|
74
|
+
if (options.accelerateEndpoint) {
|
|
74
75
|
throw new Error("Accelerate endpoint is not supported with custom endpoint");
|
|
76
|
+
}
|
|
75
77
|
}
|
|
76
78
|
};
|
|
77
79
|
export const getArnResources = (resource) => {
|
|
@@ -96,8 +98,9 @@ export const getArnResources = (resource) => {
|
|
|
96
98
|
};
|
|
97
99
|
export const validateNoDualstack = (dualstackEndpoint) => { };
|
|
98
100
|
export const validateNoFIPS = (useFipsEndpoint) => {
|
|
99
|
-
if (useFipsEndpoint)
|
|
101
|
+
if (useFipsEndpoint) {
|
|
100
102
|
throw new Error(`FIPS region is not supported with Outpost.`);
|
|
103
|
+
}
|
|
101
104
|
};
|
|
102
105
|
export const validateMrapAlias = (name) => {
|
|
103
106
|
try {
|
|
@@ -19,18 +19,22 @@ export class S3ExpressIdentityCache {
|
|
|
19
19
|
delete(key) {
|
|
20
20
|
delete this.data[key];
|
|
21
21
|
}
|
|
22
|
+
clear() {
|
|
23
|
+
this.data = {};
|
|
24
|
+
}
|
|
22
25
|
async purgeExpired() {
|
|
23
26
|
const now = Date.now();
|
|
24
27
|
if (this.lastPurgeTime + S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS > now) {
|
|
25
28
|
return;
|
|
26
29
|
}
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
const data = this.data;
|
|
31
|
+
for (const key in data) {
|
|
32
|
+
const entry = data[key];
|
|
29
33
|
if (!entry.isRefreshing) {
|
|
30
34
|
const credential = await entry.identity;
|
|
31
35
|
if (credential.expiration) {
|
|
32
|
-
if (credential.expiration.getTime() < now) {
|
|
33
|
-
delete
|
|
36
|
+
if (credential.expiration.getTime() < now && data[key] === entry) {
|
|
37
|
+
delete data[key];
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
40
|
}
|
|
@@ -4,37 +4,47 @@ export class S3ExpressIdentityProviderImpl {
|
|
|
4
4
|
createSessionFn;
|
|
5
5
|
cache;
|
|
6
6
|
static REFRESH_WINDOW_MS = 60_000;
|
|
7
|
+
accessKeyId;
|
|
8
|
+
cacheGeneration = 0;
|
|
7
9
|
constructor(createSessionFn, cache = new S3ExpressIdentityCache()) {
|
|
8
10
|
this.createSessionFn = createSessionFn;
|
|
9
11
|
this.cache = cache;
|
|
10
12
|
}
|
|
11
13
|
async getS3ExpressIdentity(awsIdentity, identityProperties) {
|
|
12
|
-
const
|
|
14
|
+
const bucket = identityProperties.Bucket;
|
|
13
15
|
const { cache } = this;
|
|
14
|
-
|
|
16
|
+
if (awsIdentity.accessKeyId !== this.accessKeyId) {
|
|
17
|
+
this.accessKeyId = awsIdentity.accessKeyId;
|
|
18
|
+
this.cacheGeneration++;
|
|
19
|
+
cache.clear();
|
|
20
|
+
}
|
|
21
|
+
const cacheGeneration = this.cacheGeneration;
|
|
22
|
+
const entry = cache.get(bucket);
|
|
15
23
|
if (entry) {
|
|
16
24
|
return entry.identity.then((identity) => {
|
|
17
25
|
const isExpired = (identity.expiration?.getTime() ?? 0) < Date.now();
|
|
18
26
|
if (isExpired) {
|
|
19
|
-
return cache.set(
|
|
27
|
+
return cache.set(bucket, new S3ExpressIdentityCacheEntry(this.getIdentity(bucket))).identity;
|
|
20
28
|
}
|
|
21
29
|
const isExpiringSoon = (identity.expiration?.getTime() ?? 0) < Date.now() + S3ExpressIdentityProviderImpl.REFRESH_WINDOW_MS;
|
|
22
30
|
if (isExpiringSoon && !entry.isRefreshing) {
|
|
23
31
|
entry.isRefreshing = true;
|
|
24
|
-
this.getIdentity(
|
|
25
|
-
|
|
32
|
+
this.getIdentity(bucket).then((id) => {
|
|
33
|
+
if (cacheGeneration === this.cacheGeneration) {
|
|
34
|
+
cache.set(bucket, new S3ExpressIdentityCacheEntry(Promise.resolve(id)));
|
|
35
|
+
}
|
|
26
36
|
});
|
|
27
37
|
}
|
|
28
38
|
return identity;
|
|
29
39
|
});
|
|
30
40
|
}
|
|
31
|
-
return cache.set(
|
|
41
|
+
return cache.set(bucket, new S3ExpressIdentityCacheEntry(this.getIdentity(bucket))).identity;
|
|
32
42
|
}
|
|
33
|
-
async getIdentity(
|
|
43
|
+
async getIdentity(bucket) {
|
|
34
44
|
await this.cache.purgeExpired().catch((error) => {
|
|
35
45
|
console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n" + error);
|
|
36
46
|
});
|
|
37
|
-
const session = await this.createSessionFn(
|
|
47
|
+
const session = await this.createSessionFn(bucket);
|
|
38
48
|
if (!session.Credentials?.AccessKeyId || !session.Credentials?.SecretAccessKey) {
|
|
39
49
|
throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");
|
|
40
50
|
}
|
|
@@ -54,8 +54,9 @@ export const getSsecPlugin = (config) => ({
|
|
|
54
54
|
});
|
|
55
55
|
export function isValidBase64EncodedSSECustomerKey(str, options) {
|
|
56
56
|
const base64Regex = /^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
|
|
57
|
-
if (!base64Regex.test(str))
|
|
57
|
+
if (!base64Regex.test(str)) {
|
|
58
58
|
return false;
|
|
59
|
+
}
|
|
59
60
|
try {
|
|
60
61
|
const decodedBytes = options.base64Decoder(str);
|
|
61
62
|
return decodedBytes.length === 32;
|