mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-03-13 18:17:11 -04:00
1224 lines
54 KiB
JavaScript
Generated
1224 lines
54 KiB
JavaScript
Generated
"use strict";
|
|
exports.id = 136;
|
|
exports.ids = [136];
|
|
exports.modules = {
|
|
|
|
/***/ 3723:
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.STSClient = exports.__Client = void 0;
|
|
const middleware_host_header_1 = __webpack_require__(2590);
|
|
const middleware_logger_1 = __webpack_require__(5242);
|
|
const middleware_recursion_detection_1 = __webpack_require__(1568);
|
|
const middleware_user_agent_1 = __webpack_require__(2959);
|
|
const config_resolver_1 = __webpack_require__(9316);
|
|
const core_1 = __webpack_require__(402);
|
|
const middleware_content_length_1 = __webpack_require__(7212);
|
|
const middleware_endpoint_1 = __webpack_require__(99);
|
|
const middleware_retry_1 = __webpack_require__(9618);
|
|
const smithy_client_1 = __webpack_require__(1411);
|
|
Object.defineProperty(exports, "__Client", ({ enumerable: true, get: function () { return smithy_client_1.Client; } }));
|
|
const httpAuthSchemeProvider_1 = __webpack_require__(7851);
|
|
const EndpointParameters_1 = __webpack_require__(6811);
|
|
const runtimeConfig_1 = __webpack_require__(6578);
|
|
const runtimeExtensions_1 = __webpack_require__(7742);
|
|
class STSClient extends smithy_client_1.Client {
|
|
config;
|
|
constructor(...[configuration]) {
|
|
const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {});
|
|
super(_config_0);
|
|
this.initConfig = _config_0;
|
|
const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0);
|
|
const _config_2 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_1);
|
|
const _config_3 = (0, middleware_retry_1.resolveRetryConfig)(_config_2);
|
|
const _config_4 = (0, config_resolver_1.resolveRegionConfig)(_config_3);
|
|
const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4);
|
|
const _config_6 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_5);
|
|
const _config_7 = (0, httpAuthSchemeProvider_1.resolveHttpAuthSchemeConfig)(_config_6);
|
|
const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_7, configuration?.extensions || []);
|
|
this.config = _config_8;
|
|
this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));
|
|
this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));
|
|
this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));
|
|
this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config));
|
|
this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config));
|
|
this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config));
|
|
this.middlewareStack.use((0, core_1.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
|
|
httpAuthSchemeParametersProvider: httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeParametersProvider,
|
|
identityProviderConfigProvider: async (config) => new core_1.DefaultIdentityProviderConfig({
|
|
"aws.auth#sigv4": config.credentials,
|
|
}),
|
|
}));
|
|
this.middlewareStack.use((0, core_1.getHttpSigningPlugin)(this.config));
|
|
}
|
|
destroy() {
|
|
super.destroy();
|
|
}
|
|
}
|
|
exports.STSClient = STSClient;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 4532:
|
|
/***/ ((__unused_webpack_module, exports) => {
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.resolveHttpAuthRuntimeConfig = exports.getHttpAuthExtensionConfiguration = void 0;
|
|
const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
let _credentials = runtimeConfig.credentials;
|
|
return {
|
|
setHttpAuthScheme(httpAuthScheme) {
|
|
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
if (index === -1) {
|
|
_httpAuthSchemes.push(httpAuthScheme);
|
|
}
|
|
else {
|
|
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
}
|
|
},
|
|
httpAuthSchemes() {
|
|
return _httpAuthSchemes;
|
|
},
|
|
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
},
|
|
httpAuthSchemeProvider() {
|
|
return _httpAuthSchemeProvider;
|
|
},
|
|
setCredentials(credentials) {
|
|
_credentials = credentials;
|
|
},
|
|
credentials() {
|
|
return _credentials;
|
|
},
|
|
};
|
|
};
|
|
exports.getHttpAuthExtensionConfiguration = getHttpAuthExtensionConfiguration;
|
|
const resolveHttpAuthRuntimeConfig = (config) => {
|
|
return {
|
|
httpAuthSchemes: config.httpAuthSchemes(),
|
|
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
credentials: config.credentials(),
|
|
};
|
|
};
|
|
exports.resolveHttpAuthRuntimeConfig = resolveHttpAuthRuntimeConfig;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 7851:
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.resolveHttpAuthSchemeConfig = exports.resolveStsAuthConfig = exports.defaultSTSHttpAuthSchemeProvider = exports.defaultSTSHttpAuthSchemeParametersProvider = void 0;
|
|
const core_1 = __webpack_require__(8704);
|
|
const util_middleware_1 = __webpack_require__(6324);
|
|
const STSClient_1 = __webpack_require__(3723);
|
|
const defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
return {
|
|
operation: (0, util_middleware_1.getSmithyContext)(context).operation,
|
|
region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
|
|
(() => {
|
|
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
})(),
|
|
};
|
|
};
|
|
exports.defaultSTSHttpAuthSchemeParametersProvider = defaultSTSHttpAuthSchemeParametersProvider;
|
|
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
return {
|
|
schemeId: "aws.auth#sigv4",
|
|
signingProperties: {
|
|
name: "sts",
|
|
region: authParameters.region,
|
|
},
|
|
propertiesExtractor: (config, context) => ({
|
|
signingProperties: {
|
|
config,
|
|
context,
|
|
},
|
|
}),
|
|
};
|
|
}
|
|
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
|
|
return {
|
|
schemeId: "smithy.api#noAuth",
|
|
};
|
|
}
|
|
const defaultSTSHttpAuthSchemeProvider = (authParameters) => {
|
|
const options = [];
|
|
switch (authParameters.operation) {
|
|
case "AssumeRoleWithWebIdentity": {
|
|
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
break;
|
|
}
|
|
default: {
|
|
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
}
|
|
}
|
|
return options;
|
|
};
|
|
exports.defaultSTSHttpAuthSchemeProvider = defaultSTSHttpAuthSchemeProvider;
|
|
const resolveStsAuthConfig = (input) => Object.assign(input, {
|
|
stsClientCtor: STSClient_1.STSClient,
|
|
});
|
|
exports.resolveStsAuthConfig = resolveStsAuthConfig;
|
|
const resolveHttpAuthSchemeConfig = (config) => {
|
|
const config_0 = (0, exports.resolveStsAuthConfig)(config);
|
|
const config_1 = (0, core_1.resolveAwsSdkSigV4Config)(config_0);
|
|
return Object.assign(config_1, {
|
|
authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),
|
|
});
|
|
};
|
|
exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 6811:
|
|
/***/ ((__unused_webpack_module, exports) => {
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.commonParams = exports.resolveClientEndpointParameters = void 0;
|
|
const resolveClientEndpointParameters = (options) => {
|
|
return Object.assign(options, {
|
|
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
useGlobalEndpoint: options.useGlobalEndpoint ?? false,
|
|
defaultSigningName: "sts",
|
|
});
|
|
};
|
|
exports.resolveClientEndpointParameters = resolveClientEndpointParameters;
|
|
exports.commonParams = {
|
|
UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
|
|
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
Region: { type: "builtInParams", name: "region" },
|
|
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 9765:
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.defaultEndpointResolver = void 0;
|
|
const util_endpoints_1 = __webpack_require__(3068);
|
|
const util_endpoints_2 = __webpack_require__(9674);
|
|
const ruleset_1 = __webpack_require__(1670);
|
|
const cache = new util_endpoints_2.EndpointCache({
|
|
size: 50,
|
|
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"],
|
|
});
|
|
const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {
|
|
endpointParams: endpointParams,
|
|
logger: context.logger,
|
|
}));
|
|
};
|
|
exports.defaultEndpointResolver = defaultEndpointResolver;
|
|
util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 1670:
|
|
/***/ ((__unused_webpack_module, exports) => {
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.ruleSet = void 0;
|
|
const F = "required", G = "type", H = "fn", I = "argv", J = "ref";
|
|
const a = false, b = true, c = "booleanEquals", d = "stringEquals", e = "sigv4", f = "sts", g = "us-east-1", h = "endpoint", i = "https://sts.{Region}.{PartitionResult#dnsSuffix}", j = "tree", k = "error", l = "getAttr", m = { [F]: false, [G]: "String" }, n = { [F]: true, "default": false, [G]: "Boolean" }, o = { [J]: "Endpoint" }, p = { [H]: "isSet", [I]: [{ [J]: "Region" }] }, q = { [J]: "Region" }, r = { [H]: "aws.partition", [I]: [q], "assign": "PartitionResult" }, s = { [J]: "UseFIPS" }, t = { [J]: "UseDualStack" }, u = { "url": "https://sts.amazonaws.com", "properties": { "authSchemes": [{ "name": e, "signingName": f, "signingRegion": g }] }, "headers": {} }, v = {}, w = { "conditions": [{ [H]: d, [I]: [q, "aws-global"] }], [h]: u, [G]: h }, x = { [H]: c, [I]: [s, true] }, y = { [H]: c, [I]: [t, true] }, z = { [H]: l, [I]: [{ [J]: "PartitionResult" }, "supportsFIPS"] }, A = { [J]: "PartitionResult" }, B = { [H]: c, [I]: [true, { [H]: l, [I]: [A, "supportsDualStack"] }] }, C = [{ [H]: "isSet", [I]: [o] }], D = [x], E = [y];
|
|
const _data = { version: "1.0", parameters: { Region: m, UseDualStack: n, UseFIPS: n, Endpoint: m, UseGlobalEndpoint: n }, rules: [{ conditions: [{ [H]: c, [I]: [{ [J]: "UseGlobalEndpoint" }, b] }, { [H]: "not", [I]: C }, p, r, { [H]: c, [I]: [s, a] }, { [H]: c, [I]: [t, a] }], rules: [{ conditions: [{ [H]: d, [I]: [q, "ap-northeast-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-south-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-southeast-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-southeast-2"] }], endpoint: u, [G]: h }, w, { conditions: [{ [H]: d, [I]: [q, "ca-central-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-central-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-north-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-2"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-3"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "sa-east-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, g] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-east-2"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-west-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-west-2"] }], endpoint: u, [G]: h }, { endpoint: { url: i, properties: { authSchemes: [{ name: e, signingName: f, signingRegion: "{Region}" }] }, headers: v }, [G]: h }], [G]: j }, { conditions: C, rules: [{ conditions: D, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [G]: k }, { conditions: E, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [G]: k }, { endpoint: { url: o, properties: v, headers: v }, [G]: h }], [G]: j }, { conditions: [p], rules: [{ conditions: [r], rules: [{ conditions: [x, y], rules: [{ conditions: [{ [H]: c, [I]: [b, z] }, B], rules: [{ endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G]: k }], [G]: j }, { conditions: D, rules: [{ conditions: [{ [H]: c, [I]: [z, b] }], rules: [{ conditions: [{ [H]: d, [I]: [{ [H]: l, [I]: [A, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v, headers: v }, [G]: h }, { endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "FIPS is enabled but this partition does not support FIPS", [G]: k }], [G]: j }, { conditions: E, rules: [{ conditions: [B], rules: [{ endpoint: { url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "DualStack is enabled but this partition does not support DualStack", [G]: k }], [G]: j }, w, { endpoint: { url: i, properties: v, headers: v }, [G]: h }], [G]: j }], [G]: j }, { error: "Invalid Configuration: Missing Region", [G]: k }] };
|
|
exports.ruleSet = _data;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 1136:
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
|
|
|
|
|
|
var STSClient = __webpack_require__(3723);
|
|
var smithyClient = __webpack_require__(1411);
|
|
var middlewareEndpoint = __webpack_require__(99);
|
|
var middlewareSerde = __webpack_require__(3255);
|
|
var EndpointParameters = __webpack_require__(6811);
|
|
var core = __webpack_require__(8704);
|
|
var protocolHttp = __webpack_require__(2356);
|
|
var client = __webpack_require__(5152);
|
|
|
|
class STSServiceException extends smithyClient.ServiceException {
|
|
constructor(options) {
|
|
super(options);
|
|
Object.setPrototypeOf(this, STSServiceException.prototype);
|
|
}
|
|
}
|
|
|
|
const CredentialsFilterSensitiveLog = (obj) => ({
|
|
...obj,
|
|
...(obj.SecretAccessKey && { SecretAccessKey: smithyClient.SENSITIVE_STRING }),
|
|
});
|
|
const AssumeRoleResponseFilterSensitiveLog = (obj) => ({
|
|
...obj,
|
|
...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
|
|
});
|
|
class ExpiredTokenException extends STSServiceException {
|
|
name = "ExpiredTokenException";
|
|
$fault = "client";
|
|
constructor(opts) {
|
|
super({
|
|
name: "ExpiredTokenException",
|
|
$fault: "client",
|
|
...opts,
|
|
});
|
|
Object.setPrototypeOf(this, ExpiredTokenException.prototype);
|
|
}
|
|
}
|
|
class MalformedPolicyDocumentException extends STSServiceException {
|
|
name = "MalformedPolicyDocumentException";
|
|
$fault = "client";
|
|
constructor(opts) {
|
|
super({
|
|
name: "MalformedPolicyDocumentException",
|
|
$fault: "client",
|
|
...opts,
|
|
});
|
|
Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype);
|
|
}
|
|
}
|
|
class PackedPolicyTooLargeException extends STSServiceException {
|
|
name = "PackedPolicyTooLargeException";
|
|
$fault = "client";
|
|
constructor(opts) {
|
|
super({
|
|
name: "PackedPolicyTooLargeException",
|
|
$fault: "client",
|
|
...opts,
|
|
});
|
|
Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype);
|
|
}
|
|
}
|
|
class RegionDisabledException extends STSServiceException {
|
|
name = "RegionDisabledException";
|
|
$fault = "client";
|
|
constructor(opts) {
|
|
super({
|
|
name: "RegionDisabledException",
|
|
$fault: "client",
|
|
...opts,
|
|
});
|
|
Object.setPrototypeOf(this, RegionDisabledException.prototype);
|
|
}
|
|
}
|
|
class IDPRejectedClaimException extends STSServiceException {
|
|
name = "IDPRejectedClaimException";
|
|
$fault = "client";
|
|
constructor(opts) {
|
|
super({
|
|
name: "IDPRejectedClaimException",
|
|
$fault: "client",
|
|
...opts,
|
|
});
|
|
Object.setPrototypeOf(this, IDPRejectedClaimException.prototype);
|
|
}
|
|
}
|
|
class InvalidIdentityTokenException extends STSServiceException {
|
|
name = "InvalidIdentityTokenException";
|
|
$fault = "client";
|
|
constructor(opts) {
|
|
super({
|
|
name: "InvalidIdentityTokenException",
|
|
$fault: "client",
|
|
...opts,
|
|
});
|
|
Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype);
|
|
}
|
|
}
|
|
const AssumeRoleWithWebIdentityRequestFilterSensitiveLog = (obj) => ({
|
|
...obj,
|
|
...(obj.WebIdentityToken && { WebIdentityToken: smithyClient.SENSITIVE_STRING }),
|
|
});
|
|
const AssumeRoleWithWebIdentityResponseFilterSensitiveLog = (obj) => ({
|
|
...obj,
|
|
...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
|
|
});
|
|
class IDPCommunicationErrorException extends STSServiceException {
|
|
name = "IDPCommunicationErrorException";
|
|
$fault = "client";
|
|
constructor(opts) {
|
|
super({
|
|
name: "IDPCommunicationErrorException",
|
|
$fault: "client",
|
|
...opts,
|
|
});
|
|
Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype);
|
|
}
|
|
}
|
|
|
|
const se_AssumeRoleCommand = async (input, context) => {
|
|
const headers = SHARED_HEADERS;
|
|
let body;
|
|
body = buildFormUrlencodedString({
|
|
...se_AssumeRoleRequest(input),
|
|
[_A]: _AR,
|
|
[_V]: _,
|
|
});
|
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
};
|
|
const se_AssumeRoleWithWebIdentityCommand = async (input, context) => {
|
|
const headers = SHARED_HEADERS;
|
|
let body;
|
|
body = buildFormUrlencodedString({
|
|
...se_AssumeRoleWithWebIdentityRequest(input),
|
|
[_A]: _ARWWI,
|
|
[_V]: _,
|
|
});
|
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
};
|
|
const de_AssumeRoleCommand = async (output, context) => {
|
|
if (output.statusCode >= 300) {
|
|
return de_CommandError(output, context);
|
|
}
|
|
const data = await core.parseXmlBody(output.body, context);
|
|
let contents = {};
|
|
contents = de_AssumeRoleResponse(data.AssumeRoleResult);
|
|
const response = {
|
|
$metadata: deserializeMetadata(output),
|
|
...contents,
|
|
};
|
|
return response;
|
|
};
|
|
const de_AssumeRoleWithWebIdentityCommand = async (output, context) => {
|
|
if (output.statusCode >= 300) {
|
|
return de_CommandError(output, context);
|
|
}
|
|
const data = await core.parseXmlBody(output.body, context);
|
|
let contents = {};
|
|
contents = de_AssumeRoleWithWebIdentityResponse(data.AssumeRoleWithWebIdentityResult);
|
|
const response = {
|
|
$metadata: deserializeMetadata(output),
|
|
...contents,
|
|
};
|
|
return response;
|
|
};
|
|
const de_CommandError = async (output, context) => {
|
|
const parsedOutput = {
|
|
...output,
|
|
body: await core.parseXmlErrorBody(output.body, context),
|
|
};
|
|
const errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
switch (errorCode) {
|
|
case "ExpiredTokenException":
|
|
case "com.amazonaws.sts#ExpiredTokenException":
|
|
throw await de_ExpiredTokenExceptionRes(parsedOutput);
|
|
case "MalformedPolicyDocument":
|
|
case "com.amazonaws.sts#MalformedPolicyDocumentException":
|
|
throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput);
|
|
case "PackedPolicyTooLarge":
|
|
case "com.amazonaws.sts#PackedPolicyTooLargeException":
|
|
throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput);
|
|
case "RegionDisabledException":
|
|
case "com.amazonaws.sts#RegionDisabledException":
|
|
throw await de_RegionDisabledExceptionRes(parsedOutput);
|
|
case "IDPCommunicationError":
|
|
case "com.amazonaws.sts#IDPCommunicationErrorException":
|
|
throw await de_IDPCommunicationErrorExceptionRes(parsedOutput);
|
|
case "IDPRejectedClaim":
|
|
case "com.amazonaws.sts#IDPRejectedClaimException":
|
|
throw await de_IDPRejectedClaimExceptionRes(parsedOutput);
|
|
case "InvalidIdentityToken":
|
|
case "com.amazonaws.sts#InvalidIdentityTokenException":
|
|
throw await de_InvalidIdentityTokenExceptionRes(parsedOutput);
|
|
default:
|
|
const parsedBody = parsedOutput.body;
|
|
return throwDefaultError({
|
|
output,
|
|
parsedBody: parsedBody.Error,
|
|
errorCode,
|
|
});
|
|
}
|
|
};
|
|
const de_ExpiredTokenExceptionRes = async (parsedOutput, context) => {
|
|
const body = parsedOutput.body;
|
|
const deserialized = de_ExpiredTokenException(body.Error);
|
|
const exception = new ExpiredTokenException({
|
|
$metadata: deserializeMetadata(parsedOutput),
|
|
...deserialized,
|
|
});
|
|
return smithyClient.decorateServiceException(exception, body);
|
|
};
|
|
const de_IDPCommunicationErrorExceptionRes = async (parsedOutput, context) => {
|
|
const body = parsedOutput.body;
|
|
const deserialized = de_IDPCommunicationErrorException(body.Error);
|
|
const exception = new IDPCommunicationErrorException({
|
|
$metadata: deserializeMetadata(parsedOutput),
|
|
...deserialized,
|
|
});
|
|
return smithyClient.decorateServiceException(exception, body);
|
|
};
|
|
const de_IDPRejectedClaimExceptionRes = async (parsedOutput, context) => {
|
|
const body = parsedOutput.body;
|
|
const deserialized = de_IDPRejectedClaimException(body.Error);
|
|
const exception = new IDPRejectedClaimException({
|
|
$metadata: deserializeMetadata(parsedOutput),
|
|
...deserialized,
|
|
});
|
|
return smithyClient.decorateServiceException(exception, body);
|
|
};
|
|
const de_InvalidIdentityTokenExceptionRes = async (parsedOutput, context) => {
|
|
const body = parsedOutput.body;
|
|
const deserialized = de_InvalidIdentityTokenException(body.Error);
|
|
const exception = new InvalidIdentityTokenException({
|
|
$metadata: deserializeMetadata(parsedOutput),
|
|
...deserialized,
|
|
});
|
|
return smithyClient.decorateServiceException(exception, body);
|
|
};
|
|
const de_MalformedPolicyDocumentExceptionRes = async (parsedOutput, context) => {
|
|
const body = parsedOutput.body;
|
|
const deserialized = de_MalformedPolicyDocumentException(body.Error);
|
|
const exception = new MalformedPolicyDocumentException({
|
|
$metadata: deserializeMetadata(parsedOutput),
|
|
...deserialized,
|
|
});
|
|
return smithyClient.decorateServiceException(exception, body);
|
|
};
|
|
const de_PackedPolicyTooLargeExceptionRes = async (parsedOutput, context) => {
|
|
const body = parsedOutput.body;
|
|
const deserialized = de_PackedPolicyTooLargeException(body.Error);
|
|
const exception = new PackedPolicyTooLargeException({
|
|
$metadata: deserializeMetadata(parsedOutput),
|
|
...deserialized,
|
|
});
|
|
return smithyClient.decorateServiceException(exception, body);
|
|
};
|
|
const de_RegionDisabledExceptionRes = async (parsedOutput, context) => {
|
|
const body = parsedOutput.body;
|
|
const deserialized = de_RegionDisabledException(body.Error);
|
|
const exception = new RegionDisabledException({
|
|
$metadata: deserializeMetadata(parsedOutput),
|
|
...deserialized,
|
|
});
|
|
return smithyClient.decorateServiceException(exception, body);
|
|
};
|
|
const se_AssumeRoleRequest = (input, context) => {
|
|
const entries = {};
|
|
if (input[_RA] != null) {
|
|
entries[_RA] = input[_RA];
|
|
}
|
|
if (input[_RSN] != null) {
|
|
entries[_RSN] = input[_RSN];
|
|
}
|
|
if (input[_PA] != null) {
|
|
const memberEntries = se_policyDescriptorListType(input[_PA]);
|
|
if (input[_PA]?.length === 0) {
|
|
entries.PolicyArns = [];
|
|
}
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
const loc = `PolicyArns.${key}`;
|
|
entries[loc] = value;
|
|
});
|
|
}
|
|
if (input[_P] != null) {
|
|
entries[_P] = input[_P];
|
|
}
|
|
if (input[_DS] != null) {
|
|
entries[_DS] = input[_DS];
|
|
}
|
|
if (input[_T] != null) {
|
|
const memberEntries = se_tagListType(input[_T]);
|
|
if (input[_T]?.length === 0) {
|
|
entries.Tags = [];
|
|
}
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
const loc = `Tags.${key}`;
|
|
entries[loc] = value;
|
|
});
|
|
}
|
|
if (input[_TTK] != null) {
|
|
const memberEntries = se_tagKeyListType(input[_TTK]);
|
|
if (input[_TTK]?.length === 0) {
|
|
entries.TransitiveTagKeys = [];
|
|
}
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
const loc = `TransitiveTagKeys.${key}`;
|
|
entries[loc] = value;
|
|
});
|
|
}
|
|
if (input[_EI] != null) {
|
|
entries[_EI] = input[_EI];
|
|
}
|
|
if (input[_SN] != null) {
|
|
entries[_SN] = input[_SN];
|
|
}
|
|
if (input[_TC] != null) {
|
|
entries[_TC] = input[_TC];
|
|
}
|
|
if (input[_SI] != null) {
|
|
entries[_SI] = input[_SI];
|
|
}
|
|
if (input[_PC] != null) {
|
|
const memberEntries = se_ProvidedContextsListType(input[_PC]);
|
|
if (input[_PC]?.length === 0) {
|
|
entries.ProvidedContexts = [];
|
|
}
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
const loc = `ProvidedContexts.${key}`;
|
|
entries[loc] = value;
|
|
});
|
|
}
|
|
return entries;
|
|
};
|
|
const se_AssumeRoleWithWebIdentityRequest = (input, context) => {
|
|
const entries = {};
|
|
if (input[_RA] != null) {
|
|
entries[_RA] = input[_RA];
|
|
}
|
|
if (input[_RSN] != null) {
|
|
entries[_RSN] = input[_RSN];
|
|
}
|
|
if (input[_WIT] != null) {
|
|
entries[_WIT] = input[_WIT];
|
|
}
|
|
if (input[_PI] != null) {
|
|
entries[_PI] = input[_PI];
|
|
}
|
|
if (input[_PA] != null) {
|
|
const memberEntries = se_policyDescriptorListType(input[_PA]);
|
|
if (input[_PA]?.length === 0) {
|
|
entries.PolicyArns = [];
|
|
}
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
const loc = `PolicyArns.${key}`;
|
|
entries[loc] = value;
|
|
});
|
|
}
|
|
if (input[_P] != null) {
|
|
entries[_P] = input[_P];
|
|
}
|
|
if (input[_DS] != null) {
|
|
entries[_DS] = input[_DS];
|
|
}
|
|
return entries;
|
|
};
|
|
const se_policyDescriptorListType = (input, context) => {
|
|
const entries = {};
|
|
let counter = 1;
|
|
for (const entry of input) {
|
|
if (entry === null) {
|
|
continue;
|
|
}
|
|
const memberEntries = se_PolicyDescriptorType(entry);
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
entries[`member.${counter}.${key}`] = value;
|
|
});
|
|
counter++;
|
|
}
|
|
return entries;
|
|
};
|
|
const se_PolicyDescriptorType = (input, context) => {
|
|
const entries = {};
|
|
if (input[_a] != null) {
|
|
entries[_a] = input[_a];
|
|
}
|
|
return entries;
|
|
};
|
|
const se_ProvidedContext = (input, context) => {
|
|
const entries = {};
|
|
if (input[_PAr] != null) {
|
|
entries[_PAr] = input[_PAr];
|
|
}
|
|
if (input[_CA] != null) {
|
|
entries[_CA] = input[_CA];
|
|
}
|
|
return entries;
|
|
};
|
|
const se_ProvidedContextsListType = (input, context) => {
|
|
const entries = {};
|
|
let counter = 1;
|
|
for (const entry of input) {
|
|
if (entry === null) {
|
|
continue;
|
|
}
|
|
const memberEntries = se_ProvidedContext(entry);
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
entries[`member.${counter}.${key}`] = value;
|
|
});
|
|
counter++;
|
|
}
|
|
return entries;
|
|
};
|
|
const se_Tag = (input, context) => {
|
|
const entries = {};
|
|
if (input[_K] != null) {
|
|
entries[_K] = input[_K];
|
|
}
|
|
if (input[_Va] != null) {
|
|
entries[_Va] = input[_Va];
|
|
}
|
|
return entries;
|
|
};
|
|
const se_tagKeyListType = (input, context) => {
|
|
const entries = {};
|
|
let counter = 1;
|
|
for (const entry of input) {
|
|
if (entry === null) {
|
|
continue;
|
|
}
|
|
entries[`member.${counter}`] = entry;
|
|
counter++;
|
|
}
|
|
return entries;
|
|
};
|
|
const se_tagListType = (input, context) => {
|
|
const entries = {};
|
|
let counter = 1;
|
|
for (const entry of input) {
|
|
if (entry === null) {
|
|
continue;
|
|
}
|
|
const memberEntries = se_Tag(entry);
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
entries[`member.${counter}.${key}`] = value;
|
|
});
|
|
counter++;
|
|
}
|
|
return entries;
|
|
};
|
|
const de_AssumedRoleUser = (output, context) => {
|
|
const contents = {};
|
|
if (output[_ARI] != null) {
|
|
contents[_ARI] = smithyClient.expectString(output[_ARI]);
|
|
}
|
|
if (output[_Ar] != null) {
|
|
contents[_Ar] = smithyClient.expectString(output[_Ar]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_AssumeRoleResponse = (output, context) => {
|
|
const contents = {};
|
|
if (output[_C] != null) {
|
|
contents[_C] = de_Credentials(output[_C]);
|
|
}
|
|
if (output[_ARU] != null) {
|
|
contents[_ARU] = de_AssumedRoleUser(output[_ARU]);
|
|
}
|
|
if (output[_PPS] != null) {
|
|
contents[_PPS] = smithyClient.strictParseInt32(output[_PPS]);
|
|
}
|
|
if (output[_SI] != null) {
|
|
contents[_SI] = smithyClient.expectString(output[_SI]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_AssumeRoleWithWebIdentityResponse = (output, context) => {
|
|
const contents = {};
|
|
if (output[_C] != null) {
|
|
contents[_C] = de_Credentials(output[_C]);
|
|
}
|
|
if (output[_SFWIT] != null) {
|
|
contents[_SFWIT] = smithyClient.expectString(output[_SFWIT]);
|
|
}
|
|
if (output[_ARU] != null) {
|
|
contents[_ARU] = de_AssumedRoleUser(output[_ARU]);
|
|
}
|
|
if (output[_PPS] != null) {
|
|
contents[_PPS] = smithyClient.strictParseInt32(output[_PPS]);
|
|
}
|
|
if (output[_Pr] != null) {
|
|
contents[_Pr] = smithyClient.expectString(output[_Pr]);
|
|
}
|
|
if (output[_Au] != null) {
|
|
contents[_Au] = smithyClient.expectString(output[_Au]);
|
|
}
|
|
if (output[_SI] != null) {
|
|
contents[_SI] = smithyClient.expectString(output[_SI]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_Credentials = (output, context) => {
|
|
const contents = {};
|
|
if (output[_AKI] != null) {
|
|
contents[_AKI] = smithyClient.expectString(output[_AKI]);
|
|
}
|
|
if (output[_SAK] != null) {
|
|
contents[_SAK] = smithyClient.expectString(output[_SAK]);
|
|
}
|
|
if (output[_ST] != null) {
|
|
contents[_ST] = smithyClient.expectString(output[_ST]);
|
|
}
|
|
if (output[_E] != null) {
|
|
contents[_E] = smithyClient.expectNonNull(smithyClient.parseRfc3339DateTimeWithOffset(output[_E]));
|
|
}
|
|
return contents;
|
|
};
|
|
const de_ExpiredTokenException = (output, context) => {
|
|
const contents = {};
|
|
if (output[_m] != null) {
|
|
contents[_m] = smithyClient.expectString(output[_m]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_IDPCommunicationErrorException = (output, context) => {
|
|
const contents = {};
|
|
if (output[_m] != null) {
|
|
contents[_m] = smithyClient.expectString(output[_m]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_IDPRejectedClaimException = (output, context) => {
|
|
const contents = {};
|
|
if (output[_m] != null) {
|
|
contents[_m] = smithyClient.expectString(output[_m]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_InvalidIdentityTokenException = (output, context) => {
|
|
const contents = {};
|
|
if (output[_m] != null) {
|
|
contents[_m] = smithyClient.expectString(output[_m]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_MalformedPolicyDocumentException = (output, context) => {
|
|
const contents = {};
|
|
if (output[_m] != null) {
|
|
contents[_m] = smithyClient.expectString(output[_m]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_PackedPolicyTooLargeException = (output, context) => {
|
|
const contents = {};
|
|
if (output[_m] != null) {
|
|
contents[_m] = smithyClient.expectString(output[_m]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_RegionDisabledException = (output, context) => {
|
|
const contents = {};
|
|
if (output[_m] != null) {
|
|
contents[_m] = smithyClient.expectString(output[_m]);
|
|
}
|
|
return contents;
|
|
};
|
|
const deserializeMetadata = (output) => ({
|
|
httpStatusCode: output.statusCode,
|
|
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
extendedRequestId: output.headers["x-amz-id-2"],
|
|
cfId: output.headers["x-amz-cf-id"],
|
|
});
|
|
const throwDefaultError = smithyClient.withBaseException(STSServiceException);
|
|
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
const contents = {
|
|
protocol,
|
|
hostname,
|
|
port,
|
|
method: "POST",
|
|
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
headers,
|
|
};
|
|
if (body !== undefined) {
|
|
contents.body = body;
|
|
}
|
|
return new protocolHttp.HttpRequest(contents);
|
|
};
|
|
const SHARED_HEADERS = {
|
|
"content-type": "application/x-www-form-urlencoded",
|
|
};
|
|
const _ = "2011-06-15";
|
|
const _A = "Action";
|
|
const _AKI = "AccessKeyId";
|
|
const _AR = "AssumeRole";
|
|
const _ARI = "AssumedRoleId";
|
|
const _ARU = "AssumedRoleUser";
|
|
const _ARWWI = "AssumeRoleWithWebIdentity";
|
|
const _Ar = "Arn";
|
|
const _Au = "Audience";
|
|
const _C = "Credentials";
|
|
const _CA = "ContextAssertion";
|
|
const _DS = "DurationSeconds";
|
|
const _E = "Expiration";
|
|
const _EI = "ExternalId";
|
|
const _K = "Key";
|
|
const _P = "Policy";
|
|
const _PA = "PolicyArns";
|
|
const _PAr = "ProviderArn";
|
|
const _PC = "ProvidedContexts";
|
|
const _PI = "ProviderId";
|
|
const _PPS = "PackedPolicySize";
|
|
const _Pr = "Provider";
|
|
const _RA = "RoleArn";
|
|
const _RSN = "RoleSessionName";
|
|
const _SAK = "SecretAccessKey";
|
|
const _SFWIT = "SubjectFromWebIdentityToken";
|
|
const _SI = "SourceIdentity";
|
|
const _SN = "SerialNumber";
|
|
const _ST = "SessionToken";
|
|
const _T = "Tags";
|
|
const _TC = "TokenCode";
|
|
const _TTK = "TransitiveTagKeys";
|
|
const _V = "Version";
|
|
const _Va = "Value";
|
|
const _WIT = "WebIdentityToken";
|
|
const _a = "arn";
|
|
const _m = "message";
|
|
const buildFormUrlencodedString = (formEntries) => Object.entries(formEntries)
|
|
.map(([key, value]) => smithyClient.extendedEncodeURIComponent(key) + "=" + smithyClient.extendedEncodeURIComponent(value))
|
|
.join("&");
|
|
const loadQueryErrorCode = (output, data) => {
|
|
if (data.Error?.Code !== undefined) {
|
|
return data.Error.Code;
|
|
}
|
|
if (output.statusCode == 404) {
|
|
return "NotFound";
|
|
}
|
|
};
|
|
|
|
class AssumeRoleCommand extends smithyClient.Command
|
|
.classBuilder()
|
|
.ep(EndpointParameters.commonParams)
|
|
.m(function (Command, cs, config, o) {
|
|
return [
|
|
middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
|
|
middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
];
|
|
})
|
|
.s("AWSSecurityTokenServiceV20110615", "AssumeRole", {})
|
|
.n("STSClient", "AssumeRoleCommand")
|
|
.f(void 0, AssumeRoleResponseFilterSensitiveLog)
|
|
.ser(se_AssumeRoleCommand)
|
|
.de(de_AssumeRoleCommand)
|
|
.build() {
|
|
}
|
|
|
|
class AssumeRoleWithWebIdentityCommand extends smithyClient.Command
|
|
.classBuilder()
|
|
.ep(EndpointParameters.commonParams)
|
|
.m(function (Command, cs, config, o) {
|
|
return [
|
|
middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
|
|
middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
];
|
|
})
|
|
.s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {})
|
|
.n("STSClient", "AssumeRoleWithWebIdentityCommand")
|
|
.f(AssumeRoleWithWebIdentityRequestFilterSensitiveLog, AssumeRoleWithWebIdentityResponseFilterSensitiveLog)
|
|
.ser(se_AssumeRoleWithWebIdentityCommand)
|
|
.de(de_AssumeRoleWithWebIdentityCommand)
|
|
.build() {
|
|
}
|
|
|
|
const commands = {
|
|
AssumeRoleCommand,
|
|
AssumeRoleWithWebIdentityCommand,
|
|
};
|
|
class STS extends STSClient.STSClient {
|
|
}
|
|
smithyClient.createAggregatedClient(commands, STS);
|
|
|
|
const ASSUME_ROLE_DEFAULT_REGION = "us-east-1";
|
|
const getAccountIdFromAssumedRoleUser = (assumedRoleUser) => {
|
|
if (typeof assumedRoleUser?.Arn === "string") {
|
|
const arnComponents = assumedRoleUser.Arn.split(":");
|
|
if (arnComponents.length > 4 && arnComponents[4] !== "") {
|
|
return arnComponents[4];
|
|
}
|
|
}
|
|
return undefined;
|
|
};
|
|
const resolveRegion = async (_region, _parentRegion, credentialProviderLogger) => {
|
|
const region = typeof _region === "function" ? await _region() : _region;
|
|
const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion;
|
|
credentialProviderLogger?.debug?.("@aws-sdk/client-sts::resolveRegion", "accepting first of:", `${region} (provider)`, `${parentRegion} (parent client)`, `${ASSUME_ROLE_DEFAULT_REGION} (STS default)`);
|
|
return region ?? parentRegion ?? ASSUME_ROLE_DEFAULT_REGION;
|
|
};
|
|
const getDefaultRoleAssumer$1 = (stsOptions, STSClient) => {
|
|
let stsClient;
|
|
let closureSourceCreds;
|
|
return async (sourceCreds, params) => {
|
|
closureSourceCreds = sourceCreds;
|
|
if (!stsClient) {
|
|
const { logger = stsOptions?.parentClientConfig?.logger, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, } = stsOptions;
|
|
const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger);
|
|
const isCompatibleRequestHandler = !isH2(requestHandler);
|
|
stsClient = new STSClient({
|
|
profile: stsOptions?.parentClientConfig?.profile,
|
|
credentialDefaultProvider: () => async () => closureSourceCreds,
|
|
region: resolvedRegion,
|
|
requestHandler: isCompatibleRequestHandler ? requestHandler : undefined,
|
|
logger: logger,
|
|
});
|
|
}
|
|
const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleCommand(params));
|
|
if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
|
|
throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`);
|
|
}
|
|
const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser);
|
|
const credentials = {
|
|
accessKeyId: Credentials.AccessKeyId,
|
|
secretAccessKey: Credentials.SecretAccessKey,
|
|
sessionToken: Credentials.SessionToken,
|
|
expiration: Credentials.Expiration,
|
|
...(Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }),
|
|
...(accountId && { accountId }),
|
|
};
|
|
client.setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i");
|
|
return credentials;
|
|
};
|
|
};
|
|
const getDefaultRoleAssumerWithWebIdentity$1 = (stsOptions, STSClient) => {
|
|
let stsClient;
|
|
return async (params) => {
|
|
if (!stsClient) {
|
|
const { logger = stsOptions?.parentClientConfig?.logger, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, } = stsOptions;
|
|
const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger);
|
|
const isCompatibleRequestHandler = !isH2(requestHandler);
|
|
stsClient = new STSClient({
|
|
profile: stsOptions?.parentClientConfig?.profile,
|
|
region: resolvedRegion,
|
|
requestHandler: isCompatibleRequestHandler ? requestHandler : undefined,
|
|
logger: logger,
|
|
});
|
|
}
|
|
const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));
|
|
if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
|
|
throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`);
|
|
}
|
|
const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser);
|
|
const credentials = {
|
|
accessKeyId: Credentials.AccessKeyId,
|
|
secretAccessKey: Credentials.SecretAccessKey,
|
|
sessionToken: Credentials.SessionToken,
|
|
expiration: Credentials.Expiration,
|
|
...(Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }),
|
|
...(accountId && { accountId }),
|
|
};
|
|
if (accountId) {
|
|
client.setCredentialFeature(credentials, "RESOLVED_ACCOUNT_ID", "T");
|
|
}
|
|
client.setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID", "k");
|
|
return credentials;
|
|
};
|
|
};
|
|
const isH2 = (requestHandler) => {
|
|
return requestHandler?.metadata?.handlerProtocol === "h2";
|
|
};
|
|
|
|
const getCustomizableStsClientCtor = (baseCtor, customizations) => {
|
|
if (!customizations)
|
|
return baseCtor;
|
|
else
|
|
return class CustomizableSTSClient extends baseCtor {
|
|
constructor(config) {
|
|
super(config);
|
|
for (const customization of customizations) {
|
|
this.middlewareStack.use(customization);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const getDefaultRoleAssumer = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumer$1(stsOptions, getCustomizableStsClientCtor(STSClient.STSClient, stsPlugins));
|
|
const getDefaultRoleAssumerWithWebIdentity = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity$1(stsOptions, getCustomizableStsClientCtor(STSClient.STSClient, stsPlugins));
|
|
const decorateDefaultCredentialProvider = (provider) => (input) => provider({
|
|
roleAssumer: getDefaultRoleAssumer(input),
|
|
roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(input),
|
|
...input,
|
|
});
|
|
|
|
Object.defineProperty(exports, "$Command", ({
|
|
enumerable: true,
|
|
get: function () { return smithyClient.Command; }
|
|
}));
|
|
exports.AssumeRoleCommand = AssumeRoleCommand;
|
|
exports.AssumeRoleResponseFilterSensitiveLog = AssumeRoleResponseFilterSensitiveLog;
|
|
exports.AssumeRoleWithWebIdentityCommand = AssumeRoleWithWebIdentityCommand;
|
|
exports.AssumeRoleWithWebIdentityRequestFilterSensitiveLog = AssumeRoleWithWebIdentityRequestFilterSensitiveLog;
|
|
exports.AssumeRoleWithWebIdentityResponseFilterSensitiveLog = AssumeRoleWithWebIdentityResponseFilterSensitiveLog;
|
|
exports.CredentialsFilterSensitiveLog = CredentialsFilterSensitiveLog;
|
|
exports.ExpiredTokenException = ExpiredTokenException;
|
|
exports.IDPCommunicationErrorException = IDPCommunicationErrorException;
|
|
exports.IDPRejectedClaimException = IDPRejectedClaimException;
|
|
exports.InvalidIdentityTokenException = InvalidIdentityTokenException;
|
|
exports.MalformedPolicyDocumentException = MalformedPolicyDocumentException;
|
|
exports.PackedPolicyTooLargeException = PackedPolicyTooLargeException;
|
|
exports.RegionDisabledException = RegionDisabledException;
|
|
exports.STS = STS;
|
|
exports.STSServiceException = STSServiceException;
|
|
exports.decorateDefaultCredentialProvider = decorateDefaultCredentialProvider;
|
|
exports.getDefaultRoleAssumer = getDefaultRoleAssumer;
|
|
exports.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity;
|
|
Object.keys(STSClient).forEach(function (k) {
|
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
enumerable: true,
|
|
get: function () { return STSClient[k]; }
|
|
});
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 6578:
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.getRuntimeConfig = void 0;
|
|
const tslib_1 = __webpack_require__(1860);
|
|
const package_json_1 = tslib_1.__importDefault(__webpack_require__(9955));
|
|
const core_1 = __webpack_require__(8704);
|
|
const util_user_agent_node_1 = __webpack_require__(1656);
|
|
const config_resolver_1 = __webpack_require__(9316);
|
|
const core_2 = __webpack_require__(402);
|
|
const hash_node_1 = __webpack_require__(5092);
|
|
const middleware_retry_1 = __webpack_require__(9618);
|
|
const node_config_provider_1 = __webpack_require__(5704);
|
|
const node_http_handler_1 = __webpack_require__(1279);
|
|
const util_body_length_node_1 = __webpack_require__(3638);
|
|
const util_retry_1 = __webpack_require__(5518);
|
|
const runtimeConfig_shared_1 = __webpack_require__(4443);
|
|
const smithy_client_1 = __webpack_require__(1411);
|
|
const util_defaults_mode_node_1 = __webpack_require__(5435);
|
|
const smithy_client_2 = __webpack_require__(1411);
|
|
const getRuntimeConfig = (config) => {
|
|
(0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
|
|
const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
|
|
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
|
|
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
|
|
(0, core_1.emitWarningIfUnsupportedVersion)(process.version);
|
|
const loaderConfig = {
|
|
profile: config?.profile,
|
|
logger: clientSharedValues.logger,
|
|
};
|
|
return {
|
|
...clientSharedValues,
|
|
...config,
|
|
runtime: "node",
|
|
defaultsMode,
|
|
authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
|
|
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
(0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
|
|
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
{
|
|
schemeId: "aws.auth#sigv4",
|
|
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") ||
|
|
(async (idProps) => await config.credentialDefaultProvider(idProps?.__config || {})()),
|
|
signer: new core_1.AwsSdkSigV4Signer(),
|
|
},
|
|
{
|
|
schemeId: "smithy.api#noAuth",
|
|
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
signer: new core_2.NoAuthSigner(),
|
|
},
|
|
],
|
|
maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
region: config?.region ??
|
|
(0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
retryMode: config?.retryMode ??
|
|
(0, node_config_provider_1.loadConfig)({
|
|
...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
|
|
}, config),
|
|
sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
|
|
streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
|
|
useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
};
|
|
};
|
|
exports.getRuntimeConfig = getRuntimeConfig;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 4443:
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.getRuntimeConfig = void 0;
|
|
const core_1 = __webpack_require__(8704);
|
|
const core_2 = __webpack_require__(402);
|
|
const smithy_client_1 = __webpack_require__(1411);
|
|
const url_parser_1 = __webpack_require__(4494);
|
|
const util_base64_1 = __webpack_require__(8385);
|
|
const util_utf8_1 = __webpack_require__(1577);
|
|
const httpAuthSchemeProvider_1 = __webpack_require__(7851);
|
|
const endpointResolver_1 = __webpack_require__(9765);
|
|
const getRuntimeConfig = (config) => {
|
|
return {
|
|
apiVersion: "2011-06-15",
|
|
base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,
|
|
base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
|
|
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
|
|
extensions: config?.extensions ?? [],
|
|
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeProvider,
|
|
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
{
|
|
schemeId: "aws.auth#sigv4",
|
|
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
signer: new core_1.AwsSdkSigV4Signer(),
|
|
},
|
|
{
|
|
schemeId: "smithy.api#noAuth",
|
|
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
signer: new core_2.NoAuthSigner(),
|
|
},
|
|
],
|
|
logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
|
|
serviceId: config?.serviceId ?? "STS",
|
|
urlParser: config?.urlParser ?? url_parser_1.parseUrl,
|
|
utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
|
|
utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
|
|
};
|
|
};
|
|
exports.getRuntimeConfig = getRuntimeConfig;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 7742:
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.resolveRuntimeExtensions = void 0;
|
|
const region_config_resolver_1 = __webpack_require__(6463);
|
|
const protocol_http_1 = __webpack_require__(2356);
|
|
const smithy_client_1 = __webpack_require__(1411);
|
|
const httpAuthExtensionConfiguration_1 = __webpack_require__(4532);
|
|
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
const extensionConfiguration = Object.assign((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig), (0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig), (0, httpAuthExtensionConfiguration_1.getHttpAuthExtensionConfiguration)(runtimeConfig));
|
|
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
return Object.assign(runtimeConfig, (0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), (0, httpAuthExtensionConfiguration_1.resolveHttpAuthRuntimeConfig)(extensionConfiguration));
|
|
};
|
|
exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 9955:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = /*#__PURE__*/JSON.parse('{"name":"@aws-sdk/nested-clients","version":"3.911.0","description":"Nested clients for AWS SDK packages.","main":"./dist-cjs/index.js","module":"./dist-es/index.js","types":"./dist-types/index.d.ts","scripts":{"build":"yarn lint && concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"node ../../scripts/compilation/inline nested-clients","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","lint":"node ../../scripts/validation/submodules-linter.js --pkg nested-clients","test":"yarn g:vitest run","test:watch":"yarn g:vitest watch"},"engines":{"node":">=18.0.0"},"sideEffects":false,"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","dependencies":{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.911.0","@aws-sdk/middleware-host-header":"3.910.0","@aws-sdk/middleware-logger":"3.910.0","@aws-sdk/middleware-recursion-detection":"3.910.0","@aws-sdk/middleware-user-agent":"3.911.0","@aws-sdk/region-config-resolver":"3.910.0","@aws-sdk/types":"3.910.0","@aws-sdk/util-endpoints":"3.910.0","@aws-sdk/util-user-agent-browser":"3.910.0","@aws-sdk/util-user-agent-node":"3.911.0","@smithy/config-resolver":"^4.3.2","@smithy/core":"^3.16.1","@smithy/fetch-http-handler":"^5.3.3","@smithy/hash-node":"^4.2.2","@smithy/invalid-dependency":"^4.2.2","@smithy/middleware-content-length":"^4.2.2","@smithy/middleware-endpoint":"^4.3.3","@smithy/middleware-retry":"^4.4.3","@smithy/middleware-serde":"^4.2.2","@smithy/middleware-stack":"^4.2.2","@smithy/node-config-provider":"^4.3.2","@smithy/node-http-handler":"^4.4.1","@smithy/protocol-http":"^5.3.2","@smithy/smithy-client":"^4.8.1","@smithy/types":"^4.7.1","@smithy/url-parser":"^4.2.2","@smithy/util-base64":"^4.3.0","@smithy/util-body-length-browser":"^4.2.0","@smithy/util-body-length-node":"^4.2.1","@smithy/util-defaults-mode-browser":"^4.3.2","@smithy/util-defaults-mode-node":"^4.2.3","@smithy/util-endpoints":"^3.2.2","@smithy/util-middleware":"^4.2.2","@smithy/util-retry":"^4.2.2","@smithy/util-utf8":"^4.2.0","tslib":"^2.6.2"},"devDependencies":{"concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~5.8.3"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["./sso-oidc.d.ts","./sso-oidc.js","./sts.d.ts","./sts.js","dist-*/**"],"browser":{"./dist-es/submodules/sso-oidc/runtimeConfig":"./dist-es/submodules/sso-oidc/runtimeConfig.browser","./dist-es/submodules/sts/runtimeConfig":"./dist-es/submodules/sts/runtimeConfig.browser"},"react-native":{},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"packages/nested-clients"},"exports":{"./sso-oidc":{"types":"./dist-types/submodules/sso-oidc/index.d.ts","module":"./dist-es/submodules/sso-oidc/index.js","node":"./dist-cjs/submodules/sso-oidc/index.js","import":"./dist-es/submodules/sso-oidc/index.js","require":"./dist-cjs/submodules/sso-oidc/index.js"},"./sts":{"types":"./dist-types/submodules/sts/index.d.ts","module":"./dist-es/submodules/sts/index.js","node":"./dist-cjs/submodules/sts/index.js","import":"./dist-es/submodules/sts/index.js","require":"./dist-cjs/submodules/sts/index.js"}}}');
|
|
|
|
/***/ })
|
|
|
|
};
|
|
; |