@cdk8s/awscdk-resolver 0.0.57 → 0.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/.jsii +3 -3
  2. package/lib/resolve.js +1 -1
  3. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/auth/httpAuthSchemeProvider.js +47 -0
  4. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/index.js +267 -1714
  5. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/runtimeConfig.shared.js +10 -0
  6. package/node_modules/@aws-sdk/client-cloudformation/dist-es/CloudFormationClient.js +17 -4
  7. package/node_modules/@aws-sdk/client-cloudformation/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  8. package/node_modules/@aws-sdk/client-cloudformation/dist-es/auth/httpAuthSchemeProvider.js +41 -0
  9. package/node_modules/@aws-sdk/client-cloudformation/dist-es/protocols/Aws_query.js +180 -1685
  10. package/node_modules/@aws-sdk/client-cloudformation/dist-es/runtimeConfig.shared.js +10 -0
  11. package/node_modules/@aws-sdk/client-cloudformation/dist-es/runtimeExtensions.js +3 -0
  12. package/node_modules/@aws-sdk/client-cloudformation/dist-types/CloudFormationClient.d.ts +13 -11
  13. package/node_modules/@aws-sdk/client-cloudformation/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  14. package/node_modules/@aws-sdk/client-cloudformation/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
  15. package/node_modules/@aws-sdk/client-cloudformation/dist-types/extensionConfiguration.d.ts +2 -1
  16. package/node_modules/@aws-sdk/client-cloudformation/dist-types/runtimeConfig.browser.d.ts +5 -3
  17. package/node_modules/@aws-sdk/client-cloudformation/dist-types/runtimeConfig.d.ts +4 -2
  18. package/node_modules/@aws-sdk/client-cloudformation/dist-types/runtimeConfig.native.d.ts +6 -4
  19. package/node_modules/@aws-sdk/client-cloudformation/dist-types/runtimeConfig.shared.d.ts +2 -0
  20. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/CloudFormationClient.d.ts +11 -9
  21. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
  22. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +44 -0
  23. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/extensionConfiguration.d.ts +3 -1
  24. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/runtimeConfig.browser.d.ts +5 -5
  25. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/runtimeConfig.d.ts +4 -4
  26. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/runtimeConfig.native.d.ts +8 -8
  27. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/runtimeConfig.shared.d.ts +2 -0
  28. package/node_modules/@aws-sdk/client-cloudformation/package.json +16 -16
  29. package/node_modules/@aws-sdk/client-sso/dist-cjs/auth/httpAuthSchemeProvider.js +68 -0
  30. package/node_modules/@aws-sdk/client-sso/dist-cjs/index.js +76 -96
  31. package/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.shared.js +16 -0
  32. package/node_modules/@aws-sdk/client-sso/dist-es/SSOClient.js +19 -3
  33. package/node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  34. package/node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthSchemeProvider.js +62 -0
  35. package/node_modules/@aws-sdk/client-sso/dist-es/protocols/Aws_restJson1.js +8 -89
  36. package/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.shared.js +16 -0
  37. package/node_modules/@aws-sdk/client-sso/dist-es/runtimeExtensions.js +3 -0
  38. package/node_modules/@aws-sdk/client-sso/dist-types/SSOClient.d.ts +9 -6
  39. package/node_modules/@aws-sdk/client-sso/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  40. package/node_modules/@aws-sdk/client-sso/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
  41. package/node_modules/@aws-sdk/client-sso/dist-types/extensionConfiguration.d.ts +2 -1
  42. package/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.browser.d.ts +16 -0
  43. package/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.d.ts +16 -0
  44. package/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.native.d.ts +17 -1
  45. package/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.shared.d.ts +13 -0
  46. package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/SSOClient.d.ts +9 -1
  47. package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
  48. package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +43 -0
  49. package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/extensionConfiguration.d.ts +3 -1
  50. package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.browser.d.ts +46 -0
  51. package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.d.ts +46 -0
  52. package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.native.d.ts +47 -1
  53. package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.shared.d.ts +30 -0
  54. package/node_modules/@aws-sdk/client-sso/package.json +14 -13
  55. package/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/auth/httpAuthSchemeProvider.js +64 -0
  56. package/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js +96 -144
  57. package/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.shared.js +16 -0
  58. package/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDCClient.js +17 -3
  59. package/node_modules/@aws-sdk/client-sso-oidc/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  60. package/node_modules/@aws-sdk/client-sso-oidc/dist-es/auth/httpAuthSchemeProvider.js +58 -0
  61. package/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/CreateTokenWithIAMCommand.js +0 -2
  62. package/node_modules/@aws-sdk/client-sso-oidc/dist-es/protocols/Aws_restJson1.js +29 -134
  63. package/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.shared.js +16 -0
  64. package/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeExtensions.js +3 -0
  65. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/SSOOIDCClient.d.ts +13 -11
  66. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  67. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
  68. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/extensionConfiguration.d.ts +2 -1
  69. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.browser.d.ts +13 -3
  70. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.d.ts +12 -2
  71. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.native.d.ts +14 -4
  72. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.shared.d.ts +13 -0
  73. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/SSOOIDCClient.d.ts +11 -9
  74. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
  75. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +44 -0
  76. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/extensionConfiguration.d.ts +3 -1
  77. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.browser.d.ts +30 -5
  78. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.d.ts +29 -4
  79. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.native.d.ts +33 -8
  80. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.shared.d.ts +30 -0
  81. package/node_modules/@aws-sdk/client-sso-oidc/package.json +16 -16
  82. package/node_modules/@aws-sdk/client-sts/dist-cjs/index.js +74 -196
  83. package/node_modules/@aws-sdk/client-sts/dist-es/defaultStsRoleAssumers.js +17 -15
  84. package/node_modules/@aws-sdk/client-sts/dist-es/protocols/Aws_query.js +30 -178
  85. package/node_modules/@aws-sdk/client-sts/dist-types/defaultRoleAssumers.d.ts +4 -4
  86. package/node_modules/@aws-sdk/client-sts/dist-types/defaultStsRoleAssumers.d.ts +11 -3
  87. package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/defaultRoleAssumers.d.ts +4 -7
  88. package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/defaultStsRoleAssumers.d.ts +11 -3
  89. package/node_modules/@aws-sdk/client-sts/package.json +14 -14
  90. package/node_modules/@aws-sdk/core/CHANGELOG.md +22 -0
  91. package/node_modules/@aws-sdk/core/dist-cjs/index.js +13 -7
  92. package/node_modules/@aws-sdk/core/dist-es/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js +6 -2
  93. package/node_modules/@aws-sdk/core/package.json +2 -2
  94. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts +10 -2
  95. package/node_modules/@aws-sdk/core/tsconfig.cjs.tsbuildinfo +1 -1
  96. package/node_modules/@aws-sdk/core/tsconfig.es.tsbuildinfo +1 -1
  97. package/node_modules/@aws-sdk/core/tsconfig.types.tsbuildinfo +1 -1
  98. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  99. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  100. package/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +10 -2
  101. package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveAssumeRoleCredentials.js +5 -1
  102. package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js +1 -0
  103. package/node_modules/@aws-sdk/credential-provider-ini/package.json +7 -7
  104. package/node_modules/@aws-sdk/credential-provider-node/package.json +10 -9
  105. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  106. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  107. package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js +28 -1
  108. package/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js +5 -1
  109. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  110. package/node_modules/@aws-sdk/middleware-host-header/package.json +2 -2
  111. package/node_modules/@aws-sdk/middleware-logger/package.json +2 -2
  112. package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +2 -2
  113. package/node_modules/@aws-sdk/middleware-user-agent/package.json +3 -3
  114. package/node_modules/@aws-sdk/region-config-resolver/package.json +2 -2
  115. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  116. package/node_modules/@aws-sdk/types/dist-types/credentials.d.ts +16 -0
  117. package/node_modules/@aws-sdk/types/dist-types/ts3.4/credentials.d.ts +3 -0
  118. package/node_modules/@aws-sdk/types/package.json +1 -1
  119. package/node_modules/@aws-sdk/util-endpoints/package.json +2 -2
  120. package/node_modules/@aws-sdk/util-user-agent-browser/package.json +2 -2
  121. package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
  122. package/node_modules/@smithy/core/dist-cjs/index.js +26 -15
  123. package/node_modules/@smithy/core/dist-es/pagination/createPaginator.js +12 -1
  124. package/node_modules/@smithy/core/package.json +1 -1
  125. package/node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js +13 -3
  126. package/node_modules/@smithy/util-defaults-mode-node/dist-es/resolveDefaultsModeConfig.js +1 -1
  127. package/node_modules/@smithy/util-defaults-mode-node/package.json +1 -1
  128. package/package.json +5 -5
  129. package/node_modules/@aws-sdk/middleware-signing/LICENSE +0 -201
  130. package/node_modules/@aws-sdk/middleware-signing/README.md +0 -4
  131. package/node_modules/@aws-sdk/middleware-signing/dist-cjs/awsAuthConfiguration.js +0 -1
  132. package/node_modules/@aws-sdk/middleware-signing/dist-cjs/awsAuthMiddleware.js +0 -1
  133. package/node_modules/@aws-sdk/middleware-signing/dist-cjs/index.js +0 -227
  134. package/node_modules/@aws-sdk/middleware-signing/dist-es/awsAuthConfiguration.js +0 -103
  135. package/node_modules/@aws-sdk/middleware-signing/dist-es/awsAuthMiddleware.js +0 -55
  136. package/node_modules/@aws-sdk/middleware-signing/dist-es/index.js +0 -2
  137. package/node_modules/@aws-sdk/middleware-signing/dist-es/utils/getSkewCorrectedDate.js +0 -1
  138. package/node_modules/@aws-sdk/middleware-signing/dist-es/utils/getUpdatedSystemClockOffset.js +0 -8
  139. package/node_modules/@aws-sdk/middleware-signing/dist-es/utils/isClockSkewed.js +0 -2
  140. package/node_modules/@aws-sdk/middleware-signing/dist-types/awsAuthConfiguration.d.ts +0 -99
  141. package/node_modules/@aws-sdk/middleware-signing/dist-types/awsAuthMiddleware.d.ts +0 -6
  142. package/node_modules/@aws-sdk/middleware-signing/dist-types/index.d.ts +0 -2
  143. package/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/awsAuthConfiguration.d.ts +0 -68
  144. package/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/awsAuthMiddleware.d.ts +0 -19
  145. package/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/index.d.ts +0 -2
  146. package/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/getSkewCorrectedDate.d.ts +0 -1
  147. package/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/getUpdatedSystemClockOffset.d.ts +0 -4
  148. package/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/isClockSkewed.d.ts +0 -4
  149. package/node_modules/@aws-sdk/middleware-signing/dist-types/utils/getSkewCorrectedDate.d.ts +0 -6
  150. package/node_modules/@aws-sdk/middleware-signing/dist-types/utils/getUpdatedSystemClockOffset.d.ts +0 -8
  151. package/node_modules/@aws-sdk/middleware-signing/dist-types/utils/isClockSkewed.d.ts +0 -7
  152. package/node_modules/@aws-sdk/middleware-signing/package.json +0 -59
  153. /package/node_modules/@aws-sdk/{middleware-signing/dist-cjs/utils/getSkewCorrectedDate.js → client-cloudformation/dist-cjs/auth/httpAuthExtensionConfiguration.js} +0 -0
  154. /package/node_modules/@aws-sdk/{middleware-signing/dist-cjs/utils/isClockSkewed.js → client-sso/dist-cjs/auth/httpAuthExtensionConfiguration.js} +0 -0
  155. /package/node_modules/@aws-sdk/{middleware-signing/dist-cjs/utils/getUpdatedSystemClockOffset.js → client-sso-oidc/dist-cjs/auth/httpAuthExtensionConfiguration.js} +0 -0
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveHttpAuthSchemeConfig = exports.defaultSSOHttpAuthSchemeProvider = exports.defaultSSOHttpAuthSchemeParametersProvider = void 0;
4
+ const core_1 = require("@aws-sdk/core");
5
+ const util_middleware_1 = require("@smithy/util-middleware");
6
+ const defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => {
7
+ return {
8
+ operation: (0, util_middleware_1.getSmithyContext)(context).operation,
9
+ region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
10
+ (() => {
11
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
12
+ })(),
13
+ };
14
+ };
15
+ exports.defaultSSOHttpAuthSchemeParametersProvider = defaultSSOHttpAuthSchemeParametersProvider;
16
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
17
+ return {
18
+ schemeId: "aws.auth#sigv4",
19
+ signingProperties: {
20
+ name: "awsssoportal",
21
+ region: authParameters.region,
22
+ },
23
+ propertiesExtractor: (config, context) => ({
24
+ signingProperties: {
25
+ config,
26
+ context,
27
+ },
28
+ }),
29
+ };
30
+ }
31
+ function createSmithyApiNoAuthHttpAuthOption(authParameters) {
32
+ return {
33
+ schemeId: "smithy.api#noAuth",
34
+ };
35
+ }
36
+ const defaultSSOHttpAuthSchemeProvider = (authParameters) => {
37
+ const options = [];
38
+ switch (authParameters.operation) {
39
+ case "GetRoleCredentials": {
40
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
41
+ break;
42
+ }
43
+ case "ListAccountRoles": {
44
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
45
+ break;
46
+ }
47
+ case "ListAccounts": {
48
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
49
+ break;
50
+ }
51
+ case "Logout": {
52
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
53
+ break;
54
+ }
55
+ default: {
56
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
57
+ }
58
+ }
59
+ return options;
60
+ };
61
+ exports.defaultSSOHttpAuthSchemeProvider = defaultSSOHttpAuthSchemeProvider;
62
+ const resolveHttpAuthSchemeConfig = (config) => {
63
+ const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);
64
+ return {
65
+ ...config_0,
66
+ };
67
+ };
68
+ exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
@@ -50,10 +50,12 @@ var import_middleware_logger = require("@aws-sdk/middleware-logger");
50
50
  var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
