This commit is contained in:
2025-01-04 00:34:03 +01:00
parent 41829408dc
commit 0ca14bbc19
18111 changed files with 1871397 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveHttpAuthSchemeConfig = exports.defaultSSOHttpAuthSchemeProvider = exports.defaultSSOHttpAuthSchemeParametersProvider = void 0;
const core_1 = require("@aws-sdk/core");
const util_middleware_1 = require("@smithy/util-middleware");
const defaultSSOHttpAuthSchemeParametersProvider = 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.defaultSSOHttpAuthSchemeParametersProvider = defaultSSOHttpAuthSchemeParametersProvider;
function createAwsAuthSigv4HttpAuthOption(authParameters) {
return {
schemeId: "aws.auth#sigv4",
signingProperties: {
name: "awsssoportal",
region: authParameters.region,
},
propertiesExtractor: (config, context) => ({
signingProperties: {
config,
context,
},
}),
};
}
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
return {
schemeId: "smithy.api#noAuth",
};
}
const defaultSSOHttpAuthSchemeProvider = (authParameters) => {
const options = [];
switch (authParameters.operation) {
case "GetRoleCredentials": {
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
break;
}
case "ListAccountRoles": {
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
break;
}
case "ListAccounts": {
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
break;
}
case "Logout": {
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
break;
}
default: {
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
}
}
return options;
};
exports.defaultSSOHttpAuthSchemeProvider = defaultSSOHttpAuthSchemeProvider;
const resolveHttpAuthSchemeConfig = (config) => {
const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);
return {
...config_0,
};
};
exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;

View File

