Backend half
This commit is contained in:
Generated
Vendored
+56
@@ -0,0 +1,56 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.resolveHttpAuthSchemeConfig = exports.defaultSSOOIDCHttpAuthSchemeProvider = exports.defaultSSOOIDCHttpAuthSchemeParametersProvider = void 0;
|
||||
const core_1 = require("@aws-sdk/core");
|
||||
const util_middleware_1 = require("@smithy/util-middleware");
|
||||
const defaultSSOOIDCHttpAuthSchemeParametersProvider = 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.defaultSSOOIDCHttpAuthSchemeParametersProvider = defaultSSOOIDCHttpAuthSchemeParametersProvider;
|
||||
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
||||
return {
|
||||
schemeId: "aws.auth#sigv4",
|
||||
signingProperties: {
|
||||
name: "sso-oauth",
|
||||
region: authParameters.region,
|
||||
},
|
||||
propertiesExtractor: (config, context) => ({
|
||||
signingProperties: {
|
||||
config,
|
||||
context,
|
||||
},
|
||||
}),
|
||||
};
|
||||
}
|
||||
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
|
||||
return {
|
||||
schemeId: "smithy.api#noAuth",
|
||||
};
|
||||
}
|
||||
const defaultSSOOIDCHttpAuthSchemeProvider = (authParameters) => {
|
||||
const options = [];
|
||||
switch (authParameters.operation) {
|
||||
case "CreateToken": {
|
||||
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
||||
}
|
||||
}
|
||||
return options;
|
||||
};
|
||||
exports.defaultSSOOIDCHttpAuthSchemeProvider = defaultSSOOIDCHttpAuthSchemeProvider;
|
||||
const resolveHttpAuthSchemeConfig = (config) => {
|
||||
const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);
|
||||
return Object.assign(config_0, {
|
||||
authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),
|
||||
});
|
||||
};
|
||||
exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
|
||||
Generated
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.defaultEndpointResolver = void 0;
|
||||
const util_endpoints_1 = require("@aws-sdk/util-endpoints");
|
||||
const util_endpoints_2 = require("@smithy/util-endpoints");
|
||||
const ruleset_1 = require("./ruleset");
|
||||
const cache = new util_endpoints_2.EndpointCache({
|
||||
size: 50,
|
||||
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
|
||||
});
|
||||
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;
|
||||
Generated
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ruleSet = void 0;
|
||||
const u = "required", v = "fn", w = "argv", x = "ref";
|
||||
const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = "getAttr", i = { [u]: false, "type": "String" }, j = { [u]: true, "default": false, "type": "Boolean" }, k = { [x]: "Endpoint" }, l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] }, m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] }, n = {}, o = { [v]: h, [w]: [{ [x]: g }, "supportsFIPS"] }, p = { [x]: g }, q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, "supportsDualStack"] }] }, r = [l], s = [m], t = [{ [x]: "Region" }];
|
||||
const _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: r, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: s, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, o] }, q], rules: [{ endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: r, rules: [{ conditions: [{ [v]: c, [w]: [o, a] }], rules: [{ conditions: [{ [v]: "stringEquals", [w]: [{ [v]: h, [w]: [p, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://oidc.{Region}.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: "https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://oidc.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] };
|
||||
exports.ruleSet = _data;
|
||||
Generated
Vendored
+872
@@ -0,0 +1,872 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/submodules/sso-oidc/index.ts
|
||||
var index_exports = {};
|
||||
__export(index_exports, {
|
||||
$Command: () => import_smithy_client6.Command,
|
||||
AccessDeniedException: () => AccessDeniedException,
|
||||
AuthorizationPendingException: () => AuthorizationPendingException,
|
||||
CreateTokenCommand: () => CreateTokenCommand,
|
||||
CreateTokenRequestFilterSensitiveLog: () => CreateTokenRequestFilterSensitiveLog,
|
||||
CreateTokenResponseFilterSensitiveLog: () => CreateTokenResponseFilterSensitiveLog,
|
||||
ExpiredTokenException: () => ExpiredTokenException,
|
||||
InternalServerException: () => InternalServerException,
|
||||
InvalidClientException: () => InvalidClientException,
|
||||
InvalidGrantException: () => InvalidGrantException,
|
||||
InvalidRequestException: () => InvalidRequestException,
|
||||
InvalidScopeException: () => InvalidScopeException,
|
||||
SSOOIDC: () => SSOOIDC,
|
||||
SSOOIDCClient: () => SSOOIDCClient,
|
||||
SSOOIDCServiceException: () => SSOOIDCServiceException,
|
||||
SlowDownException: () => SlowDownException,
|
||||
UnauthorizedClientException: () => UnauthorizedClientException,
|
||||
UnsupportedGrantTypeException: () => UnsupportedGrantTypeException,
|
||||
__Client: () => import_smithy_client2.Client
|
||||
});
|
||||
module.exports = __toCommonJS(index_exports);
|
||||
|
||||
// src/submodules/sso-oidc/SSOOIDCClient.ts
|
||||
var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
|
||||
var import_middleware_logger = require("@aws-sdk/middleware-logger");
|
||||
var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
|
||||
var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
|
||||
var import_config_resolver = require("@smithy/config-resolver");
|
||||
var import_core = require("@smithy/core");
|
||||
var import_middleware_content_length = require("@smithy/middleware-content-length");
|
||||
var import_middleware_endpoint = require("@smithy/middleware-endpoint");
|
||||
var import_middleware_retry = require("@smithy/middleware-retry");
|
||||
var import_smithy_client2 = require("@smithy/smithy-client");
|
||||
var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
|
||||
|
||||
// src/submodules/sso-oidc/endpoint/EndpointParameters.ts
|
||||
var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
|
||||
return Object.assign(options, {
|
||||
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
||||
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
||||
defaultSigningName: "sso-oauth"
|
||||
});
|
||||
}, "resolveClientEndpointParameters");
|
||||
var commonParams = {
|
||||
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
||||
Endpoint: { type: "builtInParams", name: "endpoint" },
|
||||
Region: { type: "builtInParams", name: "region" },
|
||||
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
|
||||
};
|
||||
|
||||
// src/submodules/sso-oidc/SSOOIDCClient.ts
|
||||
var import_runtimeConfig = require("./runtimeConfig");
|
||||
|
||||
// src/submodules/sso-oidc/runtimeExtensions.ts
|
||||
var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
|
||||
var import_protocol_http = require("@smithy/protocol-http");
|
||||
var import_smithy_client = require("@smithy/smithy-client");
|
||||
|
||||
// src/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.ts
|
||||
var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((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;
|
||||
}
|
||||
};
|
||||
}, "getHttpAuthExtensionConfiguration");
|
||||
var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
|
||||
return {
|
||||
httpAuthSchemes: config.httpAuthSchemes(),
|
||||
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
||||
credentials: config.credentials()
|
||||
};
|
||||
}, "resolveHttpAuthRuntimeConfig");
|
||||
|
||||
// src/submodules/sso-oidc/runtimeExtensions.ts
|
||||
var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
|
||||
const extensionConfiguration = Object.assign(
|
||||
(0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig),
|
||||
(0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig),
|
||||
(0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig),
|
||||
getHttpAuthExtensionConfiguration(runtimeConfig)
|
||||
);
|
||||
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
||||
return Object.assign(
|
||||
runtimeConfig,
|
||||
(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
|
||||
(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
|
||||
(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
|
||||
resolveHttpAuthRuntimeConfig(extensionConfiguration)
|
||||
);
|
||||
}, "resolveRuntimeExtensions");
|
||||
|
||||
// src/submodules/sso-oidc/SSOOIDCClient.ts
|
||||
var SSOOIDCClient = class extends import_smithy_client2.Client {
|
||||
static {
|
||||
__name(this, "SSOOIDCClient");
|
||||
}
|
||||
/**
|
||||
* The resolved configuration of SSOOIDCClient class. This is resolved and normalized from the {@link SSOOIDCClientConfig | constructor configuration interface}.
|
||||
*/
|
||||
config;
|
||||
constructor(...[configuration]) {
|
||||
const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
|
||||
super(_config_0);
|
||||
this.initConfig = _config_0;
|
||||
const _config_1 = resolveClientEndpointParameters(_config_0);
|
||||
const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1);
|
||||
const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2);
|
||||
const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);
|
||||
const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
|
||||
const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
|
||||
const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
|
||||
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
|
||||
this.config = _config_8;
|
||||
this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
|
||||
this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
|
||||
this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
|
||||
this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
|
||||
this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
|
||||
this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
|
||||
this.middlewareStack.use(
|
||||
(0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
|
||||
httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultSSOOIDCHttpAuthSchemeParametersProvider,
|
||||
identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new import_core.DefaultIdentityProviderConfig({
|
||||
"aws.auth#sigv4": config.credentials
|
||||
}), "identityProviderConfigProvider")
|
||||
})
|
||||
);
|
||||
this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
|
||||
}
|
||||
/**
|
||||
* Destroy underlying resources, like sockets. It's usually not necessary to do this.
|
||||
* However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
|
||||
* Otherwise, sockets might stay open for quite a long time before the server terminates them.
|
||||
*/
|
||||
destroy() {
|
||||
super.destroy();
|
||||
}
|
||||
};
|
||||
|
||||
// src/submodules/sso-oidc/SSOOIDC.ts
|
||||
var import_smithy_client7 = require("@smithy/smithy-client");
|
||||
|
||||
// src/submodules/sso-oidc/commands/CreateTokenCommand.ts
|
||||
var import_middleware_endpoint2 = require("@smithy/middleware-endpoint");
|
||||
var import_middleware_serde = require("@smithy/middleware-serde");
|
||||
var import_smithy_client6 = require("@smithy/smithy-client");
|
||||
|
||||
// src/submodules/sso-oidc/models/models_0.ts
|
||||
var import_smithy_client4 = require("@smithy/smithy-client");
|
||||
|
||||
// src/submodules/sso-oidc/models/SSOOIDCServiceException.ts
|
||||
var import_smithy_client3 = require("@smithy/smithy-client");
|
||||
var SSOOIDCServiceException = class _SSOOIDCServiceException extends import_smithy_client3.ServiceException {
|
||||
static {
|
||||
__name(this, "SSOOIDCServiceException");
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(options) {
|
||||
super(options);
|
||||
Object.setPrototypeOf(this, _SSOOIDCServiceException.prototype);
|
||||
}
|
||||
};
|
||||
|
||||
// src/submodules/sso-oidc/models/models_0.ts
|
||||
var AccessDeniedException = class _AccessDeniedException extends SSOOIDCServiceException {
|
||||
static {
|
||||
__name(this, "AccessDeniedException");
|
||||
}
|
||||
name = "AccessDeniedException";
|
||||
$fault = "client";
|
||||
/**
|
||||
* <p>Single error code. For this exception the value will be <code>access_denied</code>.</p>
|
||||
* @public
|
||||
*/
|
||||
error;
|
||||
/**
|
||||
* <p>Human-readable text providing additional information, used to assist the client developer
|
||||
* in understanding the error that occurred.</p>
|
||||
* @public
|
||||
*/
|
||||
error_description;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "AccessDeniedException",
|
||||
$fault: "client",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _AccessDeniedException.prototype);
|
||||
this.error = opts.error;
|
||||
this.error_description = opts.error_description;
|
||||
}
|
||||
};
|
||||
var AuthorizationPendingException = class _AuthorizationPendingException extends SSOOIDCServiceException {
|
||||
static {
|
||||
__name(this, "AuthorizationPendingException");
|
||||
}
|
||||
name = "AuthorizationPendingException";
|
||||
$fault = "client";
|
||||
/**
|
||||
* <p>Single error code. For this exception the value will be
|
||||
* <code>authorization_pending</code>.</p>
|
||||
* @public
|
||||
*/
|
||||
error;
|
||||
/**
|
||||
* <p>Human-readable text providing additional information, used to assist the client developer
|
||||
* in understanding the error that occurred.</p>
|
||||
* @public
|
||||
*/
|
||||
error_description;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "AuthorizationPendingException",
|
||||
$fault: "client",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _AuthorizationPendingException.prototype);
|
||||
this.error = opts.error;
|
||||
this.error_description = opts.error_description;
|
||||
}
|
||||
};
|
||||
var CreateTokenRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
||||
...obj,
|
||||
...obj.clientSecret && { clientSecret: import_smithy_client4.SENSITIVE_STRING },
|
||||
...obj.refreshToken && { refreshToken: import_smithy_client4.SENSITIVE_STRING },
|
||||
...obj.codeVerifier && { codeVerifier: import_smithy_client4.SENSITIVE_STRING }
|
||||
}), "CreateTokenRequestFilterSensitiveLog");
|
||||
var CreateTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
||||
...obj,
|
||||
...obj.accessToken && { accessToken: import_smithy_client4.SENSITIVE_STRING },
|
||||
...obj.refreshToken && { refreshToken: import_smithy_client4.SENSITIVE_STRING },
|
||||
...obj.idToken && { idToken: import_smithy_client4.SENSITIVE_STRING }
|
||||
}), "CreateTokenResponseFilterSensitiveLog");
|
||||
var ExpiredTokenException = class _ExpiredTokenException extends SSOOIDCServiceException {
|
||||
static {
|
||||
__name(this, "ExpiredTokenException");
|
||||
}
|
||||
name = "ExpiredTokenException";
|
||||
$fault = "client";
|
||||
/**
|
||||
* <p>Single error code. For this exception the value will be <code>expired_token</code>.</p>
|
||||
* @public
|
||||
*/
|
||||
error;
|
||||
/**
|
||||
* <p>Human-readable text providing additional information, used to assist the client developer
|
||||
* in understanding the error that occurred.</p>
|
||||
* @public
|
||||
*/
|
||||
error_description;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "ExpiredTokenException",
|
||||
$fault: "client",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _ExpiredTokenException.prototype);
|
||||
this.error = opts.error;
|
||||
this.error_description = opts.error_description;
|
||||
}
|
||||
};
|
||||
var InternalServerException = class _InternalServerException extends SSOOIDCServiceException {
|
||||
static {
|
||||
__name(this, "InternalServerException");
|
||||
}
|
||||
name = "InternalServerException";
|
||||
$fault = "server";
|
||||
/**
|
||||
* <p>Single error code. For this exception the value will be <code>server_error</code>.</p>
|
||||
* @public
|
||||
*/
|
||||
error;
|
||||
/**
|
||||
* <p>Human-readable text providing additional information, used to assist the client developer
|
||||
* in understanding the error that occurred.</p>
|
||||
* @public
|
||||
*/
|
||||
error_description;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "InternalServerException",
|
||||
$fault: "server",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _InternalServerException.prototype);
|
||||
this.error = opts.error;
|
||||
this.error_description = opts.error_description;
|
||||
}
|
||||
};
|
||||
var InvalidClientException = class _InvalidClientException extends SSOOIDCServiceException {
|
||||
static {
|
||||
__name(this, "InvalidClientException");
|
||||
}
|
||||
name = "InvalidClientException";
|
||||
$fault = "client";
|
||||
/**
|
||||
* <p>Single error code. For this exception the value will be
|
||||
* <code>invalid_client</code>.</p>
|
||||
* @public
|
||||
*/
|
||||
error;
|
||||
/**
|
||||
* <p>Human-readable text providing additional information, used to assist the client developer
|
||||
* in understanding the error that occurred.</p>
|
||||
* @public
|
||||
*/
|
||||
error_description;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "InvalidClientException",
|
||||
$fault: "client",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _InvalidClientException.prototype);
|
||||
this.error = opts.error;
|
||||
this.error_description = opts.error_description;
|
||||
}
|
||||
};
|
||||
var InvalidGrantException = class _InvalidGrantException extends SSOOIDCServiceException {
|
||||
static {
|
||||
__name(this, "InvalidGrantException");
|
||||
}
|
||||
name = "InvalidGrantException";
|
||||
$fault = "client";
|
||||
/**
|
||||
* <p>Single error code. For this exception the value will be <code>invalid_grant</code>.</p>
|
||||
* @public
|
||||
*/
|
||||
error;
|
||||
/**
|
||||
* <p>Human-readable text providing additional information, used to assist the client developer
|
||||
* in understanding the error that occurred.</p>
|
||||
* @public
|
||||
*/
|
||||
error_description;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "InvalidGrantException",
|
||||
$fault: "client",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _InvalidGrantException.prototype);
|
||||
this.error = opts.error;
|
||||
this.error_description = opts.error_description;
|
||||
}
|
||||
};
|
||||
var InvalidRequestException = class _InvalidRequestException extends SSOOIDCServiceException {
|
||||
static {
|
||||
__name(this, "InvalidRequestException");
|
||||
}
|
||||
name = "InvalidRequestException";
|
||||
$fault = "client";
|
||||
/**
|
||||
* <p>Single error code. For this exception the value will be
|
||||
* <code>invalid_request</code>.</p>
|
||||
* @public
|
||||
*/
|
||||
error;
|
||||
/**
|
||||
* <p>Human-readable text providing additional information, used to assist the client developer
|
||||
* in understanding the error that occurred.</p>
|
||||
* @public
|
||||
*/
|
||||
error_description;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "InvalidRequestException",
|
||||
$fault: "client",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _InvalidRequestException.prototype);
|
||||
this.error = opts.error;
|
||||
this.error_description = opts.error_description;
|
||||
}
|
||||
};
|
||||
var InvalidScopeException = class _InvalidScopeException extends SSOOIDCServiceException {
|
||||
static {
|
||||
__name(this, "InvalidScopeException");
|
||||
}
|
||||
name = "InvalidScopeException";
|
||||
$fault = "client";
|
||||
/**
|
||||
* <p>Single error code. For this exception the value will be <code>invalid_scope</code>.</p>
|
||||
* @public
|
||||
*/
|
||||
error;
|
||||
/**
|
||||
* <p>Human-readable text providing additional information, used to assist the client developer
|
||||
* in understanding the error that occurred.</p>
|
||||
* @public
|
||||
*/
|
||||
error_description;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "InvalidScopeException",
|
||||
$fault: "client",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _InvalidScopeException.prototype);
|
||||
this.error = opts.error;
|
||||
this.error_description = opts.error_description;
|
||||
}
|
||||
};
|
||||
var SlowDownException = class _SlowDownException extends SSOOIDCServiceException {
|
||||
static {
|
||||
__name(this, "SlowDownException");
|
||||
}
|
||||
name = "SlowDownException";
|
||||
$fault = "client";
|
||||
/**
|
||||
* <p>Single error code. For this exception the value will be <code>slow_down</code>.</p>
|
||||
* @public
|
||||
*/
|
||||
error;
|
||||
/**
|
||||
* <p>Human-readable text providing additional information, used to assist the client developer
|
||||
* in understanding the error that occurred.</p>
|
||||
* @public
|
||||
*/
|
||||
error_description;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "SlowDownException",
|
||||
$fault: "client",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _SlowDownException.prototype);
|
||||
this.error = opts.error;
|
||||
this.error_description = opts.error_description;
|
||||
}
|
||||
};
|
||||
var UnauthorizedClientException = class _UnauthorizedClientException extends SSOOIDCServiceException {
|
||||
static {
|
||||
__name(this, "UnauthorizedClientException");
|
||||
}
|
||||
name = "UnauthorizedClientException";
|
||||
$fault = "client";
|
||||
/**
|
||||
* <p>Single error code. For this exception the value will be
|
||||
* <code>unauthorized_client</code>.</p>
|
||||
* @public
|
||||
*/
|
||||
error;
|
||||
/**
|
||||
* <p>Human-readable text providing additional information, used to assist the client developer
|
||||
* in understanding the error that occurred.</p>
|
||||
* @public
|
||||
*/
|
||||
error_description;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "UnauthorizedClientException",
|
||||
$fault: "client",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _UnauthorizedClientException.prototype);
|
||||
this.error = opts.error;
|
||||
this.error_description = opts.error_description;
|
||||
}
|
||||
};
|
||||
var UnsupportedGrantTypeException = class _UnsupportedGrantTypeException extends SSOOIDCServiceException {
|
||||
static {
|
||||
__name(this, "UnsupportedGrantTypeException");
|
||||
}
|
||||
name = "UnsupportedGrantTypeException";
|
||||
$fault = "client";
|
||||
/**
|
||||
* <p>Single error code. For this exception the value will be
|
||||
* <code>unsupported_grant_type</code>.</p>
|
||||
* @public
|
||||
*/
|
||||
error;
|
||||
/**
|
||||
* <p>Human-readable text providing additional information, used to assist the client developer
|
||||
* in understanding the error that occurred.</p>
|
||||
* @public
|
||||
*/
|
||||
error_description;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "UnsupportedGrantTypeException",
|
||||
$fault: "client",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _UnsupportedGrantTypeException.prototype);
|
||||
this.error = opts.error;
|
||||
this.error_description = opts.error_description;
|
||||
}
|
||||
};
|
||||
|
||||
// src/submodules/sso-oidc/protocols/Aws_restJson1.ts
|
||||
var import_core2 = require("@aws-sdk/core");
|
||||
var import_core3 = require("@smithy/core");
|
||||
var import_smithy_client5 = require("@smithy/smithy-client");
|
||||
var se_CreateTokenCommand = /* @__PURE__ */ __name(async (input, context) => {
|
||||
const b = (0, import_core3.requestBuilder)(input, context);
|
||||
const headers = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
b.bp("/token");
|
||||
let body;
|
||||
body = JSON.stringify(
|
||||
(0, import_smithy_client5.take)(input, {
|
||||
clientId: [],
|
||||
clientSecret: [],
|
||||
code: [],
|
||||
codeVerifier: [],
|
||||
deviceCode: [],
|
||||
grantType: [],
|
||||
redirectUri: [],
|
||||
refreshToken: [],
|
||||
scope: /* @__PURE__ */ __name((_) => (0, import_smithy_client5._json)(_), "scope")
|
||||
})
|
||||
);
|
||||
b.m("POST").h(headers).b(body);
|
||||
return b.build();
|
||||
}, "se_CreateTokenCommand");
|
||||
var de_CreateTokenCommand = /* @__PURE__ */ __name(async (output, context) => {
|
||||
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
||||
return de_CommandError(output, context);
|
||||
}
|
||||
const contents = (0, import_smithy_client5.map)({
|
||||
$metadata: deserializeMetadata(output)
|
||||
});
|
||||
const data = (0, import_smithy_client5.expectNonNull)((0, import_smithy_client5.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
||||
const doc = (0, import_smithy_client5.take)(data, {
|
||||
accessToken: import_smithy_client5.expectString,
|
||||
expiresIn: import_smithy_client5.expectInt32,
|
||||
idToken: import_smithy_client5.expectString,
|
||||
refreshToken: import_smithy_client5.expectString,
|
||||
tokenType: import_smithy_client5.expectString
|
||||
});
|
||||
Object.assign(contents, doc);
|
||||
return contents;
|
||||
}, "de_CreateTokenCommand");
|
||||
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
||||
const parsedOutput = {
|
||||
...output,
|
||||
body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
|
||||
};
|
||||
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
|
||||
switch (errorCode) {
|
||||
case "AccessDeniedException":
|
||||
case "com.amazonaws.ssooidc#AccessDeniedException":
|
||||
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
||||
case "AuthorizationPendingException":
|
||||
case "com.amazonaws.ssooidc#AuthorizationPendingException":
|
||||
throw await de_AuthorizationPendingExceptionRes(parsedOutput, context);
|
||||
case "ExpiredTokenException":
|
||||
case "com.amazonaws.ssooidc#ExpiredTokenException":
|
||||
throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
|
||||
case "InternalServerException":
|
||||
case "com.amazonaws.ssooidc#InternalServerException":
|
||||
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
||||
case "InvalidClientException":
|
||||
case "com.amazonaws.ssooidc#InvalidClientException":
|
||||
throw await de_InvalidClientExceptionRes(parsedOutput, context);
|
||||
case "InvalidGrantException":
|
||||
case "com.amazonaws.ssooidc#InvalidGrantException":
|
||||
throw await de_InvalidGrantExceptionRes(parsedOutput, context);
|
||||
case "InvalidRequestException":
|
||||
case "com.amazonaws.ssooidc#InvalidRequestException":
|
||||
throw await de_InvalidRequestExceptionRes(parsedOutput, context);
|
||||
case "InvalidScopeException":
|
||||
case "com.amazonaws.ssooidc#InvalidScopeException":
|
||||
throw await de_InvalidScopeExceptionRes(parsedOutput, context);
|
||||
case "SlowDownException":
|
||||
case "com.amazonaws.ssooidc#SlowDownException":
|
||||
throw await de_SlowDownExceptionRes(parsedOutput, context);
|
||||
case "UnauthorizedClientException":
|
||||
case "com.amazonaws.ssooidc#UnauthorizedClientException":
|
||||
throw await de_UnauthorizedClientExceptionRes(parsedOutput, context);
|
||||
case "UnsupportedGrantTypeException":
|
||||
case "com.amazonaws.ssooidc#UnsupportedGrantTypeException":
|
||||
throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context);
|
||||
default:
|
||||
const parsedBody = parsedOutput.body;
|
||||
return throwDefaultError({
|
||||
output,
|
||||
parsedBody,
|
||||
errorCode
|
||||
});
|
||||
}
|
||||
}, "de_CommandError");
|
||||
var throwDefaultError = (0, import_smithy_client5.withBaseException)(SSOOIDCServiceException);
|
||||
var de_AccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const contents = (0, import_smithy_client5.map)({});
|
||||
const data = parsedOutput.body;
|
||||
const doc = (0, import_smithy_client5.take)(data, {
|
||||
error: import_smithy_client5.expectString,
|
||||
error_description: import_smithy_client5.expectString
|
||||
});
|
||||
Object.assign(contents, doc);
|
||||
const exception = new AccessDeniedException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...contents
|
||||
});
|
||||
return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
|
||||
}, "de_AccessDeniedExceptionRes");
|
||||
var de_AuthorizationPendingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const contents = (0, import_smithy_client5.map)({});
|
||||
const data = parsedOutput.body;
|
||||
const doc = (0, import_smithy_client5.take)(data, {
|
||||
error: import_smithy_client5.expectString,
|
||||
error_description: import_smithy_client5.expectString
|
||||
});
|
||||
Object.assign(contents, doc);
|
||||
const exception = new AuthorizationPendingException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...contents
|
||||
});
|
||||
return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
|
||||
}, "de_AuthorizationPendingExceptionRes");
|
||||
var de_ExpiredTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const contents = (0, import_smithy_client5.map)({});
|
||||
const data = parsedOutput.body;
|
||||
const doc = (0, import_smithy_client5.take)(data, {
|
||||
error: import_smithy_client5.expectString,
|
||||
error_description: import_smithy_client5.expectString
|
||||
});
|
||||
Object.assign(contents, doc);
|
||||
const exception = new ExpiredTokenException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...contents
|
||||
});
|
||||
return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
|
||||
}, "de_ExpiredTokenExceptionRes");
|
||||
var de_InternalServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const contents = (0, import_smithy_client5.map)({});
|
||||
const data = parsedOutput.body;
|
||||
const doc = (0, import_smithy_client5.take)(data, {
|
||||
error: import_smithy_client5.expectString,
|
||||
error_description: import_smithy_client5.expectString
|
||||
});
|
||||
Object.assign(contents, doc);
|
||||
const exception = new InternalServerException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...contents
|
||||
});
|
||||
return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
|
||||
}, "de_InternalServerExceptionRes");
|
||||
var de_InvalidClientExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const contents = (0, import_smithy_client5.map)({});
|
||||
const data = parsedOutput.body;
|
||||
const doc = (0, import_smithy_client5.take)(data, {
|
||||
error: import_smithy_client5.expectString,
|
||||
error_description: import_smithy_client5.expectString
|
||||
});
|
||||
Object.assign(contents, doc);
|
||||
const exception = new InvalidClientException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...contents
|
||||
});
|
||||
return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
|
||||
}, "de_InvalidClientExceptionRes");
|
||||
var de_InvalidGrantExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const contents = (0, import_smithy_client5.map)({});
|
||||
const data = parsedOutput.body;
|
||||
const doc = (0, import_smithy_client5.take)(data, {
|
||||
error: import_smithy_client5.expectString,
|
||||
error_description: import_smithy_client5.expectString
|
||||
});
|
||||
Object.assign(contents, doc);
|
||||
const exception = new InvalidGrantException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...contents
|
||||
});
|
||||
return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
|
||||
}, "de_InvalidGrantExceptionRes");
|
||||
var de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const contents = (0, import_smithy_client5.map)({});
|
||||
const data = parsedOutput.body;
|
||||
const doc = (0, import_smithy_client5.take)(data, {
|
||||
error: import_smithy_client5.expectString,
|
||||
error_description: import_smithy_client5.expectString
|
||||
});
|
||||
Object.assign(contents, doc);
|
||||
const exception = new InvalidRequestException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...contents
|
||||
});
|
||||
return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
|
||||
}, "de_InvalidRequestExceptionRes");
|
||||
var de_InvalidScopeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const contents = (0, import_smithy_client5.map)({});
|
||||
const data = parsedOutput.body;
|
||||
const doc = (0, import_smithy_client5.take)(data, {
|
||||
error: import_smithy_client5.expectString,
|
||||
error_description: import_smithy_client5.expectString
|
||||
});
|
||||
Object.assign(contents, doc);
|
||||
const exception = new InvalidScopeException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...contents
|
||||
});
|
||||
return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
|
||||
}, "de_InvalidScopeExceptionRes");
|
||||
var de_SlowDownExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const contents = (0, import_smithy_client5.map)({});
|
||||
const data = parsedOutput.body;
|
||||
const doc = (0, import_smithy_client5.take)(data, {
|
||||
error: import_smithy_client5.expectString,
|
||||
error_description: import_smithy_client5.expectString
|
||||
});
|
||||
Object.assign(contents, doc);
|
||||
const exception = new SlowDownException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...contents
|
||||
});
|
||||
return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
|
||||
}, "de_SlowDownExceptionRes");
|
||||
var de_UnauthorizedClientExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const contents = (0, import_smithy_client5.map)({});
|
||||
const data = parsedOutput.body;
|
||||
const doc = (0, import_smithy_client5.take)(data, {
|
||||
error: import_smithy_client5.expectString,
|
||||
error_description: import_smithy_client5.expectString
|
||||
});
|
||||
Object.assign(contents, doc);
|
||||
const exception = new UnauthorizedClientException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...contents
|
||||
});
|
||||
return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
|
||||
}, "de_UnauthorizedClientExceptionRes");
|
||||
var de_UnsupportedGrantTypeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const contents = (0, import_smithy_client5.map)({});
|
||||
const data = parsedOutput.body;
|
||||
const doc = (0, import_smithy_client5.take)(data, {
|
||||
error: import_smithy_client5.expectString,
|
||||
error_description: import_smithy_client5.expectString
|
||||
});
|
||||
Object.assign(contents, doc);
|
||||
const exception = new UnsupportedGrantTypeException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...contents
|
||||
});
|
||||
return (0, import_smithy_client5.decorateServiceException)(exception, parsedOutput.body);
|
||||
}, "de_UnsupportedGrantTypeExceptionRes");
|
||||
var deserializeMetadata = /* @__PURE__ */ __name((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"]
|
||||
}), "deserializeMetadata");
|
||||
|
||||
// src/submodules/sso-oidc/commands/CreateTokenCommand.ts
|
||||
var CreateTokenCommand = class extends import_smithy_client6.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
|
||||
return [
|
||||
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
||||
(0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
||||
];
|
||||
}).s("AWSSSOOIDCService", "CreateToken", {}).n("SSOOIDCClient", "CreateTokenCommand").f(CreateTokenRequestFilterSensitiveLog, CreateTokenResponseFilterSensitiveLog).ser(se_CreateTokenCommand).de(de_CreateTokenCommand).build() {
|
||||
static {
|
||||
__name(this, "CreateTokenCommand");
|
||||
}
|
||||
};
|
||||
|
||||
// src/submodules/sso-oidc/SSOOIDC.ts
|
||||
var commands = {
|
||||
CreateTokenCommand
|
||||
};
|
||||
var SSOOIDC = class extends SSOOIDCClient {
|
||||
static {
|
||||
__name(this, "SSOOIDC");
|
||||
}
|
||||
};
|
||||
(0, import_smithy_client7.createAggregatedClient)(commands, SSOOIDC);
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
$Command,
|
||||
AccessDeniedException,
|
||||
AuthorizationPendingException,
|
||||
CreateTokenCommand,
|
||||
CreateTokenRequestFilterSensitiveLog,
|
||||
CreateTokenResponseFilterSensitiveLog,
|
||||
ExpiredTokenException,
|
||||
InternalServerException,
|
||||
InvalidClientException,
|
||||
InvalidGrantException,
|
||||
InvalidRequestException,
|
||||
InvalidScopeException,
|
||||
SSOOIDC,
|
||||
SSOOIDCClient,
|
||||
SSOOIDCServiceException,
|
||||
SlowDownException,
|
||||
UnauthorizedClientException,
|
||||
UnsupportedGrantTypeException,
|
||||
__Client
|
||||
});
|
||||
Generated
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getRuntimeConfig = void 0;
|
||||
const tslib_1 = require("tslib");
|
||||
const package_json_1 = tslib_1.__importDefault(require("../../../package.json"));
|
||||
const sha256_browser_1 = require("@aws-crypto/sha256-browser");
|
||||
const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser");
|
||||
const config_resolver_1 = require("@smithy/config-resolver");
|
||||
const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
|
||||
const invalid_dependency_1 = require("@smithy/invalid-dependency");
|
||||
const util_body_length_browser_1 = require("@smithy/util-body-length-browser");
|
||||
const util_retry_1 = require("@smithy/util-retry");
|
||||
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
||||
const smithy_client_1 = require("@smithy/smithy-client");
|
||||
const util_defaults_mode_browser_1 = require("@smithy/util-defaults-mode-browser");
|
||||
const getRuntimeConfig = (config) => {
|
||||
const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config);
|
||||
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
|
||||
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
|
||||
return {
|
||||
...clientSharedValues,
|
||||
...config,
|
||||
runtime: "browser",
|
||||
defaultsMode,
|
||||
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength,
|
||||
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
||||
(0, util_user_agent_browser_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
|
||||
maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS,
|
||||
region: config?.region ?? (0, invalid_dependency_1.invalidProvider)("Region is missing"),
|
||||
requestHandler: fetch_http_handler_1.FetchHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
||||
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE),
|
||||
sha256: config?.sha256 ?? sha256_browser_1.Sha256,
|
||||
streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector,
|
||||
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
||||
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_FIPS_ENDPOINT)),
|
||||
};
|
||||
};
|
||||
exports.getRuntimeConfig = getRuntimeConfig;
|
||||
Generated
Vendored
+54
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getRuntimeConfig = void 0;
|
||||
const tslib_1 = require("tslib");
|
||||
const package_json_1 = tslib_1.__importDefault(require("../../../package.json"));
|
||||
const core_1 = require("@aws-sdk/core");
|
||||
const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node");
|
||||
const config_resolver_1 = require("@smithy/config-resolver");
|
||||
const hash_node_1 = require("@smithy/hash-node");
|
||||
const middleware_retry_1 = require("@smithy/middleware-retry");
|
||||
const node_config_provider_1 = require("@smithy/node-config-provider");
|
||||
const node_http_handler_1 = require("@smithy/node-http-handler");
|
||||
const util_body_length_node_1 = require("@smithy/util-body-length-node");
|
||||
const util_retry_1 = require("@smithy/util-retry");
|
||||
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
||||
const smithy_client_1 = require("@smithy/smithy-client");
|
||||
const util_defaults_mode_node_1 = require("@smithy/util-defaults-mode-node");
|
||||
const smithy_client_2 = require("@smithy/smithy-client");
|
||||
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 }),
|
||||
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;
|
||||
Generated
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getRuntimeConfig = void 0;
|
||||
const sha256_js_1 = require("@aws-crypto/sha256-js");
|
||||
const runtimeConfig_browser_1 = require("./runtimeConfig.browser");
|
||||
const getRuntimeConfig = (config) => {
|
||||
const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config);
|
||||
return {
|
||||
...browserDefaults,
|
||||
...config,
|
||||
runtime: "react-native",
|
||||
sha256: config?.sha256 ?? sha256_js_1.Sha256,
|
||||
};
|
||||
};
|
||||
exports.getRuntimeConfig = getRuntimeConfig;
|
||||
Generated
Vendored
+40
@@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getRuntimeConfig = void 0;
|
||||
const core_1 = require("@aws-sdk/core");
|
||||
const core_2 = require("@smithy/core");
|
||||
const smithy_client_1 = require("@smithy/smithy-client");
|
||||
const url_parser_1 = require("@smithy/url-parser");
|
||||
const util_base64_1 = require("@smithy/util-base64");
|
||||
const util_utf8_1 = require("@smithy/util-utf8");
|
||||
const httpAuthSchemeProvider_1 = require("./auth/httpAuthSchemeProvider");
|
||||
const endpointResolver_1 = require("./endpoint/endpointResolver");
|
||||
const getRuntimeConfig = (config) => {
|
||||
return {
|
||||
apiVersion: "2019-06-10",
|
||||
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.defaultSSOOIDCHttpAuthSchemeProvider,
|
||||
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 ?? "SSO OIDC",
|
||||
urlParser: config?.urlParser ?? url_parser_1.parseUrl,
|
||||
utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
|
||||
utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
|
||||
};
|
||||
};
|
||||
exports.getRuntimeConfig = getRuntimeConfig;
|
||||
Generated
Vendored
+52
@@ -0,0 +1,52 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.STSClient = exports.__Client = void 0;
|
||||
const middleware_host_header_1 = require("@aws-sdk/middleware-host-header");
|
||||
const middleware_logger_1 = require("@aws-sdk/middleware-logger");
|
||||
const middleware_recursion_detection_1 = require("@aws-sdk/middleware-recursion-detection");
|
||||
const middleware_user_agent_1 = require("@aws-sdk/middleware-user-agent");
|
||||
const config_resolver_1 = require("@smithy/config-resolver");
|
||||
const core_1 = require("@smithy/core");
|
||||
const middleware_content_length_1 = require("@smithy/middleware-content-length");
|
||||
const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
|
||||
const middleware_retry_1 = require("@smithy/middleware-retry");
|
||||
const smithy_client_1 = require("@smithy/smithy-client");
|
||||
Object.defineProperty(exports, "__Client", { enumerable: true, get: function () { return smithy_client_1.Client; } });
|
||||
const httpAuthSchemeProvider_1 = require("./auth/httpAuthSchemeProvider");
|
||||
const EndpointParameters_1 = require("./endpoint/EndpointParameters");
|
||||
const runtimeConfig_1 = require("./runtimeConfig");
|
||||
const runtimeExtensions_1 = require("./runtimeExtensions");
|
||||
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;
|
||||
Generated
Vendored
+43
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
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;
|
||||
Generated
Vendored
+62
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.resolveHttpAuthSchemeConfig = exports.resolveStsAuthConfig = exports.defaultSTSHttpAuthSchemeProvider = exports.defaultSTSHttpAuthSchemeParametersProvider = void 0;
|
||||
const core_1 = require("@aws-sdk/core");
|
||||
const util_middleware_1 = require("@smithy/util-middleware");
|
||||
const STSClient_1 = require("../STSClient");
|
||||
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;
|
||||
Generated
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
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" },
|
||||
};
|
||||
Generated
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.defaultEndpointResolver = void 0;
|
||||
const util_endpoints_1 = require("@aws-sdk/util-endpoints");
|
||||
const util_endpoints_2 = require("@smithy/util-endpoints");
|
||||
const ruleset_1 = require("./ruleset");
|
||||
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;
|
||||
SerpentRace_Backend/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/ruleset.js
Generated
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
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;
|
||||
Generated
Vendored
+951
@@ -0,0 +1,951 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/submodules/sts/index.ts
|
||||
var index_exports = {};
|
||||
__export(index_exports, {
|
||||
AssumeRoleCommand: () => AssumeRoleCommand,
|
||||
AssumeRoleResponseFilterSensitiveLog: () => AssumeRoleResponseFilterSensitiveLog,
|
||||
AssumeRoleWithWebIdentityCommand: () => AssumeRoleWithWebIdentityCommand,
|
||||
AssumeRoleWithWebIdentityRequestFilterSensitiveLog: () => AssumeRoleWithWebIdentityRequestFilterSensitiveLog,
|
||||
AssumeRoleWithWebIdentityResponseFilterSensitiveLog: () => AssumeRoleWithWebIdentityResponseFilterSensitiveLog,
|
||||
ClientInputEndpointParameters: () => import_EndpointParameters3.ClientInputEndpointParameters,
|
||||
CredentialsFilterSensitiveLog: () => CredentialsFilterSensitiveLog,
|
||||
ExpiredTokenException: () => ExpiredTokenException,
|
||||
IDPCommunicationErrorException: () => IDPCommunicationErrorException,
|
||||
IDPRejectedClaimException: () => IDPRejectedClaimException,
|
||||
InvalidIdentityTokenException: () => InvalidIdentityTokenException,
|
||||
MalformedPolicyDocumentException: () => MalformedPolicyDocumentException,
|
||||
PackedPolicyTooLargeException: () => PackedPolicyTooLargeException,
|
||||
RegionDisabledException: () => RegionDisabledException,
|
||||
STS: () => STS,
|
||||
STSServiceException: () => STSServiceException,
|
||||
decorateDefaultCredentialProvider: () => decorateDefaultCredentialProvider,
|
||||
getDefaultRoleAssumer: () => getDefaultRoleAssumer2,
|
||||
getDefaultRoleAssumerWithWebIdentity: () => getDefaultRoleAssumerWithWebIdentity2
|
||||
});
|
||||
module.exports = __toCommonJS(index_exports);
|
||||
__reExport(index_exports, require("./STSClient"), module.exports);
|
||||
|
||||
// src/submodules/sts/STS.ts
|
||||
var import_smithy_client6 = require("@smithy/smithy-client");
|
||||
|
||||
// src/submodules/sts/commands/AssumeRoleCommand.ts
|
||||
var import_middleware_endpoint = require("@smithy/middleware-endpoint");
|
||||
var import_middleware_serde = require("@smithy/middleware-serde");
|
||||
var import_smithy_client4 = require("@smithy/smithy-client");
|
||||
var import_EndpointParameters = require("./endpoint/EndpointParameters");
|
||||
|
||||
// src/submodules/sts/models/models_0.ts
|
||||
var import_smithy_client2 = require("@smithy/smithy-client");
|
||||
|
||||
// src/submodules/sts/models/STSServiceException.ts
|
||||
var import_smithy_client = require("@smithy/smithy-client");
|
||||
var STSServiceException = class _STSServiceException extends import_smithy_client.ServiceException {
|
||||
static {
|
||||
__name(this, "STSServiceException");
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(options) {
|
||||
super(options);
|
||||
Object.setPrototypeOf(this, _STSServiceException.prototype);
|
||||
}
|
||||
};
|
||||
|
||||
// src/submodules/sts/models/models_0.ts
|
||||
var CredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
||||
...obj,
|
||||
...obj.SecretAccessKey && { SecretAccessKey: import_smithy_client2.SENSITIVE_STRING }
|
||||
}), "CredentialsFilterSensitiveLog");
|
||||
var AssumeRoleResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
||||
...obj,
|
||||
...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
|
||||
}), "AssumeRoleResponseFilterSensitiveLog");
|
||||
var ExpiredTokenException = class _ExpiredTokenException extends STSServiceException {
|
||||
static {
|
||||
__name(this, "ExpiredTokenException");
|
||||
}
|
||||
name = "ExpiredTokenException";
|
||||
$fault = "client";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "ExpiredTokenException",
|
||||
$fault: "client",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _ExpiredTokenException.prototype);
|
||||
}
|
||||
};
|
||||
var MalformedPolicyDocumentException = class _MalformedPolicyDocumentException extends STSServiceException {
|
||||
static {
|
||||
__name(this, "MalformedPolicyDocumentException");
|
||||
}
|
||||
name = "MalformedPolicyDocumentException";
|
||||
$fault = "client";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "MalformedPolicyDocumentException",
|
||||
$fault: "client",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _MalformedPolicyDocumentException.prototype);
|
||||
}
|
||||
};
|
||||
var PackedPolicyTooLargeException = class _PackedPolicyTooLargeException extends STSServiceException {
|
||||
static {
|
||||
__name(this, "PackedPolicyTooLargeException");
|
||||
}
|
||||
name = "PackedPolicyTooLargeException";
|
||||
$fault = "client";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "PackedPolicyTooLargeException",
|
||||
$fault: "client",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _PackedPolicyTooLargeException.prototype);
|
||||
}
|
||||
};
|
||||
var RegionDisabledException = class _RegionDisabledException extends STSServiceException {
|
||||
static {
|
||||
__name(this, "RegionDisabledException");
|
||||
}
|
||||
name = "RegionDisabledException";
|
||||
$fault = "client";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "RegionDisabledException",
|
||||
$fault: "client",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _RegionDisabledException.prototype);
|
||||
}
|
||||
};
|
||||
var IDPRejectedClaimException = class _IDPRejectedClaimException extends STSServiceException {
|
||||
static {
|
||||
__name(this, "IDPRejectedClaimException");
|
||||
}
|
||||
name = "IDPRejectedClaimException";
|
||||
$fault = "client";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "IDPRejectedClaimException",
|
||||
$fault: "client",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _IDPRejectedClaimException.prototype);
|
||||
}
|
||||
};
|
||||
var InvalidIdentityTokenException = class _InvalidIdentityTokenException extends STSServiceException {
|
||||
static {
|
||||
__name(this, "InvalidIdentityTokenException");
|
||||
}
|
||||
name = "InvalidIdentityTokenException";
|
||||
$fault = "client";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "InvalidIdentityTokenException",
|
||||
$fault: "client",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _InvalidIdentityTokenException.prototype);
|
||||
}
|
||||
};
|
||||
var AssumeRoleWithWebIdentityRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
||||
...obj,
|
||||
...obj.WebIdentityToken && { WebIdentityToken: import_smithy_client2.SENSITIVE_STRING }
|
||||
}), "AssumeRoleWithWebIdentityRequestFilterSensitiveLog");
|
||||
var AssumeRoleWithWebIdentityResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
||||
...obj,
|
||||
...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
|
||||
}), "AssumeRoleWithWebIdentityResponseFilterSensitiveLog");
|
||||
var IDPCommunicationErrorException = class _IDPCommunicationErrorException extends STSServiceException {
|
||||
static {
|
||||
__name(this, "IDPCommunicationErrorException");
|
||||
}
|
||||
name = "IDPCommunicationErrorException";
|
||||
$fault = "client";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
constructor(opts) {
|
||||
super({
|
||||
name: "IDPCommunicationErrorException",
|
||||
$fault: "client",
|
||||
...opts
|
||||
});
|
||||
Object.setPrototypeOf(this, _IDPCommunicationErrorException.prototype);
|
||||
}
|
||||
};
|
||||
|
||||
// src/submodules/sts/protocols/Aws_query.ts
|
||||
var import_core = require("@aws-sdk/core");
|
||||
var import_protocol_http = require("@smithy/protocol-http");
|
||||
var import_smithy_client3 = require("@smithy/smithy-client");
|
||||
var se_AssumeRoleCommand = /* @__PURE__ */ __name(async (input, context) => {
|
||||
const headers = SHARED_HEADERS;
|
||||
let body;
|
||||
body = buildFormUrlencodedString({
|
||||
...se_AssumeRoleRequest(input, context),
|
||||
[_A]: _AR,
|
||||
[_V]: _
|
||||
});
|
||||
return buildHttpRpcRequest(context, headers, "/", void 0, body);
|
||||
}, "se_AssumeRoleCommand");
|
||||
var se_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (input, context) => {
|
||||
const headers = SHARED_HEADERS;
|
||||
let body;
|
||||
body = buildFormUrlencodedString({
|
||||
...se_AssumeRoleWithWebIdentityRequest(input, context),
|
||||
[_A]: _ARWWI,
|
||||
[_V]: _
|
||||
});
|
||||
return buildHttpRpcRequest(context, headers, "/", void 0, body);
|
||||
}, "se_AssumeRoleWithWebIdentityCommand");
|
||||
var de_AssumeRoleCommand = /* @__PURE__ */ __name(async (output, context) => {
|
||||
if (output.statusCode >= 300) {
|
||||
return de_CommandError(output, context);
|
||||
}
|
||||
const data = await (0, import_core.parseXmlBody)(output.body, context);
|
||||
let contents = {};
|
||||
contents = de_AssumeRoleResponse(data.AssumeRoleResult, context);
|
||||
const response = {
|
||||
$metadata: deserializeMetadata(output),
|
||||
...contents
|
||||
};
|
||||
return response;
|
||||
}, "de_AssumeRoleCommand");
|
||||
var de_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (output, context) => {
|
||||
if (output.statusCode >= 300) {
|
||||
return de_CommandError(output, context);
|
||||
}
|
||||
const data = await (0, import_core.parseXmlBody)(output.body, context);
|
||||
let contents = {};
|
||||
contents = de_AssumeRoleWithWebIdentityResponse(data.AssumeRoleWithWebIdentityResult, context);
|
||||
const response = {
|
||||
$metadata: deserializeMetadata(output),
|
||||
...contents
|
||||
};
|
||||
return response;
|
||||
}, "de_AssumeRoleWithWebIdentityCommand");
|
||||
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
||||
const parsedOutput = {
|
||||
...output,
|
||||
body: await (0, import_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, context);
|
||||
case "MalformedPolicyDocument":
|
||||
case "com.amazonaws.sts#MalformedPolicyDocumentException":
|
||||
throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
|
||||
case "PackedPolicyTooLarge":
|
||||
case "com.amazonaws.sts#PackedPolicyTooLargeException":
|
||||
throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context);
|
||||
case "RegionDisabledException":
|
||||
case "com.amazonaws.sts#RegionDisabledException":
|
||||
throw await de_RegionDisabledExceptionRes(parsedOutput, context);
|
||||
case "IDPCommunicationError":
|
||||
case "com.amazonaws.sts#IDPCommunicationErrorException":
|
||||
throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context);
|
||||
case "IDPRejectedClaim":
|
||||
case "com.amazonaws.sts#IDPRejectedClaimException":
|
||||
throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context);
|
||||
case "InvalidIdentityToken":
|
||||
case "com.amazonaws.sts#InvalidIdentityTokenException":
|
||||
throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context);
|
||||
default:
|
||||
const parsedBody = parsedOutput.body;
|
||||
return throwDefaultError({
|
||||
output,
|
||||
parsedBody: parsedBody.Error,
|
||||
errorCode
|
||||
});
|
||||
}
|
||||
}, "de_CommandError");
|
||||
var de_ExpiredTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const body = parsedOutput.body;
|
||||
const deserialized = de_ExpiredTokenException(body.Error, context);
|
||||
const exception = new ExpiredTokenException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...deserialized
|
||||
});
|
||||
return (0, import_smithy_client3.decorateServiceException)(exception, body);
|
||||
}, "de_ExpiredTokenExceptionRes");
|
||||
var de_IDPCommunicationErrorExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const body = parsedOutput.body;
|
||||
const deserialized = de_IDPCommunicationErrorException(body.Error, context);
|
||||
const exception = new IDPCommunicationErrorException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...deserialized
|
||||
});
|
||||
return (0, import_smithy_client3.decorateServiceException)(exception, body);
|
||||
}, "de_IDPCommunicationErrorExceptionRes");
|
||||
var de_IDPRejectedClaimExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const body = parsedOutput.body;
|
||||
const deserialized = de_IDPRejectedClaimException(body.Error, context);
|
||||
const exception = new IDPRejectedClaimException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...deserialized
|
||||
});
|
||||
return (0, import_smithy_client3.decorateServiceException)(exception, body);
|
||||
}, "de_IDPRejectedClaimExceptionRes");
|
||||
var de_InvalidIdentityTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const body = parsedOutput.body;
|
||||
const deserialized = de_InvalidIdentityTokenException(body.Error, context);
|
||||
const exception = new InvalidIdentityTokenException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...deserialized
|
||||
});
|
||||
return (0, import_smithy_client3.decorateServiceException)(exception, body);
|
||||
}, "de_InvalidIdentityTokenExceptionRes");
|
||||
var de_MalformedPolicyDocumentExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const body = parsedOutput.body;
|
||||
const deserialized = de_MalformedPolicyDocumentException(body.Error, context);
|
||||
const exception = new MalformedPolicyDocumentException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...deserialized
|
||||
});
|
||||
return (0, import_smithy_client3.decorateServiceException)(exception, body);
|
||||
}, "de_MalformedPolicyDocumentExceptionRes");
|
||||
var de_PackedPolicyTooLargeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const body = parsedOutput.body;
|
||||
const deserialized = de_PackedPolicyTooLargeException(body.Error, context);
|
||||
const exception = new PackedPolicyTooLargeException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...deserialized
|
||||
});
|
||||
return (0, import_smithy_client3.decorateServiceException)(exception, body);
|
||||
}, "de_PackedPolicyTooLargeExceptionRes");
|
||||
var de_RegionDisabledExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
||||
const body = parsedOutput.body;
|
||||
const deserialized = de_RegionDisabledException(body.Error, context);
|
||||
const exception = new RegionDisabledException({
|
||||
$metadata: deserializeMetadata(parsedOutput),
|
||||
...deserialized
|
||||
});
|
||||
return (0, import_smithy_client3.decorateServiceException)(exception, body);
|
||||
}, "de_RegionDisabledExceptionRes");
|
||||
var se_AssumeRoleRequest = /* @__PURE__ */ __name((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], context);
|
||||
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], context);
|
||||
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], context);
|
||||
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], context);
|
||||
if (input[_PC]?.length === 0) {
|
||||
entries.ProvidedContexts = [];
|
||||
}
|
||||
Object.entries(memberEntries).forEach(([key, value]) => {
|
||||
const loc = `ProvidedContexts.${key}`;
|
||||
entries[loc] = value;
|
||||
});
|
||||
}
|
||||
return entries;
|
||||
}, "se_AssumeRoleRequest");
|
||||
var se_AssumeRoleWithWebIdentityRequest = /* @__PURE__ */ __name((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], context);
|
||||
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;
|
||||
}, "se_AssumeRoleWithWebIdentityRequest");
|
||||
var se_policyDescriptorListType = /* @__PURE__ */ __name((input, context) => {
|
||||
const entries = {};
|
||||
let counter = 1;
|
||||
for (const entry of input) {
|
||||
if (entry === null) {
|
||||
continue;
|
||||
}
|
||||
const memberEntries = se_PolicyDescriptorType(entry, context);
|
||||
Object.entries(memberEntries).forEach(([key, value]) => {
|
||||
entries[`member.${counter}.${key}`] = value;
|
||||
});
|
||||
counter++;
|
||||
}
|
||||
return entries;
|
||||
}, "se_policyDescriptorListType");
|
||||
var se_PolicyDescriptorType = /* @__PURE__ */ __name((input, context) => {
|
||||
const entries = {};
|
||||
if (input[_a] != null) {
|
||||
entries[_a] = input[_a];
|
||||
}
|
||||
return entries;
|
||||
}, "se_PolicyDescriptorType");
|
||||
var se_ProvidedContext = /* @__PURE__ */ __name((input, context) => {
|
||||
const entries = {};
|
||||
if (input[_PAr] != null) {
|
||||
entries[_PAr] = input[_PAr];
|
||||
}
|
||||
if (input[_CA] != null) {
|
||||
entries[_CA] = input[_CA];
|
||||
}
|
||||
return entries;
|
||||
}, "se_ProvidedContext");
|
||||
var se_ProvidedContextsListType = /* @__PURE__ */ __name((input, context) => {
|
||||
const entries = {};
|
||||
let counter = 1;
|
||||
for (const entry of input) {
|
||||
if (entry === null) {
|
||||
continue;
|
||||
}
|
||||
const memberEntries = se_ProvidedContext(entry, context);
|
||||
Object.entries(memberEntries).forEach(([key, value]) => {
|
||||
entries[`member.${counter}.${key}`] = value;
|
||||
});
|
||||
counter++;
|
||||
}
|
||||
return entries;
|
||||
}, "se_ProvidedContextsListType");
|
||||
var se_Tag = /* @__PURE__ */ __name((input, context) => {
|
||||
const entries = {};
|
||||
if (input[_K] != null) {
|
||||
entries[_K] = input[_K];
|
||||
}
|
||||
if (input[_Va] != null) {
|
||||
entries[_Va] = input[_Va];
|
||||
}
|
||||
return entries;
|
||||
}, "se_Tag");
|
||||
var se_tagKeyListType = /* @__PURE__ */ __name((input, context) => {
|
||||
const entries = {};
|
||||
let counter = 1;
|
||||
for (const entry of input) {
|
||||
if (entry === null) {
|
||||
continue;
|
||||
}
|
||||
entries[`member.${counter}`] = entry;
|
||||
counter++;
|
||||
}
|
||||
return entries;
|
||||
}, "se_tagKeyListType");
|
||||
var se_tagListType = /* @__PURE__ */ __name((input, context) => {
|
||||
const entries = {};
|
||||
let counter = 1;
|
||||
for (const entry of input) {
|
||||
if (entry === null) {
|
||||
continue;
|
||||
}
|
||||
const memberEntries = se_Tag(entry, context);
|
||||
Object.entries(memberEntries).forEach(([key, value]) => {
|
||||
entries[`member.${counter}.${key}`] = value;
|
||||
});
|
||||
counter++;
|
||||
}
|
||||
return entries;
|
||||
}, "se_tagListType");
|
||||
var de_AssumedRoleUser = /* @__PURE__ */ __name((output, context) => {
|
||||
const contents = {};
|
||||
if (output[_ARI] != null) {
|
||||
contents[_ARI] = (0, import_smithy_client3.expectString)(output[_ARI]);
|
||||
}
|
||||
if (output[_Ar] != null) {
|
||||
contents[_Ar] = (0, import_smithy_client3.expectString)(output[_Ar]);
|
||||
}
|
||||
return contents;
|
||||
}, "de_AssumedRoleUser");
|
||||
var de_AssumeRoleResponse = /* @__PURE__ */ __name((output, context) => {
|
||||
const contents = {};
|
||||
if (output[_C] != null) {
|
||||
contents[_C] = de_Credentials(output[_C], context);
|
||||
}
|
||||
if (output[_ARU] != null) {
|
||||
contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
|
||||
}
|
||||
if (output[_PPS] != null) {
|
||||
contents[_PPS] = (0, import_smithy_client3.strictParseInt32)(output[_PPS]);
|
||||
}
|
||||
if (output[_SI] != null) {
|
||||
contents[_SI] = (0, import_smithy_client3.expectString)(output[_SI]);
|
||||
}
|
||||
return contents;
|
||||
}, "de_AssumeRoleResponse");
|
||||
var de_AssumeRoleWithWebIdentityResponse = /* @__PURE__ */ __name((output, context) => {
|
||||
const contents = {};
|
||||
if (output[_C] != null) {
|
||||
contents[_C] = de_Credentials(output[_C], context);
|
||||
}
|
||||
if (output[_SFWIT] != null) {
|
||||
contents[_SFWIT] = (0, import_smithy_client3.expectString)(output[_SFWIT]);
|
||||
}
|
||||
if (output[_ARU] != null) {
|
||||
contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
|
||||
}
|
||||
if (output[_PPS] != null) {
|
||||
contents[_PPS] = (0, import_smithy_client3.strictParseInt32)(output[_PPS]);
|
||||
}
|
||||
if (output[_Pr] != null) {
|
||||
contents[_Pr] = (0, import_smithy_client3.expectString)(output[_Pr]);
|
||||
}
|
||||
if (output[_Au] != null) {
|
||||
contents[_Au] = (0, import_smithy_client3.expectString)(output[_Au]);
|
||||
}
|
||||
if (output[_SI] != null) {
|
||||
contents[_SI] = (0, import_smithy_client3.expectString)(output[_SI]);
|
||||
}
|
||||
return contents;
|
||||
}, "de_AssumeRoleWithWebIdentityResponse");
|
||||
var de_Credentials = /* @__PURE__ */ __name((output, context) => {
|
||||
const contents = {};
|
||||
if (output[_AKI] != null) {
|
||||
contents[_AKI] = (0, import_smithy_client3.expectString)(output[_AKI]);
|
||||
}
|
||||
if (output[_SAK] != null) {
|
||||
contents[_SAK] = (0, import_smithy_client3.expectString)(output[_SAK]);
|
||||
}
|
||||
if (output[_ST] != null) {
|
||||
contents[_ST] = (0, import_smithy_client3.expectString)(output[_ST]);
|
||||
}
|
||||
if (output[_E] != null) {
|
||||
contents[_E] = (0, import_smithy_client3.expectNonNull)((0, import_smithy_client3.parseRfc3339DateTimeWithOffset)(output[_E]));
|
||||
}
|
||||
return contents;
|
||||
}, "de_Credentials");
|
||||
var de_ExpiredTokenException = /* @__PURE__ */ __name((output, context) => {
|
||||
const contents = {};
|
||||
if (output[_m] != null) {
|
||||
contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
|
||||
}
|
||||
return contents;
|
||||
}, "de_ExpiredTokenException");
|
||||
var de_IDPCommunicationErrorException = /* @__PURE__ */ __name((output, context) => {
|
||||
const contents = {};
|
||||
if (output[_m] != null) {
|
||||
contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
|
||||
}
|
||||
return contents;
|
||||
}, "de_IDPCommunicationErrorException");
|
||||
var de_IDPRejectedClaimException = /* @__PURE__ */ __name((output, context) => {
|
||||
const contents = {};
|
||||
if (output[_m] != null) {
|
||||
contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
|
||||
}
|
||||
return contents;
|
||||
}, "de_IDPRejectedClaimException");
|
||||
var de_InvalidIdentityTokenException = /* @__PURE__ */ __name((output, context) => {
|
||||
const contents = {};
|
||||
if (output[_m] != null) {
|
||||
contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
|
||||
}
|
||||
return contents;
|
||||
}, "de_InvalidIdentityTokenException");
|
||||
var de_MalformedPolicyDocumentException = /* @__PURE__ */ __name((output, context) => {
|
||||
const contents = {};
|
||||
if (output[_m] != null) {
|
||||
contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
|
||||
}
|
||||
return contents;
|
||||
}, "de_MalformedPolicyDocumentException");
|
||||
var de_PackedPolicyTooLargeException = /* @__PURE__ */ __name((output, context) => {
|
||||
const contents = {};
|
||||
if (output[_m] != null) {
|
||||
contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
|
||||
}
|
||||
return contents;
|
||||
}, "de_PackedPolicyTooLargeException");
|
||||
var de_RegionDisabledException = /* @__PURE__ */ __name((output, context) => {
|
||||
const contents = {};
|
||||
if (output[_m] != null) {
|
||||
contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
|
||||
}
|
||||
return contents;
|
||||
}, "de_RegionDisabledException");
|
||||
var deserializeMetadata = /* @__PURE__ */ __name((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"]
|
||||
}), "deserializeMetadata");
|
||||
var throwDefaultError = (0, import_smithy_client3.withBaseException)(STSServiceException);
|
||||
var buildHttpRpcRequest = /* @__PURE__ */ __name(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 (resolvedHostname !== void 0) {
|
||||
contents.hostname = resolvedHostname;
|
||||
}
|
||||
if (body !== void 0) {
|
||||
contents.body = body;
|
||||
}
|
||||
return new import_protocol_http.HttpRequest(contents);
|
||||
}, "buildHttpRpcRequest");
|
||||
var SHARED_HEADERS = {
|
||||
"content-type": "application/x-www-form-urlencoded"
|
||||
};
|
||||
var _ = "2011-06-15";
|
||||
var _A = "Action";
|
||||
var _AKI = "AccessKeyId";
|
||||
var _AR = "AssumeRole";
|
||||
var _ARI = "AssumedRoleId";
|
||||
var _ARU = "AssumedRoleUser";
|
||||
var _ARWWI = "AssumeRoleWithWebIdentity";
|
||||
var _Ar = "Arn";
|
||||
var _Au = "Audience";
|
||||
var _C = "Credentials";
|
||||
var _CA = "ContextAssertion";
|
||||
var _DS = "DurationSeconds";
|
||||
var _E = "Expiration";
|
||||
var _EI = "ExternalId";
|
||||
var _K = "Key";
|
||||
var _P = "Policy";
|
||||
var _PA = "PolicyArns";
|
||||
var _PAr = "ProviderArn";
|
||||
var _PC = "ProvidedContexts";
|
||||
var _PI = "ProviderId";
|
||||
var _PPS = "PackedPolicySize";
|
||||
var _Pr = "Provider";
|
||||
var _RA = "RoleArn";
|
||||
var _RSN = "RoleSessionName";
|
||||
var _SAK = "SecretAccessKey";
|
||||
var _SFWIT = "SubjectFromWebIdentityToken";
|
||||
var _SI = "SourceIdentity";
|
||||
var _SN = "SerialNumber";
|
||||
var _ST = "SessionToken";
|
||||
var _T = "Tags";
|
||||
var _TC = "TokenCode";
|
||||
var _TTK = "TransitiveTagKeys";
|
||||
var _V = "Version";
|
||||
var _Va = "Value";
|
||||
var _WIT = "WebIdentityToken";
|
||||
var _a = "arn";
|
||||
var _m = "message";
|
||||
var buildFormUrlencodedString = /* @__PURE__ */ __name((formEntries) => Object.entries(formEntries).map(([key, value]) => (0, import_smithy_client3.extendedEncodeURIComponent)(key) + "=" + (0, import_smithy_client3.extendedEncodeURIComponent)(value)).join("&"), "buildFormUrlencodedString");
|
||||
var loadQueryErrorCode = /* @__PURE__ */ __name((output, data) => {
|
||||
if (data.Error?.Code !== void 0) {
|
||||
return data.Error.Code;
|
||||
}
|
||||
if (output.statusCode == 404) {
|
||||
return "NotFound";
|
||||
}
|
||||
}, "loadQueryErrorCode");
|
||||
|
||||
// src/submodules/sts/commands/AssumeRoleCommand.ts
|
||||
var AssumeRoleCommand = class extends import_smithy_client4.Command.classBuilder().ep(import_EndpointParameters.commonParams).m(function(Command, cs, config, o) {
|
||||
return [
|
||||
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
||||
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
||||
];
|
||||
}).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").f(void 0, AssumeRoleResponseFilterSensitiveLog).ser(se_AssumeRoleCommand).de(de_AssumeRoleCommand).build() {
|
||||
static {
|
||||
__name(this, "AssumeRoleCommand");
|
||||
}
|
||||
};
|
||||
|
||||
// src/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.ts
|
||||
var import_middleware_endpoint2 = require("@smithy/middleware-endpoint");
|
||||
var import_middleware_serde2 = require("@smithy/middleware-serde");
|
||||
var import_smithy_client5 = require("@smithy/smithy-client");
|
||||
var import_EndpointParameters2 = require("./endpoint/EndpointParameters");
|
||||
var AssumeRoleWithWebIdentityCommand = class extends import_smithy_client5.Command.classBuilder().ep(import_EndpointParameters2.commonParams).m(function(Command, cs, config, o) {
|
||||
return [
|
||||
(0, import_middleware_serde2.getSerdePlugin)(config, this.serialize, this.deserialize),
|
||||
(0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
||||
];
|
||||
}).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").f(AssumeRoleWithWebIdentityRequestFilterSensitiveLog, AssumeRoleWithWebIdentityResponseFilterSensitiveLog).ser(se_AssumeRoleWithWebIdentityCommand).de(de_AssumeRoleWithWebIdentityCommand).build() {
|
||||
static {
|
||||
__name(this, "AssumeRoleWithWebIdentityCommand");
|
||||
}
|
||||
};
|
||||
|
||||
// src/submodules/sts/STS.ts
|
||||
var import_STSClient = require("./STSClient");
|
||||
var commands = {
|
||||
AssumeRoleCommand,
|
||||
AssumeRoleWithWebIdentityCommand
|
||||
};
|
||||
var STS = class extends import_STSClient.STSClient {
|
||||
static {
|
||||
__name(this, "STS");
|
||||
}
|
||||
};
|
||||
(0, import_smithy_client6.createAggregatedClient)(commands, STS);
|
||||
|
||||
// src/submodules/sts/index.ts
|
||||
var import_EndpointParameters3 = require("./endpoint/EndpointParameters");
|
||||
|
||||
// src/submodules/sts/defaultStsRoleAssumers.ts
|
||||
var import_client = require("@aws-sdk/core/client");
|
||||
var ASSUME_ROLE_DEFAULT_REGION = "us-east-1";
|
||||
var getAccountIdFromAssumedRoleUser = /* @__PURE__ */ __name((assumedRoleUser) => {
|
||||
if (typeof assumedRoleUser?.Arn === "string") {
|
||||
const arnComponents = assumedRoleUser.Arn.split(":");
|
||||
if (arnComponents.length > 4 && arnComponents[4] !== "") {
|
||||
return arnComponents[4];
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
}, "getAccountIdFromAssumedRoleUser");
|
||||
var resolveRegion = /* @__PURE__ */ __name(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;
|
||||
}, "resolveRegion");
|
||||
var getDefaultRoleAssumer = /* @__PURE__ */ __name((stsOptions, STSClient3) => {
|
||||
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 STSClient3({
|
||||
profile: stsOptions?.parentClientConfig?.profile,
|
||||
// A hack to make sts client uses the credential in current closure.
|
||||
credentialDefaultProvider: /* @__PURE__ */ __name(() => async () => closureSourceCreds, "credentialDefaultProvider"),
|
||||
region: resolvedRegion,
|
||||
requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
|
||||
logger
|
||||
});
|
||||
}
|
||||
const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleCommand(params));
|
||||
if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) {
|
||||
throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`);
|
||||
}
|
||||
const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser2);
|
||||
const credentials = {
|
||||
accessKeyId: Credentials2.AccessKeyId,
|
||||
secretAccessKey: Credentials2.SecretAccessKey,
|
||||
sessionToken: Credentials2.SessionToken,
|
||||
expiration: Credentials2.Expiration,
|
||||
// TODO(credentialScope): access normally when shape is updated.
|
||||
...Credentials2.CredentialScope && { credentialScope: Credentials2.CredentialScope },
|
||||
...accountId && { accountId }
|
||||
};
|
||||
(0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i");
|
||||
return credentials;
|
||||
};
|
||||
}, "getDefaultRoleAssumer");
|
||||
var getDefaultRoleAssumerWithWebIdentity = /* @__PURE__ */ __name((stsOptions, STSClient3) => {
|
||||
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 STSClient3({
|
||||
profile: stsOptions?.parentClientConfig?.profile,
|
||||
region: resolvedRegion,
|
||||
requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
|
||||
logger
|
||||
});
|
||||
}
|
||||
const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));
|
||||
if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) {
|
||||
throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`);
|
||||
}
|
||||
const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser2);
|
||||
const credentials = {
|
||||
accessKeyId: Credentials2.AccessKeyId,
|
||||
secretAccessKey: Credentials2.SecretAccessKey,
|
||||
sessionToken: Credentials2.SessionToken,
|
||||
expiration: Credentials2.Expiration,
|
||||
// TODO(credentialScope): access normally when shape is updated.
|
||||
...Credentials2.CredentialScope && { credentialScope: Credentials2.CredentialScope },
|
||||
...accountId && { accountId }
|
||||
};
|
||||
if (accountId) {
|
||||
(0, import_client.setCredentialFeature)(credentials, "RESOLVED_ACCOUNT_ID", "T");
|
||||
}
|
||||
(0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID", "k");
|
||||
return credentials;
|
||||
};
|
||||
}, "getDefaultRoleAssumerWithWebIdentity");
|
||||
var isH2 = /* @__PURE__ */ __name((requestHandler) => {
|
||||
return requestHandler?.metadata?.handlerProtocol === "h2";
|
||||
}, "isH2");
|
||||
|
||||
// src/submodules/sts/defaultRoleAssumers.ts
|
||||
var import_STSClient2 = require("./STSClient");
|
||||
var getCustomizableStsClientCtor = /* @__PURE__ */ __name((baseCtor, customizations) => {
|
||||
if (!customizations) return baseCtor;
|
||||
else
|
||||
return class CustomizableSTSClient extends baseCtor {
|
||||
static {
|
||||
__name(this, "CustomizableSTSClient");
|
||||
}
|
||||
constructor(config) {
|
||||
super(config);
|
||||
for (const customization of customizations) {
|
||||
this.middlewareStack.use(customization);
|
||||
}
|
||||
}
|
||||
};
|
||||
}, "getCustomizableStsClientCtor");
|
||||
var getDefaultRoleAssumer2 = /* @__PURE__ */ __name((stsOptions = {}, stsPlugins) => getDefaultRoleAssumer(stsOptions, getCustomizableStsClientCtor(import_STSClient2.STSClient, stsPlugins)), "getDefaultRoleAssumer");
|
||||
var getDefaultRoleAssumerWithWebIdentity2 = /* @__PURE__ */ __name((stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity(stsOptions, getCustomizableStsClientCtor(import_STSClient2.STSClient, stsPlugins)), "getDefaultRoleAssumerWithWebIdentity");
|
||||
var decorateDefaultCredentialProvider = /* @__PURE__ */ __name((provider) => (input) => provider({
|
||||
roleAssumer: getDefaultRoleAssumer2(input),
|
||||
roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity2(input),
|
||||
...input
|
||||
}), "decorateDefaultCredentialProvider");
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
AssumeRoleCommand,
|
||||
AssumeRoleResponseFilterSensitiveLog,
|
||||
AssumeRoleWithWebIdentityCommand,
|
||||
AssumeRoleWithWebIdentityRequestFilterSensitiveLog,
|
||||
AssumeRoleWithWebIdentityResponseFilterSensitiveLog,
|
||||
ClientInputEndpointParameters,
|
||||
CredentialsFilterSensitiveLog,
|
||||
ExpiredTokenException,
|
||||
IDPCommunicationErrorException,
|
||||
IDPRejectedClaimException,
|
||||
InvalidIdentityTokenException,
|
||||
MalformedPolicyDocumentException,
|
||||
PackedPolicyTooLargeException,
|
||||
RegionDisabledException,
|
||||
STS,
|
||||
STSServiceException,
|
||||
decorateDefaultCredentialProvider,
|
||||
getDefaultRoleAssumer,
|
||||
getDefaultRoleAssumerWithWebIdentity,
|
||||
...require("./STSClient")
|
||||
});
|
||||
Generated
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getRuntimeConfig = void 0;
|
||||
const tslib_1 = require("tslib");
|
||||
const package_json_1 = tslib_1.__importDefault(require("../../../package.json"));
|
||||
const sha256_browser_1 = require("@aws-crypto/sha256-browser");
|
||||
const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser");
|
||||
const config_resolver_1 = require("@smithy/config-resolver");
|
||||
const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
|
||||
const invalid_dependency_1 = require("@smithy/invalid-dependency");
|
||||
const util_body_length_browser_1 = require("@smithy/util-body-length-browser");
|
||||
const util_retry_1 = require("@smithy/util-retry");
|
||||
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
||||
const smithy_client_1 = require("@smithy/smithy-client");
|
||||
const util_defaults_mode_browser_1 = require("@smithy/util-defaults-mode-browser");
|
||||
const getRuntimeConfig = (config) => {
|
||||
const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config);
|
||||
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
|
||||
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
|
||||
return {
|
||||
...clientSharedValues,
|
||||
...config,
|
||||
runtime: "browser",
|
||||
defaultsMode,
|
||||
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength,
|
||||
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
||||
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
||||
(0, util_user_agent_browser_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
|
||||
maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS,
|
||||
region: config?.region ?? (0, invalid_dependency_1.invalidProvider)("Region is missing"),
|
||||
requestHandler: fetch_http_handler_1.FetchHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
||||
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE),
|
||||
sha256: config?.sha256 ?? sha256_browser_1.Sha256,
|
||||
streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector,
|
||||
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
||||
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_FIPS_ENDPOINT)),
|
||||
};
|
||||
};
|
||||
exports.getRuntimeConfig = getRuntimeConfig;
|
||||
Generated
Vendored
+68
@@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getRuntimeConfig = void 0;
|
||||
const tslib_1 = require("tslib");
|
||||
const package_json_1 = tslib_1.__importDefault(require("../../../package.json"));
|
||||
const core_1 = require("@aws-sdk/core");
|
||||
const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node");
|
||||
const config_resolver_1 = require("@smithy/config-resolver");
|
||||
const core_2 = require("@smithy/core");
|
||||
const hash_node_1 = require("@smithy/hash-node");
|
||||
const middleware_retry_1 = require("@smithy/middleware-retry");
|
||||
const node_config_provider_1 = require("@smithy/node-config-provider");
|
||||
const node_http_handler_1 = require("@smithy/node-http-handler");
|
||||
const util_body_length_node_1 = require("@smithy/util-body-length-node");
|
||||
const util_retry_1 = require("@smithy/util-retry");
|
||||
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
||||
const smithy_client_1 = require("@smithy/smithy-client");
|
||||
const util_defaults_mode_node_1 = require("@smithy/util-defaults-mode-node");
|
||||
const smithy_client_2 = require("@smithy/smithy-client");
|
||||
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;
|
||||
Generated
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getRuntimeConfig = void 0;
|
||||
const sha256_js_1 = require("@aws-crypto/sha256-js");
|
||||
const runtimeConfig_browser_1 = require("./runtimeConfig.browser");
|
||||
const getRuntimeConfig = (config) => {
|
||||
const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config);
|
||||
return {
|
||||
...browserDefaults,
|
||||
...config,
|
||||
runtime: "react-native",
|
||||
sha256: config?.sha256 ?? sha256_js_1.Sha256,
|
||||
};
|
||||
};
|
||||
exports.getRuntimeConfig = getRuntimeConfig;
|
||||
Generated
Vendored
+40
@@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getRuntimeConfig = void 0;
|
||||
const core_1 = require("@aws-sdk/core");
|
||||
const core_2 = require("@smithy/core");
|
||||
const smithy_client_1 = require("@smithy/smithy-client");
|
||||
const url_parser_1 = require("@smithy/url-parser");
|
||||
const util_base64_1 = require("@smithy/util-base64");
|
||||
const util_utf8_1 = require("@smithy/util-utf8");
|
||||
const httpAuthSchemeProvider_1 = require("./auth/httpAuthSchemeProvider");
|
||||
const endpointResolver_1 = require("./endpoint/endpointResolver");
|
||||
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;
|
||||
Generated
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.resolveRuntimeExtensions = void 0;
|
||||
const region_config_resolver_1 = require("@aws-sdk/region-config-resolver");
|
||||
const protocol_http_1 = require("@smithy/protocol-http");
|
||||
const smithy_client_1 = require("@smithy/smithy-client");
|
||||
const httpAuthExtensionConfiguration_1 = require("./auth/httpAuthExtensionConfiguration");
|
||||
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;
|
||||
Reference in New Issue
Block a user