51
51
  var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
52
52
  var import_config_resolver = require("@smithy/config-resolver");
53
+ var import_core = require("@smithy/core");
53
54
  var import_middleware_content_length = require("@smithy/middleware-content-length");
54
55
  var import_middleware_endpoint = require("@smithy/middleware-endpoint");
55
56
  var import_middleware_retry = require("@smithy/middleware-retry");
56
57
 
58
+ var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
57
59
 
58
60
  // src/endpoint/EndpointParameters.ts
59
61
  var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
@@ -78,19 +80,62 @@ var import_runtimeConfig = require("././runtimeConfig");
78
80
  var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
79
81
  var import_protocol_http = require("@smithy/protocol-http");
80
82
  var import_smithy_client = require("@smithy/smithy-client");
83
+
84
+ // src/auth/httpAuthExtensionConfiguration.ts
85
+ var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
86
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
87
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
88
+ let _credentials = runtimeConfig.credentials;
89
+ return {
90
+ setHttpAuthScheme(httpAuthScheme) {
91
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
92
+ if (index === -1) {
93
+ _httpAuthSchemes.push(httpAuthScheme);
94
+ } else {
95
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
96
+ }
97
+ },
98
+ httpAuthSchemes() {
99
+ return _httpAuthSchemes;
100
+ },
101
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
102
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
103
+ },
104
+ httpAuthSchemeProvider() {
105
+ return _httpAuthSchemeProvider;
106
+ },
107
+ setCredentials(credentials) {
108
+ _credentials = credentials;
109
+ },
110
+ credentials() {
111
+ return _credentials;
112
+ }
113
+ };
114
+ }, "getHttpAuthExtensionConfiguration");
115
+ var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
116
+ return {
117
+ httpAuthSchemes: config.httpAuthSchemes(),
118
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
119
+ credentials: config.credentials()
120
+ };
121
+ }, "resolveHttpAuthRuntimeConfig");
122
+
123
+ // src/runtimeExtensions.ts
81
124
  var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