@@ -0,0 +1,14 @@
"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 defaultEndpointResolver = (endpointParams, context = {}) => {
return (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;

View File

@@ -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://portal.sso-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://portal.sso.{Region}.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://portal.sso-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://portal.sso.{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://portal.sso.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] };
exports.ruleSet = _data;

View File

@@ -0,0 +1,630 @@
"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/index.ts
var src_exports = {};
__export(src_exports, {
GetRoleCredentialsCommand: () => GetRoleCredentialsCommand,
GetRoleCredentialsRequestFilterSensitiveLog: () => GetRoleCredentialsRequestFilterSensitiveLog,
GetRoleCredentialsResponseFilterSensitiveLog: () => GetRoleCredentialsResponseFilterSensitiveLog,
InvalidRequestException: () => InvalidRequestException,
ListAccountRolesCommand: () => ListAccountRolesCommand,
ListAccountRolesRequestFilterSensitiveLog: () => ListAccountRolesRequestFilterSensitiveLog,
ListAccountsCommand: () => ListAccountsCommand,
ListAccountsRequestFilterSensitiveLog: () => ListAccountsRequestFilterSensitiveLog,
LogoutCommand: () => LogoutCommand,
LogoutRequestFilterSensitiveLog: () => LogoutRequestFilterSensitiveLog,
ResourceNotFoundException: () => ResourceNotFoundException,
RoleCredentialsFilterSensitiveLog: () => RoleCredentialsFilterSensitiveLog,
SSO: () => SSO,
SSOClient: () => SSOClient,
SSOServiceException: () => SSOServiceException,
TooManyRequestsException: () => TooManyRequestsException,
UnauthorizedException: () => UnauthorizedException,
__Client: () => import_smithy_client.Client,
paginateListAccountRoles: () => paginateListAccountRoles,
paginateListAccounts: () => paginateListAccounts
});
module.exports = __toCommonJS(src_exports);
// src/SSOClient.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_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
// src/endpoint/EndpointParameters.ts
var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
return {
...options,
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
useFipsEndpoint: options.useFipsEndpoint ?? false,
defaultSigningName: "awsssoportal"
};
}, "resolveClientEndpointParameters");
var commonParams = {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
};
// src/SSOClient.ts
var import_runtimeConfig = require("././runtimeConfig");
// src/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/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/runtimeExtensions.ts
var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
const extensionConfiguration = {
...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig))
};
extensions.forEach((extension) => extension.configure(extensionConfiguration));
return {
...runtimeConfig,
...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
...resolveHttpAuthRuntimeConfig(extensionConfiguration)
};
}, "resolveRuntimeExtensions");
// src/SSOClient.ts
var _SSOClient = class _SSOClient extends import_smithy_client.Client {
constructor(...[configuration]) {
const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
const _config_1 = resolveClientEndpointParameters(_config_0);
const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1);
const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
const _config_6 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_5);
const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
super(_config_8);
this.config = _config_8;
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_middleware_user_agent.getUserAgentPlugin)(this.config));
this.middlewareStack.use(
(0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
identityProviderConfigProvider: this.getIdentityProviderConfigProvider()
})
);
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();
}
getDefaultHttpAuthSchemeParametersProvider() {
return import_httpAuthSchemeProvider.defaultSSOHttpAuthSchemeParametersProvider;
}
getIdentityProviderConfigProvider() {
return async (config) => new import_core.DefaultIdentityProviderConfig({
"aws.auth#sigv4": config.credentials
});
}
};
__name(_SSOClient, "SSOClient");
var SSOClient = _SSOClient;
// src/SSO.ts
// src/commands/GetRoleCredentialsCommand.ts
var import_middleware_serde = require("@smithy/middleware-serde");
var import_types = require("@smithy/types");
// src/models/models_0.ts
// src/models/SSOServiceException.ts
var _SSOServiceException = class _SSOServiceException extends import_smithy_client.ServiceException {
/**
* @internal
*/
constructor(options) {
super(options);
Object.setPrototypeOf(this, _SSOServiceException.prototype);
}
};
__name(_SSOServiceException, "SSOServiceException");
var SSOServiceException = _SSOServiceException;
// src/models/models_0.ts
var _InvalidRequestException = class _InvalidRequestException extends SSOServiceException {
/**
* @internal
*/
constructor(opts) {
super({
name: "InvalidRequestException",
$fault: "client",
...opts
});
this.name = "InvalidRequestException";
this.$fault = "client";
Object.setPrototypeOf(this, _InvalidRequestException.prototype);
}
};
__name(_InvalidRequestException, "InvalidRequestException");
var InvalidRequestException = _InvalidRequestException;
var _ResourceNotFoundException = class _ResourceNotFoundException extends SSOServiceException {
/**
* @internal
*/
constructor(opts) {
super({
name: "ResourceNotFoundException",
$fault: "client",
...opts
});
this.name = "ResourceNotFoundException";
this.$fault = "client";
Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
}
};
__name(_ResourceNotFoundException, "ResourceNotFoundException");
var ResourceNotFoundException = _ResourceNotFoundException;
var _TooManyRequestsException = class _TooManyRequestsException extends SSOServiceException {
/**
* @internal
*/
constructor(opts) {
super({
name: "TooManyRequestsException",
$fault: "client",
...opts
});
this.name = "TooManyRequestsException";
this.$fault = "client";
Object.setPrototypeOf(this, _TooManyRequestsException.prototype);
}
};
__name(_TooManyRequestsException, "TooManyRequestsException");
var TooManyRequestsException = _TooManyRequestsException;
var _UnauthorizedException = class _UnauthorizedException extends SSOServiceException {
/**
* @internal
*/
constructor(opts) {
super({
name: "UnauthorizedException",
$fault: "client",
...opts
});
this.name = "UnauthorizedException";
this.$fault = "client";
Object.setPrototypeOf(this, _UnauthorizedException.prototype);
}
};
__name(_UnauthorizedException, "UnauthorizedException");
var UnauthorizedException = _UnauthorizedException;
var GetRoleCredentialsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }
}), "GetRoleCredentialsRequestFilterSensitiveLog");
var RoleCredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
...obj.secretAccessKey && { secretAccessKey: import_smithy_client.SENSITIVE_STRING },
...obj.sessionToken && { sessionToken: import_smithy_client.SENSITIVE_STRING }
}), "RoleCredentialsFilterSensitiveLog");
var GetRoleCredentialsResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
...obj.roleCredentials && { roleCredentials: RoleCredentialsFilterSensitiveLog(obj.roleCredentials) }
}), "GetRoleCredentialsResponseFilterSensitiveLog");
var ListAccountRolesRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }
}), "ListAccountRolesRequestFilterSensitiveLog");
var ListAccountsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }
}), "ListAccountsRequestFilterSensitiveLog");
var LogoutRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
...obj,
...obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }
}), "LogoutRequestFilterSensitiveLog");
// src/protocols/Aws_restJson1.ts
var import_core2 = require("@aws-sdk/core");
var se_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
[_xasbt]: input[_aT]
});
b.bp("/federation/credentials");
const query = (0, import_smithy_client.map)({
[_rn]: [, (0, import_smithy_client.expectNonNull)(input[_rN], `roleName`)],
[_ai]: [, (0, import_smithy_client.expectNonNull)(input[_aI], `accountId`)]
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_GetRoleCredentialsCommand");
var se_ListAccountRolesCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
[_xasbt]: input[_aT]
});
b.bp("/assignment/roles");
const query = (0, import_smithy_client.map)({
[_nt]: [, input[_nT]],
[_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
[_ai]: [, (0, import_smithy_client.expectNonNull)(input[_aI], `accountId`)]
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListAccountRolesCommand");
var se_ListAccountsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
[_xasbt]: input[_aT]
});
b.bp("/assignment/accounts");
const query = (0, import_smithy_client.map)({
[_nt]: [, input[_nT]],
[_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()]
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListAccountsCommand");
var se_LogoutCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
[_xasbt]: input[_aT]
});
b.bp("/logout");
let body;
b.m("POST").h(headers).b(body);
return b.build();
}, "se_LogoutCommand");
var de_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output)
});
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
const doc = (0, import_smithy_client.take)(data, {
roleCredentials: import_smithy_client._json
});
Object.assign(contents, doc);
return contents;
}, "de_GetRoleCredentialsCommand");
var de_ListAccountRolesCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output)
});
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
const doc = (0, import_smithy_client.take)(data, {
nextToken: import_smithy_client.expectString,
roleList: import_smithy_client._json
});
Object.assign(contents, doc);
return contents;
}, "de_ListAccountRolesCommand");
var de_ListAccountsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output)
});
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
const doc = (0, import_smithy_client.take)(data, {
accountList: import_smithy_client._json,
nextToken: import_smithy_client.expectString
});
Object.assign(contents, doc);
return contents;
}, "de_ListAccountsCommand");
var de_LogoutCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output)
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_LogoutCommand");
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 "InvalidRequestException":
case "com.amazonaws.sso#InvalidRequestException":
throw await de_InvalidRequestExceptionRes(parsedOutput, context);
case "ResourceNotFoundException":
case "com.amazonaws.sso#ResourceNotFoundException":
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
case "TooManyRequestsException":
case "com.amazonaws.sso#TooManyRequestsException":
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
case "UnauthorizedException":
case "com.amazonaws.sso#UnauthorizedException":
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
default:
const parsedBody = parsedOutput.body;
return throwDefaultError({
output,
parsedBody,
errorCode
});
}
}, "de_CommandError");
var throwDefaultError = (0, import_smithy_client.withBaseException)(SSOServiceException);
var de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
message: import_smithy_client.expectString
});
Object.assign(contents, doc);
const exception = new InvalidRequestException({
$metadata: deserializeMetadata(parsedOutput),
...contents
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_InvalidRequestExceptionRes");
var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
message: import_smithy_client.expectString
});
Object.assign(contents, doc);
const exception = new ResourceNotFoundException({
$metadata: deserializeMetadata(parsedOutput),
...contents
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_ResourceNotFoundExceptionRes");
var de_TooManyRequestsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
message: import_smithy_client.expectString
});
Object.assign(contents, doc);
const exception = new TooManyRequestsException({
$metadata: deserializeMetadata(parsedOutput),
...contents
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_TooManyRequestsExceptionRes");
var de_UnauthorizedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
message: import_smithy_client.expectString
});
Object.assign(contents, doc);
const exception = new UnauthorizedException({
$metadata: deserializeMetadata(parsedOutput),
...contents
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_UnauthorizedExceptionRes");
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 isSerializableHeaderValue = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0), "isSerializableHeaderValue");
var _aI = "accountId";
var _aT = "accessToken";
var _ai = "account_id";
var _mR = "maxResults";
var _mr = "max_result";
var _nT = "nextToken";
var _nt = "next_token";
var _rN = "roleName";
var _rn = "role_name";
var _xasbt = "x-amz-sso_bearer_token";
// src/commands/GetRoleCredentialsCommand.ts
var _GetRoleCredentialsCommand = class _GetRoleCredentialsCommand extends import_smithy_client.Command.classBuilder().ep({
...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("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").f(GetRoleCredentialsRequestFilterSensitiveLog, GetRoleCredentialsResponseFilterSensitiveLog).ser(se_GetRoleCredentialsCommand).de(de_GetRoleCredentialsCommand).build() {
};
__name(_GetRoleCredentialsCommand, "GetRoleCredentialsCommand");
var GetRoleCredentialsCommand = _GetRoleCredentialsCommand;
// src/commands/ListAccountRolesCommand.ts
var _ListAccountRolesCommand = class _ListAccountRolesCommand extends import_smithy_client.Command.classBuilder().ep({
...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("SWBPortalService", "ListAccountRoles", {}).n("SSOClient", "ListAccountRolesCommand").f(ListAccountRolesRequestFilterSensitiveLog, void 0).ser(se_ListAccountRolesCommand).de(de_ListAccountRolesCommand).build() {
};
__name(_ListAccountRolesCommand, "ListAccountRolesCommand");
var ListAccountRolesCommand = _ListAccountRolesCommand;
// src/commands/ListAccountsCommand.ts
var _ListAccountsCommand = class _ListAccountsCommand extends import_smithy_client.Command.classBuilder().ep({
...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("SWBPortalService", "ListAccounts", {}).n("SSOClient", "ListAccountsCommand").f(ListAccountsRequestFilterSensitiveLog, void 0).ser(se_ListAccountsCommand).de(de_ListAccountsCommand).build() {
};
__name(_ListAccountsCommand, "ListAccountsCommand");
var ListAccountsCommand = _ListAccountsCommand;
// src/commands/LogoutCommand.ts
var _LogoutCommand = class _LogoutCommand extends import_smithy_client.Command.classBuilder().ep({
...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("SWBPortalService", "Logout", {}).n("SSOClient", "LogoutCommand").f(LogoutRequestFilterSensitiveLog, void 0).ser(se_LogoutCommand).de(de_LogoutCommand).build() {
};
__name(_LogoutCommand, "LogoutCommand");
var LogoutCommand = _LogoutCommand;
// src/SSO.ts
var commands = {
GetRoleCredentialsCommand,
ListAccountRolesCommand,
ListAccountsCommand,
LogoutCommand
};
var _SSO = class _SSO extends SSOClient {
};
__name(_SSO, "SSO");
var SSO = _SSO;
(0, import_smithy_client.createAggregatedClient)(commands, SSO);
// src/pagination/ListAccountRolesPaginator.ts
var paginateListAccountRoles = (0, import_core.createPaginator)(SSOClient, ListAccountRolesCommand, "nextToken", "nextToken", "maxResults");
// src/pagination/ListAccountsPaginator.ts
var paginateListAccounts = (0, import_core.createPaginator)(SSOClient, ListAccountsCommand, "nextToken", "nextToken", "maxResults");
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
SSOServiceException,
__Client,
SSOClient,
SSO,
$Command,
GetRoleCredentialsCommand,
ListAccountRolesCommand,
ListAccountsCommand,
LogoutCommand,
paginateListAccountRoles,
paginateListAccounts,
InvalidRequestException,
ResourceNotFoundException,
TooManyRequestsException,
UnauthorizedException,
GetRoleCredentialsRequestFilterSensitiveLog,
RoleCredentialsFilterSensitiveLog,
GetRoleCredentialsResponseFilterSensitiveLog,
ListAccountRolesRequestFilterSensitiveLog,
ListAccountsRequestFilterSensitiveLog,
LogoutRequestFilterSensitiveLog
});

View File

@@ -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.defaultUserAgent)({ 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;

View File

@@ -0,0 +1,47 @@
"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);
return {
...clientSharedValues,
...config,
runtime: "node",
defaultsMode,
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
(0, util_user_agent_node_1.defaultUserAgent)({ 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),
region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS),
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,
}),
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),
useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
};
};
exports.getRuntimeConfig = getRuntimeConfig;

View File

@@ -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;

View File

@@ -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.defaultSSOHttpAuthSchemeProvider,
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",
urlParser: config?.urlParser ?? url_parser_1.parseUrl,
utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
};
};
exports.getRuntimeConfig = getRuntimeConfig;