UEA-Prodem
This commit is contained in:
Generated
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
export const resolveClientEndpointParameters = (options) => {
|
||||
return Object.assign(options, {
|
||||
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
||||
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
||||
defaultSigningName: "signin",
|
||||
});
|
||||
};
|
||||
export const commonParams = {
|
||||
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
||||
Endpoint: { type: "builtInParams", name: "endpoint" },
|
||||
Region: { type: "builtInParams", name: "region" },
|
||||
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
||||
};
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
import { BinaryDecisionDiagram } from "@smithy/core/endpoints";
|
||||
const m = "ref";
|
||||
const a = -1, b = true, c = "isSet", d = "PartitionResult", e = "booleanEquals", f = "getAttr", g = "stringEquals", h = { [m]: "Endpoint" }, i = { [m]: d }, j = { "fn": f, "argv": [i, "name"] }, k = {}, l = [{ [m]: "Region" }];
|
||||
const _data = {
|
||||
conditions: [
|
||||
[c, [h]],
|
||||
[c, l],
|
||||
["aws.partition", l, d],
|
||||
[e, [{ [m]: "UseFIPS" }, b]],
|
||||
[e, [{ [m]: "UseDualStack" }, b]],
|
||||
[e, [{ fn: f, argv: [i, "supportsDualStack"] }, b]],
|
||||
[e, [{ fn: f, argv: [i, "supportsFIPS"] }, b]],
|
||||
[g, [j, "aws"]],
|
||||
[g, [j, "aws-cn"]],
|
||||
[g, [j, "aws-us-gov"]]
|
||||
],
|
||||
results: [
|
||||
[a],
|
||||
[a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
|
||||
[a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
|
||||
[h, k],
|
||||
["https://{Region}.signin.aws.amazon.com", k],
|
||||
["https://{Region}.signin.amazonaws.cn", k],
|
||||
["https://{Region}.signin.amazonaws-us-gov.com", k],
|
||||
["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", k],
|
||||
[a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
|
||||
["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}", k],
|
||||
[a, "FIPS is enabled but this partition does not support FIPS"],
|
||||
["https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}", k],
|
||||
[a, "DualStack is enabled but this partition does not support DualStack"],
|
||||
["https://signin.{Region}.{PartitionResult#dnsSuffix}", k],
|
||||
[a, "Invalid Configuration: Missing Region"]
|
||||
]
|
||||
};
|
||||
const root = 2;
|
||||
const r = 100_000_000;
|
||||
const nodes = new Int32Array([
|
||||
-1, 1, -1,
|
||||
0, 15, 3,
|
||||
1, 4, r + 14,
|
||||
2, 5, r + 14,
|
||||
3, 11, 6,
|
||||
4, 10, 7,
|
||||
7, r + 4, 8,
|
||||
8, r + 5, 9,
|
||||
9, r + 6, r + 13,
|
||||
5, r + 11, r + 12,
|
||||
4, 13, 12,
|
||||
6, r + 9, r + 10,
|
||||
5, 14, r + 8,
|
||||
6, r + 7, r + 8,
|
||||
3, r + 1, 16,
|
||||
4, r + 2, r + 3,
|
||||
]);
|
||||
export const bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
import { awsEndpointFunctions } from "@aws-sdk/core/client";
|
||||
import { customEndpointFunctions, decideEndpoint, EndpointCache } from "@smithy/core/endpoints";
|
||||
import { bdd } from "./bdd";
|
||||
const cache = new EndpointCache({
|
||||
size: 50,
|
||||
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
|
||||
});
|
||||
export const defaultEndpointResolver = (endpointParams, context = {}) => {
|
||||
return cache.get(endpointParams, () => decideEndpoint(bdd, {
|
||||
endpointParams: endpointParams,
|
||||
logger: context.logger,
|
||||
}));
|
||||
};
|
||||
customEndpointFunctions.aws = awsEndpointFunctions;
|
||||
Reference in New Issue
Block a user