82
125
  var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
83
126
  const extensionConfiguration = {
84
127
  ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
85
128
  ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
86
- ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
129
+ ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
130
+ ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig))
87
131
  };
88
132
  extensions.forEach((extension) => extension.configure(extensionConfiguration));
89
133
  return {
90
134
  ...runtimeConfig,
91
135
  ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
92
136
  ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
93
- ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
137
+ ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
138
+ ...resolveHttpAuthRuntimeConfig(extensionConfiguration)
94
139
  };
95
140
  }, "resolveRuntimeExtensions");
96
141
 
@@ -104,15 +149,23 @@ var _SSOClient = class _SSOClient extends import_smithy_client.Client {
104
149
  const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
105
150
  const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
106
151
  const _config_6 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_5);
107
- const _config_7 = resolveRuntimeExtensions(_config_6, (configuration == null ? void 0 : configuration.extensions) || []);
108
- super(_config_7);
109
- this.config = _config_7;
152
+ const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
153
+ const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
154
+ super(_config_8);
155
+ this.config = _config_8;
110
156
  this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
111
157
  this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
112
158
  this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
113
159
  this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
114
160
  this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
115
161
  this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
162
+ this.middlewareStack.use(
163
+ (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
164
+ httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
165
+ identityProviderConfigProvider: this.getIdentityProviderConfigProvider()
166
+ })
167
+ );
168
+ this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
116
169
  }
