@aws-sdk/client-eks-auth 3.928.0 → 3.929.0

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.
@@ -1,4 +1,5 @@
1
1
  import { AwsSdkSigV4Signer } from "@aws-sdk/core";
2
+ import { AwsRestJsonProtocol } from "@aws-sdk/core/protocols";
2
3
  import { NoOpLogger } from "@smithy/smithy-client";
3
4
  import { parseUrl } from "@smithy/url-parser";
4
5
  import { fromBase64, toBase64 } from "@smithy/util-base64";
@@ -22,6 +23,7 @@ export const getRuntimeConfig = (config) => {
22
23
  },
23
24
  ],
24
25
  logger: config?.logger ?? new NoOpLogger(),
26
+ protocol: config?.protocol ?? new AwsRestJsonProtocol({ defaultNamespace: "com.amazonaws.eksauth" }),
25
27
  serviceId: config?.serviceId ?? "EKS Auth",
26
28
  urlParser: config?.urlParser ?? parseUrl,
27
29
  utf8Decoder: config?.utf8Decoder ?? fromUtf8,
@@ -0,0 +1,189 @@
1
+ const _ADE = "AccessDeniedException";
2
+ const _ARFPI = "AssumeRoleForPodIdentity";
3
+ const _ARFPIR = "AssumeRoleForPodIdentityRequest";
4
+ const _ARFPIRs = "AssumeRoleForPodIdentityResponse";
5
+ const _ARU = "AssumedRoleUser";
6
+ const _C = "Credentials";
7
+ const _ETE = "ExpiredTokenException";
8
+ const _IPE = "InvalidParameterException";
9
+ const _IRE = "InvalidRequestException";
10
+ const _ISE = "InternalServerException";
11
+ const _ITE = "InvalidTokenException";
12
+ const _JT = "JwtToken";
13
+ const _PIA = "PodIdentityAssociation";
14
+ const _RNFE = "ResourceNotFoundException";
15
+ const _S = "Subject";
16
+ const _SUE = "ServiceUnavailableException";
17
+ const _TE = "ThrottlingException";
18
+ const _a = "arn";
19
+ const _aA = "associationArn";
20
+ const _aI = "associationId";
21
+ const _aKI = "accessKeyId";
22
+ const _aRI = "assumeRoleId";
23
+ const _aRU = "assumedRoleUser";
24
+ const _au = "audience";
25
+ const _c = "client";
26
+ const _cN = "clusterName";
27
+ const _cr = "credentials";
28
+ const _e = "error";
29
+ const _ex = "expiration";
30
+ const _h = "http";
31
+ const _hE = "httpError";
32
+ const _m = "message";
33
+ const _n = "namespace";
34
+ const _pIA = "podIdentityAssociation";
35
+ const _s = "subject";
36
+ const _sA = "serviceAccount";
37
+ const _sAK = "secretAccessKey";
38
+ const _sT = "sessionToken";
39
+ const _se = "server";
40
+ const _sm = "smithy.ts.sdk.synthetic.com.amazonaws.eksauth";
41
+ const _t = "token";
42
+ const n0 = "com.amazonaws.eksauth";
43
+ import { TypeRegistry } from "@smithy/core/schema";
44
+ import { EKSAuthServiceException as __EKSAuthServiceException } from "../models/EKSAuthServiceException";
45
+ import { AccessDeniedException as __AccessDeniedException, ExpiredTokenException as __ExpiredTokenException, InternalServerException as __InternalServerException, InvalidParameterException as __InvalidParameterException, InvalidRequestException as __InvalidRequestException, InvalidTokenException as __InvalidTokenException, ResourceNotFoundException as __ResourceNotFoundException, ServiceUnavailableException as __ServiceUnavailableException, ThrottlingException as __ThrottlingException, } from "../models/index";
46
+ export var JwtToken = [0, n0, _JT, 8, 0];
47
+ export var AccessDeniedException = [
48
+ -3,
49
+ n0,
50
+ _ADE,
51
+ {
52
+ [_e]: _c,
53
+ [_hE]: 400,
54
+ },
55
+ [_m],
56
+ [0],
57
+ ];
58
+ TypeRegistry.for(n0).registerError(AccessDeniedException, __AccessDeniedException);
59
+ export var AssumedRoleUser = [3, n0, _ARU, 0, [_a, _aRI], [0, 0]];
60
+ export var AssumeRoleForPodIdentityRequest = [
61
+ 3,
62
+ n0,
63
+ _ARFPIR,
64
+ 0,
65
+ [_cN, _t],
66
+ [
67
+ [0, 1],
68
+ [() => JwtToken, 0],
69
+ ],
70
+ ];
71
+ export var AssumeRoleForPodIdentityResponse = [
72
+ 3,
73
+ n0,
74
+ _ARFPIRs,
75
+ 0,
76
+ [_s, _au, _pIA, _aRU, _cr],
77
+ [() => Subject, 0, () => PodIdentityAssociation, () => AssumedRoleUser, [() => Credentials, 0]],
78
+ ];
79
+ export var Credentials = [3, n0, _C, 8, [_sT, _sAK, _aKI, _ex], [0, 0, 0, 4]];
80
+ export var ExpiredTokenException = [
81
+ -3,
82
+ n0,
83
+ _ETE,
84
+ {
85
+ [_e]: _c,
86
+ [_hE]: 400,
87
+ },
88
+ [_m],
89
+ [0],
90
+ ];
91
+ TypeRegistry.for(n0).registerError(ExpiredTokenException, __ExpiredTokenException);
92
+ export var InternalServerException = [
93
+ -3,
94
+ n0,
95
+ _ISE,
96
+ {
97
+ [_e]: _se,
98
+ [_hE]: 500,
99
+ },
100
+ [_m],
101
+ [0],
102
+ ];
103
+ TypeRegistry.for(n0).registerError(InternalServerException, __InternalServerException);
104
+ export var InvalidParameterException = [
105
+ -3,
106
+ n0,
107
+ _IPE,
108
+ {
109
+ [_e]: _c,
110
+ [_hE]: 400,
111
+ },
112
+ [_m],
113
+ [0],
114
+ ];
115
+ TypeRegistry.for(n0).registerError(InvalidParameterException, __InvalidParameterException);
116
+ export var InvalidRequestException = [
117
+ -3,
118
+ n0,
119
+ _IRE,
120
+ {
121
+ [_e]: _c,
122
+ [_hE]: 400,
123
+ },
124
+ [_m],
125
+ [0],
126
+ ];
127
+ TypeRegistry.for(n0).registerError(InvalidRequestException, __InvalidRequestException);
128
+ export var InvalidTokenException = [
129
+ -3,
130
+ n0,
131
+ _ITE,
132
+ {
133
+ [_e]: _c,
134
+ [_hE]: 400,
135
+ },
136
+ [_m],
137
+ [0],
138
+ ];
139
+ TypeRegistry.for(n0).registerError(InvalidTokenException, __InvalidTokenException);
140
+ export var PodIdentityAssociation = [3, n0, _PIA, 0, [_aA, _aI], [0, 0]];
141
+ export var ResourceNotFoundException = [
142
+ -3,
143
+ n0,
144
+ _RNFE,
145
+ {
146
+ [_e]: _c,
147
+ [_hE]: 404,
148
+ },
149
+ [_m],
150
+ [0],
151
+ ];
152
+ TypeRegistry.for(n0).registerError(ResourceNotFoundException, __ResourceNotFoundException);
153
+ export var ServiceUnavailableException = [
154
+ -3,
155
+ n0,
156
+ _SUE,
157
+ {
158
+ [_e]: _se,
159
+ [_hE]: 503,
160
+ },
161
+ [_m],
162
+ [0],
163
+ ];
164
+ TypeRegistry.for(n0).registerError(ServiceUnavailableException, __ServiceUnavailableException);
165
+ export var Subject = [3, n0, _S, 0, [_n, _sA], [0, 0]];
166
+ export var ThrottlingException = [
167
+ -3,
168
+ n0,
169
+ _TE,
170
+ {
171
+ [_e]: _c,
172
+ [_hE]: 429,
173
+ },
174
+ [_m],
175
+ [0],
176
+ ];
177
+ TypeRegistry.for(n0).registerError(ThrottlingException, __ThrottlingException);
178
+ export var EKSAuthServiceException = [-3, _sm, "EKSAuthServiceException", 0, [], []];
179
+ TypeRegistry.for(_sm).registerError(EKSAuthServiceException, __EKSAuthServiceException);
180
+ export var AssumeRoleForPodIdentity = [
181
+ 9,
182
+ n0,
183
+ _ARFPI,
184
+ {
185
+ [_h]: ["POST", "/clusters/{clusterName}/assume-role-for-pod-identity", 200],
186
+ },
187
+ () => AssumeRoleForPodIdentityRequest,
188
+ () => AssumeRoleForPodIdentityResponse,
189
+ ];
@@ -5,7 +5,7 @@ import { EndpointInputConfig, EndpointResolvedConfig } from "@smithy/middleware-
5
5
  import { RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry";
6
6
  import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http";
7
7
  import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@smithy/smithy-client";
8
- import { AwsCredentialIdentityProvider, BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
8
+ import { AwsCredentialIdentityProvider, BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, ClientProtocol, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, HttpRequest, HttpResponse, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
9
9
  import { HttpAuthSchemeInputConfig, HttpAuthSchemeResolvedConfig } from "./auth/httpAuthSchemeProvider";
10
10
  import { AssumeRoleForPodIdentityCommandInput, AssumeRoleForPodIdentityCommandOutput } from "./commands/AssumeRoleForPodIdentityCommand";
11
11
  import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, EndpointParameters } from "./endpoint/EndpointParameters";
@@ -142,6 +142,15 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
142
142
  * Optional extensions
143
143
  */
144
144
  extensions?: RuntimeExtension[];
145
+ /**
146
+ * The protocol controlling the message type (e.g. HTTP) and format (e.g. JSON)
147
+ * may be overridden. A default will always be set by the client.
148
+ * Available options depend on the service's supported protocols and will not be validated by
149
+ * the client.
150
+ * @alpha
151
+ *
152
+ */
153
+ protocol?: ClientProtocol<HttpRequest, HttpResponse>;
145
154
  /**
146
155
  * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
147
156
  */
@@ -259,15 +259,3 @@ export declare class ThrottlingException extends __BaseException {
259
259
  */
260
260
  constructor(opts: __ExceptionOptionType<ThrottlingException, __BaseException>);
261
261
  }
262
- /**
263
- * @internal
264
- */
265
- export declare const AssumeRoleForPodIdentityRequestFilterSensitiveLog: (obj: AssumeRoleForPodIdentityRequest) => any;
266
- /**
267
- * @internal
268
- */
269
- export declare const CredentialsFilterSensitiveLog: (obj: Credentials) => any;
270
- /**
271
- * @internal
272
- */
273
- export declare const AssumeRoleForPodIdentityResponseFilterSensitiveLog: (obj: AssumeRoleForPodIdentityResponse) => any;
@@ -29,6 +29,7 @@ export declare const getRuntimeConfig: (config: EKSAuthClientConfig) => {
29
29
  profile?: string;
30
30
  logger: import("@smithy/types").Logger;
31
31
  extensions: import("./runtimeExtensions").RuntimeExtension[];
32
+ protocol: import("@smithy/types").ClientProtocol<import("@smithy/types").HttpRequest, import("@smithy/types").HttpResponse>;
32
33
  customUserAgent?: string | import("@smithy/types").UserAgent;
33
34
  userAgentAppId?: string | undefined | import("@smithy/types").Provider<string | undefined>;
34
35
  retryStrategy?: import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2;
@@ -31,6 +31,7 @@ export declare const getRuntimeConfig: (config: EKSAuthClientConfig) => {
31
31
  profile?: string;
32
32
  logger: import("@smithy/types").Logger;
33
33
  extensions: import("./runtimeExtensions").RuntimeExtension[];
34
+ protocol: import("@smithy/types").ClientProtocol<import("@smithy/types").HttpRequest, import("@smithy/types").HttpResponse>;
34
35
  customUserAgent?: string | import("@smithy/types").UserAgent;
35
36
  retryStrategy?: import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2;
36
37
  endpoint?: ((string | import("@smithy/types").Endpoint | import("@smithy/types").Provider<import("@smithy/types").Endpoint> | import("@smithy/types").EndpointV2 | import("@smithy/types").Provider<import("@smithy/types").EndpointV2>) & (string | import("@smithy/types").Provider<string> | import("@smithy/types").Endpoint | import("@smithy/types").Provider<import("@smithy/types").Endpoint> | import("@smithy/types").EndpointV2 | import("@smithy/types").Provider<import("@smithy/types").EndpointV2>)) | undefined;
@@ -27,6 +27,7 @@ export declare const getRuntimeConfig: (config: EKSAuthClientConfig) => {
27
27
  retryMode: string | import("@smithy/types").Provider<string>;
28
28
  logger: import("@smithy/types").Logger;
29
29
  extensions: import("./runtimeExtensions").RuntimeExtension[];
30
+ protocol: import("@smithy/types").ClientProtocol<import("@smithy/types").HttpRequest, import("@smithy/types").HttpResponse>;
30
31
  defaultsMode: import("@smithy/smithy-client").DefaultsMode | import("@smithy/types").Provider<import("@smithy/smithy-client").DefaultsMode>;
31
32
  customUserAgent?: string | import("@smithy/types").UserAgent;
32
33
  userAgentAppId?: string | undefined | import("@smithy/types").Provider<string | undefined>;
@@ -14,6 +14,7 @@ export declare const getRuntimeConfig: (config: EKSAuthClientConfig) => {
14
14
  httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").EKSAuthHttpAuthSchemeProvider;
15
15
  httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
16
16
  logger: import("@smithy/types").Logger;
17
+ protocol: import("@smithy/types").ClientProtocol<import("@smithy/types").HttpRequest, import("@smithy/types").HttpResponse>;
17
18
  serviceId: string;
18
19
  urlParser: import("@smithy/types").UrlParser;
19
20
  utf8Decoder: import("@smithy/types").Decoder;
@@ -0,0 +1,19 @@
1
+ import { StaticErrorSchema, StaticOperationSchema, StaticSimpleSchema, StaticStructureSchema } from "@smithy/types";
2
+ export declare var JwtToken: StaticSimpleSchema;
3
+ export declare var AccessDeniedException: StaticErrorSchema;
4
+ export declare var AssumedRoleUser: StaticStructureSchema;
5
+ export declare var AssumeRoleForPodIdentityRequest: StaticStructureSchema;
6
+ export declare var AssumeRoleForPodIdentityResponse: StaticStructureSchema;
7
+ export declare var Credentials: StaticStructureSchema;
8
+ export declare var ExpiredTokenException: StaticErrorSchema;
9
+ export declare var InternalServerException: StaticErrorSchema;
10
+ export declare var InvalidParameterException: StaticErrorSchema;
11
+ export declare var InvalidRequestException: StaticErrorSchema;
12
+ export declare var InvalidTokenException: StaticErrorSchema;
13
+ export declare var PodIdentityAssociation: StaticStructureSchema;
14
+ export declare var ResourceNotFoundException: StaticErrorSchema;
15
+ export declare var ServiceUnavailableException: StaticErrorSchema;
16
+ export declare var Subject: StaticStructureSchema;
17
+ export declare var ThrottlingException: StaticErrorSchema;
18
+ export declare var EKSAuthServiceException: StaticErrorSchema;
19
+ export declare var AssumeRoleForPodIdentity: StaticOperationSchema;
@@ -30,10 +30,13 @@ import {
30
30
  BodyLengthCalculator as __BodyLengthCalculator,
31
31
  CheckOptionalClientConfig as __CheckOptionalClientConfig,
32
32
  ChecksumConstructor as __ChecksumConstructor,
33
+ ClientProtocol,
33
34
  Decoder as __Decoder,
34
35
  Encoder as __Encoder,
35
36
  HashConstructor as __HashConstructor,
36
37
  HttpHandlerOptions as __HttpHandlerOptions,
38
+ HttpRequest,
39
+ HttpResponse,
37
40
  Logger as __Logger,
38
41
  Provider as __Provider,
39
42
  Provider,
@@ -82,6 +85,7 @@ export interface ClientDefaults
82
85
  retryMode?: string | __Provider<string>;
83
86
  logger?: __Logger;
84
87
  extensions?: RuntimeExtension[];
88
+ protocol?: ClientProtocol<HttpRequest, HttpResponse>;
85
89
  defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>;
86
90
  }
87
91
  export type EKSAuthClientConfigType = Partial<
@@ -92,10 +92,3 @@ export declare class ThrottlingException extends __BaseException {
92
92
  opts: __ExceptionOptionType<ThrottlingException, __BaseException>
93
93
  );
94
94
  }
95
- export declare const AssumeRoleForPodIdentityRequestFilterSensitiveLog: (
96
- obj: AssumeRoleForPodIdentityRequest
97
- ) => any;
98
- export declare const CredentialsFilterSensitiveLog: (obj: Credentials) => any;
99
- export declare const AssumeRoleForPodIdentityResponseFilterSensitiveLog: (
100
- obj: AssumeRoleForPodIdentityResponse
101
- ) => any;
@@ -37,6 +37,10 @@ export declare const getRuntimeConfig: (config: EKSAuthClientConfig) => {
37
37
  profile?: string;
38
38
  logger: import("@smithy/types").Logger;
39
39
  extensions: import("./runtimeExtensions").RuntimeExtension[];
40
+ protocol: import("@smithy/types").ClientProtocol<
41
+ import("@smithy/types").HttpRequest,
42
+ import("@smithy/types").HttpResponse
43
+ >;
40
44
  customUserAgent?: string | import("@smithy/types").UserAgent;
41
45
  userAgentAppId?:
42
46
  | string
@@ -38,6 +38,10 @@ export declare const getRuntimeConfig: (config: EKSAuthClientConfig) => {
38
38
  profile?: string;
39
39
  logger: import("@smithy/types").Logger;
40
40
  extensions: import("./runtimeExtensions").RuntimeExtension[];
41
+ protocol: import("@smithy/types").ClientProtocol<
42
+ import("@smithy/types").HttpRequest,
43
+ import("@smithy/types").HttpResponse
44
+ >;
41
45
  customUserAgent?: string | import("@smithy/types").UserAgent;
42
46
  retryStrategy?:
43
47
  | import("@smithy/types").RetryStrategy
@@ -36,6 +36,10 @@ export declare const getRuntimeConfig: (config: EKSAuthClientConfig) => {
36
36
  retryMode: string | import("@smithy/types").Provider<string>;
37
37
  logger: import("@smithy/types").Logger;
38
38
  extensions: import("./runtimeExtensions").RuntimeExtension[];
39
+ protocol: import("@smithy/types").ClientProtocol<
40
+ import("@smithy/types").HttpRequest,
41
+ import("@smithy/types").HttpResponse
42
+ >;
39
43
  defaultsMode:
40
44
  | import("@smithy/smithy-client").DefaultsMode
41
45
  | import("@smithy/types").Provider<
@@ -14,6 +14,10 @@ export declare const getRuntimeConfig: (config: EKSAuthClientConfig) => {
14
14
  httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").EKSAuthHttpAuthSchemeProvider;
15
15
  httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
16
16
  logger: import("@smithy/types").Logger;
17
+ protocol: import("@smithy/types").ClientProtocol<
18
+ import("@smithy/types").HttpRequest,
19
+ import("@smithy/types").HttpResponse
20
+ >;
17
21
  serviceId: string;
18
22
  urlParser: import("@smithy/types").UrlParser;
19
23
  utf8Decoder: import("@smithy/types").Decoder;
@@ -0,0 +1,24 @@
1
+ import {
2
+ StaticErrorSchema,
3
+ StaticOperationSchema,
4
+ StaticSimpleSchema,
5
+ StaticStructureSchema,
6
+ } from "@smithy/types";
7
+ export declare var JwtToken: StaticSimpleSchema;
8
+ export declare var AccessDeniedException: StaticErrorSchema;
9
+ export declare var AssumedRoleUser: StaticStructureSchema;
10
+ export declare var AssumeRoleForPodIdentityRequest: StaticStructureSchema;
11
+ export declare var AssumeRoleForPodIdentityResponse: StaticStructureSchema;
12
+ export declare var Credentials: StaticStructureSchema;
13
+ export declare var ExpiredTokenException: StaticErrorSchema;
14
+ export declare var InternalServerException: StaticErrorSchema;
15
+ export declare var InvalidParameterException: StaticErrorSchema;
16
+ export declare var InvalidRequestException: StaticErrorSchema;
17
+ export declare var InvalidTokenException: StaticErrorSchema;
18
+ export declare var PodIdentityAssociation: StaticStructureSchema;
19
+ export declare var ResourceNotFoundException: StaticErrorSchema;
20
+ export declare var ServiceUnavailableException: StaticErrorSchema;
21
+ export declare var Subject: StaticStructureSchema;
22
+ export declare var ThrottlingException: StaticErrorSchema;
23
+ export declare var EKSAuthServiceException: StaticErrorSchema;
24
+ export declare var AssumeRoleForPodIdentity: StaticOperationSchema;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-eks-auth",
3
3
  "description": "AWS SDK for JavaScript Eks Auth Client for Node.js, Browser and React Native",
4
- "version": "3.928.0",
4
+ "version": "3.929.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-eks-auth",
@@ -21,7 +21,7 @@
21
21
  "@aws-crypto/sha256-browser": "5.2.0",
22
22
  "@aws-crypto/sha256-js": "5.2.0",
23
23
  "@aws-sdk/core": "3.928.0",
24
- "@aws-sdk/credential-provider-node": "3.928.0",
24
+ "@aws-sdk/credential-provider-node": "3.929.0",
25
25
  "@aws-sdk/middleware-host-header": "3.922.0",
26
26
  "@aws-sdk/middleware-logger": "3.922.0",
27
27
  "@aws-sdk/middleware-recursion-detection": "3.922.0",
@@ -1,213 +0,0 @@
1
- import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
2
- import { requestBuilder as rb } from "@smithy/core";
3
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
4
- import { EKSAuthServiceException as __BaseException } from "../models/EKSAuthServiceException";
5
- import { AccessDeniedException, ExpiredTokenException, InternalServerException, InvalidParameterException, InvalidRequestException, InvalidTokenException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, } from "../models/models_0";
6
- export const se_AssumeRoleForPodIdentityCommand = async (input, context) => {
7
- const b = rb(input, context);
8
- const headers = {
9
- "content-type": "application/json",
10
- };
11
- b.bp("/clusters/{clusterName}/assume-role-for-pod-identity");
12
- b.p("clusterName", () => input.clusterName, "{clusterName}", false);
13
- let body;
14
- body = JSON.stringify(take(input, {
15
- token: [],
16
- }));
17
- b.m("POST").h(headers).b(body);
18
- return b.build();
19
- };
20
- export const de_AssumeRoleForPodIdentityCommand = async (output, context) => {
21
- if (output.statusCode !== 200 && output.statusCode >= 300) {
22
- return de_CommandError(output, context);
23
- }
24
- const contents = map({
25
- $metadata: deserializeMetadata(output),
26
- });
27
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
28
- const doc = take(data, {
29
- assumedRoleUser: _json,
30
- audience: __expectString,
31
- credentials: (_) => de_Credentials(_, context),
32
- podIdentityAssociation: _json,
33
- subject: _json,
34
- });
35
- Object.assign(contents, doc);
36
- return contents;
37
- };
38
- const de_CommandError = async (output, context) => {
39
- const parsedOutput = {
40
- ...output,
41
- body: await parseErrorBody(output.body, context),
42
- };
43
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
44
- switch (errorCode) {
45
- case "AccessDeniedException":
46
- case "com.amazonaws.eksauth#AccessDeniedException":
47
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
48
- case "ExpiredTokenException":
49
- case "com.amazonaws.eksauth#ExpiredTokenException":
50
- throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
51
- case "InternalServerException":
52
- case "com.amazonaws.eksauth#InternalServerException":
53
- throw await de_InternalServerExceptionRes(parsedOutput, context);
54
- case "InvalidParameterException":
55
- case "com.amazonaws.eksauth#InvalidParameterException":
56
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
57
- case "InvalidRequestException":
58
- case "com.amazonaws.eksauth#InvalidRequestException":
59
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
60
- case "InvalidTokenException":
61
- case "com.amazonaws.eksauth#InvalidTokenException":
62
- throw await de_InvalidTokenExceptionRes(parsedOutput, context);
63
- case "ResourceNotFoundException":
64
- case "com.amazonaws.eksauth#ResourceNotFoundException":
65
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
66
- case "ServiceUnavailableException":
67
- case "com.amazonaws.eksauth#ServiceUnavailableException":
68
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
69
- case "ThrottlingException":
70
- case "com.amazonaws.eksauth#ThrottlingException":
71
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
72
- default:
73
- const parsedBody = parsedOutput.body;
74
- return throwDefaultError({
75
- output,
76
- parsedBody,
77
- errorCode,
78
- });
79
- }
80
- };
81
- const throwDefaultError = withBaseException(__BaseException);
82
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
83
- const contents = map({});
84
- const data = parsedOutput.body;
85
- const doc = take(data, {
86
- message: __expectString,
87
- });
88
- Object.assign(contents, doc);
89
- const exception = new AccessDeniedException({
90
- $metadata: deserializeMetadata(parsedOutput),
91
- ...contents,
92
- });
93
- return __decorateServiceException(exception, parsedOutput.body);
94
- };
95
- const de_ExpiredTokenExceptionRes = async (parsedOutput, context) => {
96
- const contents = map({});
97
- const data = parsedOutput.body;
98
- const doc = take(data, {
99
- message: __expectString,
100
- });
101
- Object.assign(contents, doc);
102
- const exception = new ExpiredTokenException({
103
- $metadata: deserializeMetadata(parsedOutput),
104
- ...contents,
105
- });
106
- return __decorateServiceException(exception, parsedOutput.body);
107
- };
108
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
109
- const contents = map({});
110
- const data = parsedOutput.body;
111
- const doc = take(data, {
112
- message: __expectString,
113
- });
114
- Object.assign(contents, doc);
115
- const exception = new InternalServerException({
116
- $metadata: deserializeMetadata(parsedOutput),
117
- ...contents,
118
- });
119
- return __decorateServiceException(exception, parsedOutput.body);
120
- };
121
- const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
122
- const contents = map({});
123
- const data = parsedOutput.body;
124
- const doc = take(data, {
125
- message: __expectString,
126
- });
127
- Object.assign(contents, doc);
128
- const exception = new InvalidParameterException({
129
- $metadata: deserializeMetadata(parsedOutput),
130
- ...contents,
131
- });
132
- return __decorateServiceException(exception, parsedOutput.body);
133
- };
134
- const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
135
- const contents = map({});
136
- const data = parsedOutput.body;
137
- const doc = take(data, {
138
- message: __expectString,
139
- });
140
- Object.assign(contents, doc);
141
- const exception = new InvalidRequestException({
142
- $metadata: deserializeMetadata(parsedOutput),
143
- ...contents,
144
- });
145
- return __decorateServiceException(exception, parsedOutput.body);
146
- };
147
- const de_InvalidTokenExceptionRes = async (parsedOutput, context) => {
148
- const contents = map({});
149
- const data = parsedOutput.body;
150
- const doc = take(data, {
151
- message: __expectString,
152
- });
153
- Object.assign(contents, doc);
154
- const exception = new InvalidTokenException({
155
- $metadata: deserializeMetadata(parsedOutput),
156
- ...contents,
157
- });
158
- return __decorateServiceException(exception, parsedOutput.body);
159
- };
160
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
161
- const contents = map({});
162
- const data = parsedOutput.body;
163
- const doc = take(data, {
164
- message: __expectString,
165
- });
166
- Object.assign(contents, doc);
167
- const exception = new ResourceNotFoundException({
168
- $metadata: deserializeMetadata(parsedOutput),
169
- ...contents,
170
- });
171
- return __decorateServiceException(exception, parsedOutput.body);
172
- };
173
- const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
174
- const contents = map({});
175
- const data = parsedOutput.body;
176
- const doc = take(data, {
177
- message: __expectString,
178
- });
179
- Object.assign(contents, doc);
180
- const exception = new ServiceUnavailableException({
181
- $metadata: deserializeMetadata(parsedOutput),
182
- ...contents,
183
- });
184
- return __decorateServiceException(exception, parsedOutput.body);
185
- };
186
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
187
- const contents = map({});
188
- const data = parsedOutput.body;
189
- const doc = take(data, {
190
- message: __expectString,
191
- });
192
- Object.assign(contents, doc);
193
- const exception = new ThrottlingException({
194
- $metadata: deserializeMetadata(parsedOutput),
195
- ...contents,
196
- });
197
- return __decorateServiceException(exception, parsedOutput.body);
198
- };
199
- const de_Credentials = (output, context) => {
200
- return take(output, {
201
- accessKeyId: __expectString,
202
- expiration: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
203
- secretAccessKey: __expectString,
204
- sessionToken: __expectString,
205
- });
206
- };
207
- const deserializeMetadata = (output) => ({
208
- httpStatusCode: output.statusCode,
209
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
210
- extendedRequestId: output.headers["x-amz-id-2"],
211
- cfId: output.headers["x-amz-cf-id"],
212
- });
213
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
@@ -1,11 +0,0 @@
1
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
2
- import { SerdeContext as __SerdeContext } from "@smithy/types";
3
- import { AssumeRoleForPodIdentityCommandInput, AssumeRoleForPodIdentityCommandOutput } from "../commands/AssumeRoleForPodIdentityCommand";
4
- /**
5
- * serializeAws_restJson1AssumeRoleForPodIdentityCommand
6
- */
7
- export declare const se_AssumeRoleForPodIdentityCommand: (input: AssumeRoleForPodIdentityCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
8
- /**
9
- * deserializeAws_restJson1AssumeRoleForPodIdentityCommand
10
- */
11
- export declare const de_AssumeRoleForPodIdentityCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<AssumeRoleForPodIdentityCommandOutput>;