@aws-sdk/client-eks-auth 3.458.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.
- package/LICENSE +201 -0
- package/README.md +214 -0
- package/dist-cjs/EKSAuth.js +13 -0
- package/dist-cjs/EKSAuthClient.js +43 -0
- package/dist-cjs/commands/AssumeRoleForPodIdentityCommand.js +51 -0
- package/dist-cjs/commands/index.js +4 -0
- package/dist-cjs/endpoint/EndpointParameters.js +11 -0
- package/dist-cjs/endpoint/endpointResolver.js +12 -0
- package/dist-cjs/endpoint/ruleset.js +7 -0
- package/dist-cjs/extensionConfiguration.js +2 -0
- package/dist-cjs/index.js +11 -0
- package/dist-cjs/models/EKSAuthServiceException.js +12 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +136 -0
- package/dist-cjs/protocols/Aws_restJson1.js +270 -0
- package/dist-cjs/runtimeConfig.browser.js +39 -0
- package/dist-cjs/runtimeConfig.js +50 -0
- package/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist-cjs/runtimeConfig.shared.js +24 -0
- package/dist-cjs/runtimeExtensions.js +22 -0
- package/dist-es/EKSAuth.js +9 -0
- package/dist-es/EKSAuthClient.js +39 -0
- package/dist-es/commands/AssumeRoleForPodIdentityCommand.js +47 -0
- package/dist-es/commands/index.js +1 -0
- package/dist-es/endpoint/EndpointParameters.js +7 -0
- package/dist-es/endpoint/endpointResolver.js +8 -0
- package/dist-es/endpoint/ruleset.js +4 -0
- package/dist-es/extensionConfiguration.js +1 -0
- package/dist-es/index.js +6 -0
- package/dist-es/models/EKSAuthServiceException.js +8 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +121 -0
- package/dist-es/protocols/Aws_restJson1.js +265 -0
- package/dist-es/runtimeConfig.browser.js +34 -0
- package/dist-es/runtimeConfig.js +45 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +20 -0
- package/dist-es/runtimeExtensions.js +18 -0
- package/dist-types/EKSAuth.d.ts +18 -0
- package/dist-types/EKSAuthClient.d.ts +171 -0
- package/dist-types/commands/AssumeRoleForPodIdentityCommand.d.ts +128 -0
- package/dist-types/commands/index.d.ts +1 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +20 -0
- package/dist-types/endpoint/endpointResolver.d.ts +5 -0
- package/dist-types/endpoint/ruleset.d.ts +2 -0
- package/dist-types/extensionConfiguration.d.ts +8 -0
- package/dist-types/index.d.ts +15 -0
- package/dist-types/models/EKSAuthServiceException.d.ts +13 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +273 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +11 -0
- package/dist-types/runtimeConfig.browser.d.ts +46 -0
- package/dist-types/runtimeConfig.d.ts +46 -0
- package/dist-types/runtimeConfig.native.d.ts +45 -0
- package/dist-types/runtimeConfig.shared.d.ts +19 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/dist-types/ts3.4/EKSAuth.d.ts +22 -0
- package/dist-types/ts3.4/EKSAuthClient.d.ts +122 -0
- package/dist-types/ts3.4/commands/AssumeRoleForPodIdentityCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/index.d.ts +1 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +31 -0
- package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/extensionConfiguration.d.ts +7 -0
- package/dist-types/ts3.4/index.d.ts +9 -0
- package/dist-types/ts3.4/models/EKSAuthServiceException.d.ts +8 -0
- package/dist-types/ts3.4/models/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +101 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +17 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +97 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +97 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +88 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +19 -0
- package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
- package/package.json +102 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { resolveEndpoint } from "@smithy/util-endpoints";
|
|
2
|
+
import { ruleSet } from "./ruleset";
|
|
3
|
+
export const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
4
|
+
return resolveEndpoint(ruleSet, {
|
|
5
|
+
endpointParams: endpointParams,
|
|
6
|
+
logger: context.logger,
|
|
7
|
+
});
|
|
8
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const r = "argv", s = "ref";
|
|
2
|
+
const a = false, b = true, c = "isSet", d = "booleanEquals", e = "error", f = "endpoint", g = "tree", h = "PartitionResult", i = "getAttr", j = { "required": false, "type": "String" }, k = { [s]: "Endpoint" }, l = {}, m = { [s]: h }, n = { [e]: "FIPS is enabled but this partition does not support FIPS", "type": e }, o = [{ "fn": d, [r]: [{ [s]: "UseFIPS" }, true] }], p = [{ [s]: "Region" }], q = [{ "fn": d, [r]: [{ "fn": i, [r]: [m, "supportsFIPS"] }, true] }];
|
|
3
|
+
const _data = { version: "1.0", parameters: { Region: j, UseFIPS: { required: b, default: a, type: "Boolean" }, Endpoint: j }, rules: [{ conditions: [{ fn: c, [r]: [k] }], rules: [{ conditions: o, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: e }, { endpoint: { url: k, properties: l, headers: l }, type: f }], type: g }, { conditions: [{ fn: c, [r]: p }], rules: [{ conditions: [{ fn: "aws.partition", [r]: p, assign: h }], rules: [{ conditions: [{ fn: d, [r]: [b, { fn: i, [r]: [m, "supportsDualStack"] }] }], rules: [{ conditions: o, rules: [{ conditions: q, rules: [{ endpoint: { url: "https://eks-auth-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: l, headers: l }, type: f }], type: g }, n], type: g }, { endpoint: { url: "https://eks-auth.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: l, headers: l }, type: f }], type: g }, { conditions: o, rules: [{ conditions: q, rules: [{ endpoint: { url: "https://eks-auth-fips.{Region}.{PartitionResult#dnsSuffix}", properties: l, headers: l }, type: f }], type: g }, n], type: g }, { endpoint: { url: "https://eks-auth.{Region}.{PartitionResult#dnsSuffix}", properties: l, headers: l }, type: f }], type: g }], type: g }, { error: "Invalid Configuration: Missing Region", type: e }] };
|
|
4
|
+
export const ruleSet = _data;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist-es/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ServiceException as __ServiceException, } from "@smithy/smithy-client";
|
|
2
|
+
export { __ServiceException };
|
|
3
|
+
export class EKSAuthServiceException extends __ServiceException {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
Object.setPrototypeOf(this, EKSAuthServiceException.prototype);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./models_0";
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { SENSITIVE_STRING } from "@smithy/smithy-client";
|
|
2
|
+
import { EKSAuthServiceException as __BaseException } from "./EKSAuthServiceException";
|
|
3
|
+
export class AccessDeniedException extends __BaseException {
|
|
4
|
+
constructor(opts) {
|
|
5
|
+
super({
|
|
6
|
+
name: "AccessDeniedException",
|
|
7
|
+
$fault: "client",
|
|
8
|
+
...opts,
|
|
9
|
+
});
|
|
10
|
+
this.name = "AccessDeniedException";
|
|
11
|
+
this.$fault = "client";
|
|
12
|
+
Object.setPrototypeOf(this, AccessDeniedException.prototype);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export class ExpiredTokenException extends __BaseException {
|
|
16
|
+
constructor(opts) {
|
|
17
|
+
super({
|
|
18
|
+
name: "ExpiredTokenException",
|
|
19
|
+
$fault: "client",
|
|
20
|
+
...opts,
|
|
21
|
+
});
|
|
22
|
+
this.name = "ExpiredTokenException";
|
|
23
|
+
this.$fault = "client";
|
|
24
|
+
Object.setPrototypeOf(this, ExpiredTokenException.prototype);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export class InternalServerException extends __BaseException {
|
|
28
|
+
constructor(opts) {
|
|
29
|
+
super({
|
|
30
|
+
name: "InternalServerException",
|
|
31
|
+
$fault: "server",
|
|
32
|
+
...opts,
|
|
33
|
+
});
|
|
34
|
+
this.name = "InternalServerException";
|
|
35
|
+
this.$fault = "server";
|
|
36
|
+
Object.setPrototypeOf(this, InternalServerException.prototype);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export class InvalidParameterException extends __BaseException {
|
|
40
|
+
constructor(opts) {
|
|
41
|
+
super({
|
|
42
|
+
name: "InvalidParameterException",
|
|
43
|
+
$fault: "client",
|
|
44
|
+
...opts,
|
|
45
|
+
});
|
|
46
|
+
this.name = "InvalidParameterException";
|
|
47
|
+
this.$fault = "client";
|
|
48
|
+
Object.setPrototypeOf(this, InvalidParameterException.prototype);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export class InvalidRequestException extends __BaseException {
|
|
52
|
+
constructor(opts) {
|
|
53
|
+
super({
|
|
54
|
+
name: "InvalidRequestException",
|
|
55
|
+
$fault: "client",
|
|
56
|
+
...opts,
|
|
57
|
+
});
|
|
58
|
+
this.name = "InvalidRequestException";
|
|
59
|
+
this.$fault = "client";
|
|
60
|
+
Object.setPrototypeOf(this, InvalidRequestException.prototype);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export class InvalidTokenException extends __BaseException {
|
|
64
|
+
constructor(opts) {
|
|
65
|
+
super({
|
|
66
|
+
name: "InvalidTokenException",
|
|
67
|
+
$fault: "client",
|
|
68
|
+
...opts,
|
|
69
|
+
});
|
|
70
|
+
this.name = "InvalidTokenException";
|
|
71
|
+
this.$fault = "client";
|
|
72
|
+
Object.setPrototypeOf(this, InvalidTokenException.prototype);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
export class ResourceNotFoundException extends __BaseException {
|
|
76
|
+
constructor(opts) {
|
|
77
|
+
super({
|
|
78
|
+
name: "ResourceNotFoundException",
|
|
79
|
+
$fault: "client",
|
|
80
|
+
...opts,
|
|
81
|
+
});
|
|
82
|
+
this.name = "ResourceNotFoundException";
|
|
83
|
+
this.$fault = "client";
|
|
84
|
+
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
export class ServiceUnavailableException extends __BaseException {
|
|
88
|
+
constructor(opts) {
|
|
89
|
+
super({
|
|
90
|
+
name: "ServiceUnavailableException",
|
|
91
|
+
$fault: "server",
|
|
92
|
+
...opts,
|
|
93
|
+
});
|
|
94
|
+
this.name = "ServiceUnavailableException";
|
|
95
|
+
this.$fault = "server";
|
|
96
|
+
Object.setPrototypeOf(this, ServiceUnavailableException.prototype);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
export class ThrottlingException extends __BaseException {
|
|
100
|
+
constructor(opts) {
|
|
101
|
+
super({
|
|
102
|
+
name: "ThrottlingException",
|
|
103
|
+
$fault: "client",
|
|
104
|
+
...opts,
|
|
105
|
+
});
|
|
106
|
+
this.name = "ThrottlingException";
|
|
107
|
+
this.$fault = "client";
|
|
108
|
+
Object.setPrototypeOf(this, ThrottlingException.prototype);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
export const AssumeRoleForPodIdentityRequestFilterSensitiveLog = (obj) => ({
|
|
112
|
+
...obj,
|
|
113
|
+
...(obj.token && { token: SENSITIVE_STRING }),
|
|
114
|
+
});
|
|
115
|
+
export const CredentialsFilterSensitiveLog = (obj) => ({
|
|
116
|
+
...obj,
|
|
117
|
+
});
|
|
118
|
+
export const AssumeRoleForPodIdentityResponseFilterSensitiveLog = (obj) => ({
|
|
119
|
+
...obj,
|
|
120
|
+
...(obj.credentials && { credentials: SENSITIVE_STRING }),
|
|
121
|
+
});
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
|
|
2
|
+
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, take, withBaseException, } from "@smithy/smithy-client";
|
|
3
|
+
import { EKSAuthServiceException as __BaseException } from "../models/EKSAuthServiceException";
|
|
4
|
+
import { AccessDeniedException, ExpiredTokenException, InternalServerException, InvalidParameterException, InvalidRequestException, InvalidTokenException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, } from "../models/models_0";
|
|
5
|
+
export const se_AssumeRoleForPodIdentityCommand = async (input, context) => {
|
|
6
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
7
|
+
const headers = {
|
|
8
|
+
"content-type": "application/json",
|
|
9
|
+
};
|
|
10
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
11
|
+
"/clusters/{clusterName}/assume-role-for-pod-identity";
|
|
12
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "clusterName", () => input.clusterName, "{clusterName}", false);
|
|
13
|
+
let body;
|
|
14
|
+
body = JSON.stringify(take(input, {
|
|
15
|
+
token: [],
|
|
16
|
+
}));
|
|
17
|
+
return new __HttpRequest({
|
|
18
|
+
protocol,
|
|
19
|
+
hostname,
|
|
20
|
+
port,
|
|
21
|
+
method: "POST",
|
|
22
|
+
headers,
|
|
23
|
+
path: resolvedPath,
|
|
24
|
+
body,
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
export const de_AssumeRoleForPodIdentityCommand = async (output, context) => {
|
|
28
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
29
|
+
return de_AssumeRoleForPodIdentityCommandError(output, context);
|
|
30
|
+
}
|
|
31
|
+
const contents = map({
|
|
32
|
+
$metadata: deserializeMetadata(output),
|
|
33
|
+
});
|
|
34
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
35
|
+
const doc = take(data, {
|
|
36
|
+
assumedRoleUser: _json,
|
|
37
|
+
audience: __expectString,
|
|
38
|
+
credentials: (_) => de_Credentials(_, context),
|
|
39
|
+
podIdentityAssociation: _json,
|
|
40
|
+
subject: _json,
|
|
41
|
+
});
|
|
42
|
+
Object.assign(contents, doc);
|
|
43
|
+
return contents;
|
|
44
|
+
};
|
|
45
|
+
const de_AssumeRoleForPodIdentityCommandError = async (output, context) => {
|
|
46
|
+
const parsedOutput = {
|
|
47
|
+
...output,
|
|
48
|
+
body: await parseErrorBody(output.body, context),
|
|
49
|
+
};
|
|
50
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
51
|
+
switch (errorCode) {
|
|
52
|
+
case "AccessDeniedException":
|
|
53
|
+
case "com.amazonaws.eksauth#AccessDeniedException":
|
|
54
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
55
|
+
case "ExpiredTokenException":
|
|
56
|
+
case "com.amazonaws.eksauth#ExpiredTokenException":
|
|
57
|
+
throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
|
|
58
|
+
case "InternalServerException":
|
|
59
|
+
case "com.amazonaws.eksauth#InternalServerException":
|
|
60
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
61
|
+
case "InvalidParameterException":
|
|
62
|
+
case "com.amazonaws.eksauth#InvalidParameterException":
|
|
63
|
+
throw await de_InvalidParameterExceptionRes(parsedOutput, context);
|
|
64
|
+
case "InvalidRequestException":
|
|
65
|
+
case "com.amazonaws.eksauth#InvalidRequestException":
|
|
66
|
+
throw await de_InvalidRequestExceptionRes(parsedOutput, context);
|
|
67
|
+
case "InvalidTokenException":
|
|
68
|
+
case "com.amazonaws.eksauth#InvalidTokenException":
|
|
69
|
+
throw await de_InvalidTokenExceptionRes(parsedOutput, context);
|
|
70
|
+
case "ResourceNotFoundException":
|
|
71
|
+
case "com.amazonaws.eksauth#ResourceNotFoundException":
|
|
72
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
73
|
+
case "ServiceUnavailableException":
|
|
74
|
+
case "com.amazonaws.eksauth#ServiceUnavailableException":
|
|
75
|
+
throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
76
|
+
case "ThrottlingException":
|
|
77
|
+
case "com.amazonaws.eksauth#ThrottlingException":
|
|
78
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
79
|
+
default:
|
|
80
|
+
const parsedBody = parsedOutput.body;
|
|
81
|
+
return throwDefaultError({
|
|
82
|
+
output,
|
|
83
|
+
parsedBody,
|
|
84
|
+
errorCode,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const throwDefaultError = withBaseException(__BaseException);
|
|
89
|
+
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
90
|
+
const contents = map({});
|
|
91
|
+
const data = parsedOutput.body;
|
|
92
|
+
const doc = take(data, {
|
|
93
|
+
message: __expectString,
|
|
94
|
+
});
|
|
95
|
+
Object.assign(contents, doc);
|
|
96
|
+
const exception = new AccessDeniedException({
|
|
97
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
98
|
+
...contents,
|
|
99
|
+
});
|
|
100
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
101
|
+
};
|
|
102
|
+
const de_ExpiredTokenExceptionRes = async (parsedOutput, context) => {
|
|
103
|
+
const contents = map({});
|
|
104
|
+
const data = parsedOutput.body;
|
|
105
|
+
const doc = take(data, {
|
|
106
|
+
message: __expectString,
|
|
107
|
+
});
|
|
108
|
+
Object.assign(contents, doc);
|
|
109
|
+
const exception = new ExpiredTokenException({
|
|
110
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
111
|
+
...contents,
|
|
112
|
+
});
|
|
113
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
114
|
+
};
|
|
115
|
+
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
116
|
+
const contents = map({});
|
|
117
|
+
const data = parsedOutput.body;
|
|
118
|
+
const doc = take(data, {
|
|
119
|
+
message: __expectString,
|
|
120
|
+
});
|
|
121
|
+
Object.assign(contents, doc);
|
|
122
|
+
const exception = new InternalServerException({
|
|
123
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
124
|
+
...contents,
|
|
125
|
+
});
|
|
126
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
127
|
+
};
|
|
128
|
+
const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
|
|
129
|
+
const contents = map({});
|
|
130
|
+
const data = parsedOutput.body;
|
|
131
|
+
const doc = take(data, {
|
|
132
|
+
message: __expectString,
|
|
133
|
+
});
|
|
134
|
+
Object.assign(contents, doc);
|
|
135
|
+
const exception = new InvalidParameterException({
|
|
136
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
137
|
+
...contents,
|
|
138
|
+
});
|
|
139
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
140
|
+
};
|
|
141
|
+
const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
|
|
142
|
+
const contents = map({});
|
|
143
|
+
const data = parsedOutput.body;
|
|
144
|
+
const doc = take(data, {
|
|
145
|
+
message: __expectString,
|
|
146
|
+
});
|
|
147
|
+
Object.assign(contents, doc);
|
|
148
|
+
const exception = new InvalidRequestException({
|
|
149
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
150
|
+
...contents,
|
|
151
|
+
});
|
|
152
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
153
|
+
};
|
|
154
|
+
const de_InvalidTokenExceptionRes = async (parsedOutput, context) => {
|
|
155
|
+
const contents = map({});
|
|
156
|
+
const data = parsedOutput.body;
|
|
157
|
+
const doc = take(data, {
|
|
158
|
+
message: __expectString,
|
|
159
|
+
});
|
|
160
|
+
Object.assign(contents, doc);
|
|
161
|
+
const exception = new InvalidTokenException({
|
|
162
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
163
|
+
...contents,
|
|
164
|
+
});
|
|
165
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
166
|
+
};
|
|
167
|
+
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
168
|
+
const contents = map({});
|
|
169
|
+
const data = parsedOutput.body;
|
|
170
|
+
const doc = take(data, {
|
|
171
|
+
message: __expectString,
|
|
172
|
+
});
|
|
173
|
+
Object.assign(contents, doc);
|
|
174
|
+
const exception = new ResourceNotFoundException({
|
|
175
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
176
|
+
...contents,
|
|
177
|
+
});
|
|
178
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
179
|
+
};
|
|
180
|
+
const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
|
|
181
|
+
const contents = map({});
|
|
182
|
+
const data = parsedOutput.body;
|
|
183
|
+
const doc = take(data, {
|
|
184
|
+
message: __expectString,
|
|
185
|
+
});
|
|
186
|
+
Object.assign(contents, doc);
|
|
187
|
+
const exception = new ServiceUnavailableException({
|
|
188
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
189
|
+
...contents,
|
|
190
|
+
});
|
|
191
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
192
|
+
};
|
|
193
|
+
const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
|
|
194
|
+
const contents = map({});
|
|
195
|
+
const data = parsedOutput.body;
|
|
196
|
+
const doc = take(data, {
|
|
197
|
+
message: __expectString,
|
|
198
|
+
});
|
|
199
|
+
Object.assign(contents, doc);
|
|
200
|
+
const exception = new ThrottlingException({
|
|
201
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
202
|
+
...contents,
|
|
203
|
+
});
|
|
204
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
205
|
+
};
|
|
206
|
+
const de_Credentials = (output, context) => {
|
|
207
|
+
return take(output, {
|
|
208
|
+
accessKeyId: __expectString,
|
|
209
|
+
expiration: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
210
|
+
secretAccessKey: __expectString,
|
|
211
|
+
sessionToken: __expectString,
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
const deserializeMetadata = (output) => ({
|
|
215
|
+
httpStatusCode: output.statusCode,
|
|
216
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
217
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
218
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
219
|
+
});
|
|
220
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
221
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
222
|
+
value !== null &&
|
|
223
|
+
value !== "" &&
|
|
224
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
225
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
226
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
227
|
+
if (encoded.length) {
|
|
228
|
+
return JSON.parse(encoded);
|
|
229
|
+
}
|
|
230
|
+
return {};
|
|
231
|
+
});
|
|
232
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
233
|
+
const value = await parseBody(errorBody, context);
|
|
234
|
+
value.message = value.message ?? value.Message;
|
|
235
|
+
return value;
|
|
236
|
+
};
|
|
237
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
238
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
239
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
240
|
+
let cleanValue = rawValue;
|
|
241
|
+
if (typeof cleanValue === "number") {
|
|
242
|
+
cleanValue = cleanValue.toString();
|
|
243
|
+
}
|
|
244
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
245
|
+
cleanValue = cleanValue.split(",")[0];
|
|
246
|
+
}
|
|
247
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
248
|
+
cleanValue = cleanValue.split(":")[0];
|
|
249
|
+
}
|
|
250
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
251
|
+
cleanValue = cleanValue.split("#")[1];
|
|
252
|
+
}
|
|
253
|
+
return cleanValue;
|
|
254
|
+
};
|
|
255
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
256
|
+
if (headerKey !== undefined) {
|
|
257
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
258
|
+
}
|
|
259
|
+
if (data.code !== undefined) {
|
|
260
|
+
return sanitizeErrorCode(data.code);
|
|
261
|
+
}
|
|
262
|
+
if (data["__type"] !== undefined) {
|
|
263
|
+
return sanitizeErrorCode(data["__type"]);
|
|
264
|
+
}
|
|
265
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
3
|
+
import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
|
|
4
|
+
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver";
|
|
5
|
+
import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
|
|
6
|
+
import { invalidProvider } from "@smithy/invalid-dependency";
|
|
7
|
+
import { calculateBodyLength } from "@smithy/util-body-length-browser";
|
|
8
|
+
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
9
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
10
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
11
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser";
|
|
12
|
+
export const getRuntimeConfig = (config) => {
|
|
13
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
14
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
15
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
16
|
+
return {
|
|
17
|
+
...clientSharedValues,
|
|
18
|
+
...config,
|
|
19
|
+
runtime: "browser",
|
|
20
|
+
defaultsMode,
|
|
21
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
22
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
|
23
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
24
|
+
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
25
|
+
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
26
|
+
region: config?.region ?? invalidProvider("Region is missing"),
|
|
27
|
+
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
|
|
28
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
|
29
|
+
sha256: config?.sha256 ?? Sha256,
|
|
30
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
31
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
32
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
|
|
3
|
+
import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
|
|
4
|
+
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
|
|
5
|
+
import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
|
|
6
|
+
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver";
|
|
7
|
+
import { Hash } from "@smithy/hash-node";
|
|
8
|
+
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
|
|
9
|
+
import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
|
|
10
|
+
import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
|
|
11
|
+
import { calculateBodyLength } from "@smithy/util-body-length-node";
|
|
12
|
+
import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
13
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
14
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
15
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
|
|
16
|
+
import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client";
|
|
17
|
+
export const getRuntimeConfig = (config) => {
|
|
18
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
19
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
20
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
21
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
22
|
+
awsCheckVersion(process.version);
|
|
23
|
+
return {
|
|
24
|
+
...clientSharedValues,
|
|
25
|
+
...config,
|
|
26
|
+
runtime: "node",
|
|
27
|
+
defaultsMode,
|
|
28
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
29
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
|
|
30
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
31
|
+
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
32
|
+
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
33
|
+
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
|
|
34
|
+
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
|
|
35
|
+
retryMode: config?.retryMode ??
|
|
36
|
+
loadNodeConfig({
|
|
37
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
38
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
39
|
+
}),
|
|
40
|
+
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
41
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
42
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
|
|
43
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Sha256 } from "@aws-crypto/sha256-js";
|
|
2
|
+
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
|
|
3
|
+
export const getRuntimeConfig = (config) => {
|
|
4
|
+
const browserDefaults = getBrowserRuntimeConfig(config);
|
|
5
|
+
return {
|
|
6
|
+
...browserDefaults,
|
|
7
|
+
...config,
|
|
8
|
+
runtime: "react-native",
|
|
9
|
+
sha256: config?.sha256 ?? Sha256,
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NoOpLogger } from "@smithy/smithy-client";
|
|
2
|
+
import { parseUrl } from "@smithy/url-parser";
|
|
3
|
+
import { fromBase64, toBase64 } from "@smithy/util-base64";
|
|
4
|
+
import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
|
|
5
|
+
import { defaultEndpointResolver } from "./endpoint/endpointResolver";
|
|
6
|
+
export const getRuntimeConfig = (config) => {
|
|
7
|
+
return {
|
|
8
|
+
apiVersion: "2023-11-26",
|
|
9
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
10
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
11
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
12
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
13
|
+
extensions: config?.extensions ?? [],
|
|
14
|
+
logger: config?.logger ?? new NoOpLogger(),
|
|
15
|
+
serviceId: config?.serviceId ?? "EKS Auth",
|
|
16
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
17
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
18
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "@aws-sdk/region-config-resolver";
|
|
2
|
+
import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http";
|
|
3
|
+
import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client";
|
|
4
|
+
const asPartial = (t) => t;
|
|
5
|
+
export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
6
|
+
const extensionConfiguration = {
|
|
7
|
+
...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
|
|
8
|
+
...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
|
|
9
|
+
...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
|
|
10
|
+
};
|
|
11
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
12
|
+
return {
|
|
13
|
+
...runtimeConfig,
|
|
14
|
+
...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
|
|
15
|
+
...resolveDefaultRuntimeConfig(extensionConfiguration),
|
|
16
|
+
...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
|
|
2
|
+
import { AssumeRoleForPodIdentityCommandInput, AssumeRoleForPodIdentityCommandOutput } from "./commands/AssumeRoleForPodIdentityCommand";
|
|
3
|
+
import { EKSAuthClient } from "./EKSAuthClient";
|
|
4
|
+
export interface EKSAuth {
|
|
5
|
+
/**
|
|
6
|
+
* @see {@link AssumeRoleForPodIdentityCommand}
|
|
7
|
+
*/
|
|
8
|
+
assumeRoleForPodIdentity(args: AssumeRoleForPodIdentityCommandInput, options?: __HttpHandlerOptions): Promise<AssumeRoleForPodIdentityCommandOutput>;
|
|
9
|
+
assumeRoleForPodIdentity(args: AssumeRoleForPodIdentityCommandInput, cb: (err: any, data?: AssumeRoleForPodIdentityCommandOutput) => void): void;
|
|
10
|
+
assumeRoleForPodIdentity(args: AssumeRoleForPodIdentityCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: AssumeRoleForPodIdentityCommandOutput) => void): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
* <p>The Amazon EKS Auth API and the <code>AssumeRoleForPodIdentity</code> action are only
|
|
15
|
+
* used by the EKS Pod Identity Agent.</p>
|
|
16
|
+
*/
|
|
17
|
+
export declare class EKSAuth extends EKSAuthClient implements EKSAuth {
|
|
18
|
+
}
|