117
170
  /**
118
171
  * Destroy underlying resources, like sockets. It's usually not necessary to do this.
@@ -122,6 +175,14 @@ var _SSOClient = class _SSOClient extends import_smithy_client.Client {
122
175
  destroy() {
123
176
  super.destroy();
124
177
  }
178
+ getDefaultHttpAuthSchemeParametersProvider() {
179
+ return import_httpAuthSchemeProvider.defaultSSOHttpAuthSchemeParametersProvider;
180
+ }
181
+ getIdentityProviderConfigProvider() {
182
+ return async (config) => new import_core.DefaultIdentityProviderConfig({
183
+ "aws.auth#sigv4": config.credentials
184
+ });
185
+ }
125
186
  };
126
187
  __name(_SSOClient, "SSOClient");
127
188
  var SSOClient = _SSOClient;
@@ -248,7 +309,7 @@ var LogoutRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
248
309
  }), "LogoutRequestFilterSensitiveLog");
249
310
 
250
311
  // src/protocols/Aws_restJson1.ts
251
- var import_core = require("@smithy/core");
312
+
252
313
 
253
314
  var se_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (input, context) => {
254
315
  const b = (0, import_core.requestBuilder)(input, context);
@@ -305,7 +366,7 @@ var se_LogoutCommand = /* @__PURE__ */ __name(async (input, context) => {
305
366
  }, "se_LogoutCommand");
306
367
  var de_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (output, context) => {
307
368
  if (output.statusCode !== 200 && output.statusCode >= 300) {
308
- return de_GetRoleCredentialsCommandError(output, context);
369
+ return de_CommandError(output, context);
309
370
  }
310
371
  const contents = (0, import_smithy_client.map)({
311
372
  $metadata: deserializeMetadata(output)
@@ -317,37 +378,9 @@ var de_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (output, context
317
378
  Object.assign(contents, doc);
318
379
  return contents;
319
380
  }, "de_GetRoleCredentialsCommand");
320
- var de_GetRoleCredentialsCommandError = /* @__PURE__ */ __name(async (output, context) => {
321
- const parsedOutput = {
322
- ...output,
323
- body: await parseErrorBody(output.body, context)
324
- };
325
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
326
- switch (errorCode) {
327
- case "InvalidRequestException":
328
- case "com.amazonaws.sso#InvalidRequestException":
329
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
330
- case "ResourceNotFoundException":
331
- case "com.amazonaws.sso#ResourceNotFoundException":
332
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
333
- case "TooManyRequestsException":
334
- case "com.amazonaws.sso#TooManyRequestsException":
335
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
336
- case "UnauthorizedException":
337
- case "com.amazonaws.sso#UnauthorizedException":
338
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
339
- default:
340
- const parsedBody = parsedOutput.body;
341
- return throwDefaultError({
342
- output,
343
- parsedBody,
344
- errorCode
345
- });
346
- }
347
- }, "de_GetRoleCredentialsCommandError");
348
381
  var de_ListAccountRolesCommand = /* @__PURE__ */ __name(async (output, context) => {
349
382
  if (output.statusCode !== 200 && output.statusCode >= 300) {
350
- return de_ListAccountRolesCommandError(output, context);
383
+ return de_CommandError(output, context);
351
384
  }
352
385
  const contents = (0, import_smithy_client.map)({
353
386
  $metadata: deserializeMetadata(output)
@@ -360,37 +393,9 @@ var de_ListAccountRolesCommand = /* @__PURE__ */ __name(async (output, context)
360
393
  Object.assign(contents, doc);
361
394
  return contents;
362
395
  }, "de_ListAccountRolesCommand");
363
- var de_ListAccountRolesCommandError = /* @__PURE__ */ __name(async (output, context) => {
364
- const parsedOutput = {
365
- ...output,
366
- body: await parseErrorBody(output.body, context)
367
- };
368
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
369
- switch (errorCode) {
370
- case "InvalidRequestException":
371
- case "com.amazonaws.sso#InvalidRequestException":
372
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
373
- case "ResourceNotFoundException":
374
- case "com.amazonaws.sso#ResourceNotFoundException":
375
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
376
- case "TooManyRequestsException":
377
- case "com.amazonaws.sso#TooManyRequestsException":
378
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
379
- case "UnauthorizedException":
380
- case "com.amazonaws.sso#UnauthorizedException":
381
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
382
- default:
383
- const parsedBody = parsedOutput.body;
384
- return throwDefaultError({
385
- output,
386
- parsedBody,
387
- errorCode
388
- });
389
- }
390
- }, "de_ListAccountRolesCommandError");
391
396
  var de_ListAccountsCommand = /* @__PURE__ */ __name(async (output, context) => {
392
397
  if (output.statusCode !== 200 && output.statusCode >= 300) {
393
- return de_ListAccountsCommandError(output, context);
398
+ return de_CommandError(output, context);
394
399
  }
395
400
  const contents = (0, import_smithy_client.map)({
396
401
  $metadata: deserializeMetadata(output)
@@ -403,37 +408,9 @@ var de_ListAccountsCommand = /* @__PURE__ */ __name(async (output, context) => {
403
408
  Object.assign(contents, doc);
404
409
  return contents;
405
410
  }, "de_ListAccountsCommand");
406
- var de_ListAccountsCommandError = /* @__PURE__ */ __name(async (output, context) => {
407
- const parsedOutput = {
408
- ...output,
409
- body: await parseErrorBody(output.body, context)
410
- };
411
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
412
- switch (errorCode) {
413
- case "InvalidRequestException":
414
- case "com.amazonaws.sso#InvalidRequestException":
415
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
416
- case "ResourceNotFoundException":
417
- case "com.amazonaws.sso#ResourceNotFoundException":
418
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
419
- case "TooManyRequestsException":
420
- case "com.amazonaws.sso#TooManyRequestsException":
421
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
422
- case "UnauthorizedException":
423
- case "com.amazonaws.sso#UnauthorizedException":
424
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
425
- default:
426
- const parsedBody = parsedOutput.body;
427
- return throwDefaultError({
428
- output,
429
- parsedBody,
430
- errorCode
431
- });
432
- }
433
- }, "de_ListAccountsCommandError");
434
411
  var de_LogoutCommand = /* @__PURE__ */ __name(async (output, context) => {
435
412
  if (output.statusCode !== 200 && output.statusCode >= 300) {
436
- return de_LogoutCommandError(output, context);
413
+ return de_CommandError(output, context);
437
414
  }
438
415
  const contents = (0, import_smithy_client.map)({
439
416
  $metadata: deserializeMetadata(output)
@@ -441,7 +418,7 @@ var de_LogoutCommand = /* @__PURE__ */ __name(async (output, context) => {
441
418
  await (0, import_smithy_client.collectBody)(output.body, context);
442
419
  return contents;
443
420
  }, "de_LogoutCommand");
444
- var de_LogoutCommandError = /* @__PURE__ */ __name(async (output, context) => {
421
+ var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
445
422
  const parsedOutput = {
446
423
  ...output,
447
424
  body: await parseErrorBody(output.body, context)
@@ -451,6 +428,9 @@ var de_LogoutCommandError = /* @__PURE__ */ __name(async (output, context) => {
451
428
  case "InvalidRequestException":
452
429
  case "com.amazonaws.sso#InvalidRequestException":
453
430
  throw await de_InvalidRequestExceptionRes(parsedOutput, context);
431
+ case "ResourceNotFoundException":
432
+ case "com.amazonaws.sso#ResourceNotFoundException":
433
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
454
434
  case "TooManyRequestsException":
455
435
  case "com.amazonaws.sso#TooManyRequestsException":
456
436
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
@@ -465,7 +445,7 @@ var de_LogoutCommandError = /* @__PURE__ */ __name(async (output, context) => {
465
445
  errorCode
466
446
  });
467
447
  }
468
- }, "de_LogoutCommandError");
448
+ }, "de_CommandError");
469
449
  var throwDefaultError = (0, import_smithy_client.withBaseException)(SSOServiceException);
470
450
  var de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
471
451
  const contents = (0, import_smithy_client.map)({});
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRuntimeConfig = void 0;
4
+ const core_1 = require("@aws-sdk/core");
5
+ const core_2 = require("@smithy/core");
4
6
  const smithy_client_1 = require("@smithy/smithy-client");
5
7
  const url_parser_1 = require("@smithy/url-parser");
6
8
  const util_base64_1 = require("@smithy/util-base64");
7
9
  const util_utf8_1 = require("@smithy/util-utf8");
10
+ const httpAuthSchemeProvider_1 = require("./auth/httpAuthSchemeProvider");
8
11
  const endpointResolver_1 = require("./endpoint/endpointResolver");
9
12
  const getRuntimeConfig = (config) => {
10
13
  return {
@@ -14,6 +17,19 @@ const getRuntimeConfig = (config) => {
14
17
  disableHostPrefix: config?.disableHostPrefix ?? false,
15
18
  endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
16
19
  extensions: config?.extensions ?? [],
20
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSSOHttpAuthSchemeProvider,
21
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
22
+ {
23
+ schemeId: "aws.auth#sigv4",
24
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
25
+ signer: new core_1.AwsSdkSigV4Signer(),
26
+ },
27
+ {
28
+ schemeId: "smithy.api#noAuth",
29
+ identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
30
+ signer: new core_2.NoAuthSigner(),
31
+ },
32
+ ],
17
33
  logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
18
34
  serviceId: config?.serviceId ?? "SSO",
19
35
  urlParser: config?.urlParser ?? url_parser_1.parseUrl,
@@ -3,10 +3,12 @@ import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
3
3
  import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
4
4
  import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
5
5
  import { resolveRegionConfig } from "@smithy/config-resolver";
6
+ import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
6
7
  import { getContentLengthPlugin } from "@smithy/middleware-content-length";
7
8
  import { resolveEndpointConfig } from "@smithy/middleware-endpoint";
8
9
  import { getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
9
10
  import { Client as __Client, } from "@smithy/smithy-client";
11
+ import { defaultSSOHttpAuthSchemeParametersProvider, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider";
10
12
  import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters";
11
13
  import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
12
14
  import { resolveRuntimeExtensions } from "./runtimeExtensions";
@@ -20,17 +22,31 @@ export class SSOClient extends __Client {
20
22
  const _config_4 = resolveRetryConfig(_config_3);
21
23
  const _config_5 = resolveHostHeaderConfig(_config_4);
22
24
  const _config_6 = resolveUserAgentConfig(_config_5);
23
- const _config_7 = resolveRuntimeExtensions(_config_6, configuration?.extensions || []);
24
- super(_config_7);
25
- this.config = _config_7;
25
+ const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
26
+ const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
27
+ super(_config_8);
28
+ this.config = _config_8;
26
29
  this.middlewareStack.use(getRetryPlugin(this.config));
27
30
  this.middlewareStack.use(getContentLengthPlugin(this.config));
28
31
  this.middlewareStack.use(getHostHeaderPlugin(this.config));
29
32
  this.middlewareStack.use(getLoggerPlugin(this.config));
30
33
  this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
31
34
  this.middlewareStack.use(getUserAgentPlugin(this.config));
35
+ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
36
+ httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
37
+ identityProviderConfigProvider: this.getIdentityProviderConfigProvider(),
38
+ }));
39
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
32
40
  }
33
41
  destroy() {
34
42
  super.destroy();
35
43
  }
44
+ getDefaultHttpAuthSchemeParametersProvider() {
45
+ return defaultSSOHttpAuthSchemeParametersProvider;
46
+ }
47
+ getIdentityProviderConfigProvider() {
48
+ return async (config) => new DefaultIdentityProviderConfig({
49
+ "aws.auth#sigv4": config.credentials,
50
+ });
51
+ }
36
52
  }
@@ -0,0 +1,38 @@
1
+ export const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
2
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
3
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
4
+ let _credentials = runtimeConfig.credentials;
5
+ return {
6
+ setHttpAuthScheme(httpAuthScheme) {
7
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
8
+ if (index === -1) {
9
+ _httpAuthSchemes.push(httpAuthScheme);
10
+ }
11
+ else {
12
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
13
+ }
14
+ },
15
+ httpAuthSchemes() {
16
+ return _httpAuthSchemes;
17
+ },
18
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
19
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
20
+ },
21
+ httpAuthSchemeProvider() {
22
+ return _httpAuthSchemeProvider;
23
+ },
24
+ setCredentials(credentials) {
25
+ _credentials = credentials;
26
+ },
27
+ credentials() {
28
+ return _credentials;
29
+ },
30
+ };
31
+ };
32
+ export const resolveHttpAuthRuntimeConfig = (config) => {
33
+ return {
34
+ httpAuthSchemes: config.httpAuthSchemes(),
35
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
36
+ credentials: config.credentials(),
37
+ };
38
+ };
@@ -0,0 +1,62 @@
1
+ import { resolveAwsSdkSigV4Config, } from "@aws-sdk/core";
2
+ import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";
3
+ export const defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => {
4
+ return {
5
+ operation: getSmithyContext(context).operation,
6
+ region: (await normalizeProvider(config.region)()) ||
7
+ (() => {
8
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
9
+ })(),
10
+ };
11
+ };
12
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
13
+ return {
14
+ schemeId: "aws.auth#sigv4",
15
+ signingProperties: {
16
+ name: "awsssoportal",
17
+ region: authParameters.region,
18
+ },
19
+ propertiesExtractor: (config, context) => ({
20
+ signingProperties: {
21
+ config,
22
+ context,
23
+ },
24
+ }),
25
+ };
26
+ }
27
+ function createSmithyApiNoAuthHttpAuthOption(authParameters) {
28
+ return {
29
+ schemeId: "smithy.api#noAuth",
30
+ };
31
+ }
32
+ export const defaultSSOHttpAuthSchemeProvider = (authParameters) => {
33
+ const options = [];
34
+ switch (authParameters.operation) {
35
+ case "GetRoleCredentials": {
36
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
37
+ break;
38
+ }
39
+ case "ListAccountRoles": {
40
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
41
+ break;
42
+ }
43
+ case "ListAccounts": {
44
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
45
+ break;
46
+ }
47
+ case "Logout": {
48
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
49
+ break;
50
+ }
51
+ default: {
52
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
53
+ }
54
+ }
55
+ return options;
56
+ };
57
+ export const resolveHttpAuthSchemeConfig = (config) => {
58
+ const config_0 = resolveAwsSdkSigV4Config(config);
59
+ return {
60
+ ...config_0,
61
+ };
62
+ };
@@ -57,7 +57,7 @@ export const se_LogoutCommand = async (input, context) => {
57
57
  };
58
58
  export const de_GetRoleCredentialsCommand = async (output, context) => {
59
59
  if (output.statusCode !== 200 && output.statusCode >= 300) {
60
- return de_GetRoleCredentialsCommandError(output, context);
60
+ return de_CommandError(output, context);
61
61
  }
62
62
  const contents = map({
63
63
  $metadata: deserializeMetadata(output),
@@ -69,37 +69,9 @@ export const de_GetRoleCredentialsCommand = async (output, context) => {
69
69
  Object.assign(contents, doc);
70
70
  return contents;
71
71
  };
72
- const de_GetRoleCredentialsCommandError = async (output, context) => {
73
- const parsedOutput = {
74
- ...output,
75
- body: await parseErrorBody(output.body, context),
76
- };
77
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
78
- switch (errorCode) {
79
- case "InvalidRequestException":
80
- case "com.amazonaws.sso#InvalidRequestException":
81
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
82
- case "ResourceNotFoundException":
83
- case "com.amazonaws.sso#ResourceNotFoundException":
84
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
85
- case "TooManyRequestsException":
86
- case "com.amazonaws.sso#TooManyRequestsException":
87
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
88
- case "UnauthorizedException":
89
- case "com.amazonaws.sso#UnauthorizedException":
90
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
91
- default:
92
- const parsedBody = parsedOutput.body;
93
- return throwDefaultError({
94
- output,
95
- parsedBody,
96
- errorCode,
97
- });
98
- }
99
- };
100
72
  export const de_ListAccountRolesCommand = async (output, context) => {
101
73
  if (output.statusCode !== 200 && output.statusCode >= 300) {
102
- return de_ListAccountRolesCommandError(output, context);
74
+ return de_CommandError(output, context);
103
75
  }
104
76
  const contents = map({
105
77
  $metadata: deserializeMetadata(output),
@@ -112,37 +84,9 @@ export const de_ListAccountRolesCommand = async (output, context) => {
112
84
  Object.assign(contents, doc);
113
85
  return contents;
114
86
  };
115
- const de_ListAccountRolesCommandError = async (output, context) => {
116
- const parsedOutput = {
117
- ...output,
118
- body: await parseErrorBody(output.body, context),
119
- };
120
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
121
- switch (errorCode) {
122
- case "InvalidRequestException":
123
- case "com.amazonaws.sso#InvalidRequestException":
124
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
125
- case "ResourceNotFoundException":
126
- case "com.amazonaws.sso#ResourceNotFoundException":
127
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
128
- case "TooManyRequestsException":
129
- case "com.amazonaws.sso#TooManyRequestsException":
130
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
131
- case "UnauthorizedException":
132
- case "com.amazonaws.sso#UnauthorizedException":
133
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
134
- default:
135
- const parsedBody = parsedOutput.body;
136
- return throwDefaultError({
137
- output,
138
- parsedBody,
139
- errorCode,
140
- });
141
- }
142
- };
143
87
  export const de_ListAccountsCommand = async (output, context) => {
144
88
  if (output.statusCode !== 200 && output.statusCode >= 300) {
145
- return de_ListAccountsCommandError(output, context);
89
+ return de_CommandError(output, context);
146
90
  }
147
91
  const contents = map({
148
92
  $metadata: deserializeMetadata(output),
@@ -155,37 +99,9 @@ export const de_ListAccountsCommand = async (output, context) => {
155
99
  Object.assign(contents, doc);
156
100
  return contents;
157
101
  };
158
- const de_ListAccountsCommandError = async (output, context) => {
159
- const parsedOutput = {
160
- ...output,
161
- body: await parseErrorBody(output.body, context),
162
- };
163
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
164
- switch (errorCode) {
165
- case "InvalidRequestException":
166
- case "com.amazonaws.sso#InvalidRequestException":
167
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
168
- case "ResourceNotFoundException":
169
- case "com.amazonaws.sso#ResourceNotFoundException":
170
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
171
- case "TooManyRequestsException":
172
- case "com.amazonaws.sso#TooManyRequestsException":
173
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
174
- case "UnauthorizedException":
175
- case "com.amazonaws.sso#UnauthorizedException":
176
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
177
- default:
178
- const parsedBody = parsedOutput.body;
179
- return throwDefaultError({
180
- output,
181
- parsedBody,
182
- errorCode,
183
- });
184
- }
185
- };
186
102
  export const de_LogoutCommand = async (output, context) => {
187
103
  if (output.statusCode !== 200 && output.statusCode >= 300) {
188
- return de_LogoutCommandError(output, context);
104
+ return de_CommandError(output, context);
189
105
  }
190
106
  const contents = map({
191
107
  $metadata: deserializeMetadata(output),
@@ -193,7 +109,7 @@ export const de_LogoutCommand = async (output, context) => {
193
109
  await collectBody(output.body, context);
194
110
  return contents;
195
111
  };
196
- const de_LogoutCommandError = async (output, context) => {
112
+ const de_CommandError = async (output, context) => {
197
113
  const parsedOutput = {
198
114
  ...output,
199
115
  body: await parseErrorBody(output.body, context),
@@ -203,6 +119,9 @@ const de_LogoutCommandError = async (output, context) => {
203
119
  case "InvalidRequestException":
204
120
  case "com.amazonaws.sso#InvalidRequestException":
205
121
  throw await de_InvalidRequestExceptionRes(parsedOutput, context);
122
+ case "ResourceNotFoundException":
123
+ case "com.amazonaws.sso#ResourceNotFoundException":
124
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
206
125
  case "TooManyRequestsException":
207
126
  case "com.amazonaws.sso#TooManyRequestsException":
208
127
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);