@aws-sdk/client-pca-connector-scep 3.595.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 +305 -0
- package/dist-cjs/PcaConnectorScep.js +35 -0
- package/dist-cjs/PcaConnectorScepClient.js +56 -0
- package/dist-cjs/auth/httpAuthExtensionConfiguration.js +43 -0
- package/dist-cjs/auth/httpAuthSchemeProvider.js +47 -0
- package/dist-cjs/commands/CreateChallengeCommand.js +29 -0
- package/dist-cjs/commands/CreateConnectorCommand.js +28 -0
- package/dist-cjs/commands/DeleteChallengeCommand.js +28 -0
- package/dist-cjs/commands/DeleteConnectorCommand.js +28 -0
- package/dist-cjs/commands/GetChallengeMetadataCommand.js +28 -0
- package/dist-cjs/commands/GetChallengePasswordCommand.js +29 -0
- package/dist-cjs/commands/GetConnectorCommand.js +28 -0
- package/dist-cjs/commands/ListChallengeMetadataCommand.js +28 -0
- package/dist-cjs/commands/ListConnectorsCommand.js +28 -0
- package/dist-cjs/commands/ListTagsForResourceCommand.js +28 -0
- package/dist-cjs/commands/TagResourceCommand.js +28 -0
- package/dist-cjs/commands/UntagResourceCommand.js +28 -0
- package/dist-cjs/commands/index.js +15 -0
- package/dist-cjs/endpoint/EndpointParameters.js +18 -0
- package/dist-cjs/endpoint/endpointResolver.js +14 -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/PcaConnectorScepServiceException.js +12 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +177 -0
- package/dist-cjs/pagination/Interfaces.js +2 -0
- package/dist-cjs/pagination/ListChallengeMetadataPaginator.js +7 -0
- package/dist-cjs/pagination/ListConnectorsPaginator.js +7 -0
- package/dist-cjs/pagination/index.js +6 -0
- package/dist-cjs/protocols/Aws_restJson1.js +565 -0
- package/dist-cjs/runtimeConfig.browser.js +39 -0
- package/dist-cjs/runtimeConfig.js +49 -0
- package/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist-cjs/runtimeConfig.shared.js +34 -0
- package/dist-cjs/runtimeExtensions.js +25 -0
- package/dist-es/PcaConnectorScep.js +31 -0
- package/dist-es/PcaConnectorScepClient.js +52 -0
- package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/auth/httpAuthSchemeProvider.js +41 -0
- package/dist-es/commands/CreateChallengeCommand.js +25 -0
- package/dist-es/commands/CreateConnectorCommand.js +24 -0
- package/dist-es/commands/DeleteChallengeCommand.js +24 -0
- package/dist-es/commands/DeleteConnectorCommand.js +24 -0
- package/dist-es/commands/GetChallengeMetadataCommand.js +24 -0
- package/dist-es/commands/GetChallengePasswordCommand.js +25 -0
- package/dist-es/commands/GetConnectorCommand.js +24 -0
- package/dist-es/commands/ListChallengeMetadataCommand.js +24 -0
- package/dist-es/commands/ListConnectorsCommand.js +24 -0
- package/dist-es/commands/ListTagsForResourceCommand.js +24 -0
- package/dist-es/commands/TagResourceCommand.js +24 -0
- package/dist-es/commands/UntagResourceCommand.js +24 -0
- package/dist-es/commands/index.js +12 -0
- package/dist-es/endpoint/EndpointParameters.js +14 -0
- package/dist-es/endpoint/endpointResolver.js +10 -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/PcaConnectorScepServiceException.js +8 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +163 -0
- package/dist-es/pagination/Interfaces.js +1 -0
- package/dist-es/pagination/ListChallengeMetadataPaginator.js +4 -0
- package/dist-es/pagination/ListConnectorsPaginator.js +4 -0
- package/dist-es/pagination/index.js +3 -0
- package/dist-es/protocols/Aws_restJson1.js +538 -0
- package/dist-es/runtimeConfig.browser.js +34 -0
- package/dist-es/runtimeConfig.js +44 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +30 -0
- package/dist-es/runtimeExtensions.js +21 -0
- package/dist-types/PcaConnectorScep.d.ts +99 -0
- package/dist-types/PcaConnectorScepClient.d.ts +187 -0
- package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
- package/dist-types/commands/CreateChallengeCommand.d.ts +101 -0
- package/dist-types/commands/CreateConnectorCommand.d.ts +97 -0
- package/dist-types/commands/DeleteChallengeCommand.d.ts +82 -0
- package/dist-types/commands/DeleteConnectorCommand.d.ts +82 -0
- package/dist-types/commands/GetChallengeMetadataCommand.d.ts +85 -0
- package/dist-types/commands/GetChallengePasswordCommand.d.ts +80 -0
- package/dist-types/commands/GetConnectorCommand.d.ts +100 -0
- package/dist-types/commands/ListChallengeMetadataCommand.d.ts +90 -0
- package/dist-types/commands/ListConnectorsCommand.d.ts +101 -0
- package/dist-types/commands/ListTagsForResourceCommand.d.ts +86 -0
- package/dist-types/commands/TagResourceCommand.d.ts +81 -0
- package/dist-types/commands/UntagResourceCommand.d.ts +81 -0
- package/dist-types/commands/index.d.ts +12 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +40 -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 +9 -0
- package/dist-types/index.d.ts +18 -0
- package/dist-types/models/PcaConnectorScepServiceException.d.ts +14 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +763 -0
- package/dist-types/pagination/Interfaces.d.ts +8 -0
- package/dist-types/pagination/ListChallengeMetadataPaginator.d.ts +7 -0
- package/dist-types/pagination/ListConnectorsPaginator.d.ts +7 -0
- package/dist-types/pagination/index.d.ts +3 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +110 -0
- package/dist-types/runtimeConfig.browser.d.ts +45 -0
- package/dist-types/runtimeConfig.d.ts +45 -0
- package/dist-types/runtimeConfig.native.d.ts +44 -0
- package/dist-types/runtimeConfig.shared.d.ts +21 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/dist-types/ts3.4/PcaConnectorScep.d.ts +212 -0
- package/dist-types/ts3.4/PcaConnectorScepClient.d.ts +195 -0
- package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +44 -0
- package/dist-types/ts3.4/commands/CreateChallengeCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/CreateConnectorCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/DeleteChallengeCommand.d.ts +34 -0
- package/dist-types/ts3.4/commands/DeleteConnectorCommand.d.ts +34 -0
- package/dist-types/ts3.4/commands/GetChallengeMetadataCommand.d.ts +40 -0
- package/dist-types/ts3.4/commands/GetChallengePasswordCommand.d.ts +40 -0
- package/dist-types/ts3.4/commands/GetConnectorCommand.d.ts +36 -0
- package/dist-types/ts3.4/commands/ListChallengeMetadataCommand.d.ts +40 -0
- package/dist-types/ts3.4/commands/ListConnectorsCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +40 -0
- package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +34 -0
- package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +34 -0
- package/dist-types/ts3.4/commands/index.d.ts +12 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +51 -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 +9 -0
- package/dist-types/ts3.4/index.d.ts +9 -0
- package/dist-types/ts3.4/models/PcaConnectorScepServiceException.d.ts +9 -0
- package/dist-types/ts3.4/models/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +257 -0
- package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
- package/dist-types/ts3.4/pagination/ListChallengeMetadataPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/ListConnectorsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +3 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +149 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +87 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +91 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +81 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +23 -0
- package/dist-types/ts3.4/runtimeExtensions.d.ts +13 -0
- package/package.json +103 -0
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
import { awsExpectUnion as __expectUnion, 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 { v4 as generateIdempotencyToken } from "uuid";
|
|
5
|
+
import { AccessDeniedException, BadRequestException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
6
|
+
import { PcaConnectorScepServiceException as __BaseException } from "../models/PcaConnectorScepServiceException";
|
|
7
|
+
export const se_CreateChallengeCommand = async (input, context) => {
|
|
8
|
+
const b = rb(input, context);
|
|
9
|
+
const headers = {
|
|
10
|
+
"content-type": "application/json",
|
|
11
|
+
};
|
|
12
|
+
b.bp("/challenges");
|
|
13
|
+
let body;
|
|
14
|
+
body = JSON.stringify(take(input, {
|
|
15
|
+
ClientToken: [true, (_) => _ ?? generateIdempotencyToken()],
|
|
16
|
+
ConnectorArn: [],
|
|
17
|
+
Tags: (_) => _json(_),
|
|
18
|
+
}));
|
|
19
|
+
b.m("POST").h(headers).b(body);
|
|
20
|
+
return b.build();
|
|
21
|
+
};
|
|
22
|
+
export const se_CreateConnectorCommand = async (input, context) => {
|
|
23
|
+
const b = rb(input, context);
|
|
24
|
+
const headers = {
|
|
25
|
+
"content-type": "application/json",
|
|
26
|
+
};
|
|
27
|
+
b.bp("/connectors");
|
|
28
|
+
let body;
|
|
29
|
+
body = JSON.stringify(take(input, {
|
|
30
|
+
CertificateAuthorityArn: [],
|
|
31
|
+
ClientToken: [true, (_) => _ ?? generateIdempotencyToken()],
|
|
32
|
+
MobileDeviceManagement: (_) => _json(_),
|
|
33
|
+
Tags: (_) => _json(_),
|
|
34
|
+
}));
|
|
35
|
+
b.m("POST").h(headers).b(body);
|
|
36
|
+
return b.build();
|
|
37
|
+
};
|
|
38
|
+
export const se_DeleteChallengeCommand = async (input, context) => {
|
|
39
|
+
const b = rb(input, context);
|
|
40
|
+
const headers = {};
|
|
41
|
+
b.bp("/challenges/{ChallengeArn}");
|
|
42
|
+
b.p("ChallengeArn", () => input.ChallengeArn, "{ChallengeArn}", false);
|
|
43
|
+
let body;
|
|
44
|
+
b.m("DELETE").h(headers).b(body);
|
|
45
|
+
return b.build();
|
|
46
|
+
};
|
|
47
|
+
export const se_DeleteConnectorCommand = async (input, context) => {
|
|
48
|
+
const b = rb(input, context);
|
|
49
|
+
const headers = {};
|
|
50
|
+
b.bp("/connectors/{ConnectorArn}");
|
|
51
|
+
b.p("ConnectorArn", () => input.ConnectorArn, "{ConnectorArn}", false);
|
|
52
|
+
let body;
|
|
53
|
+
b.m("DELETE").h(headers).b(body);
|
|
54
|
+
return b.build();
|
|
55
|
+
};
|
|
56
|
+
export const se_GetChallengeMetadataCommand = async (input, context) => {
|
|
57
|
+
const b = rb(input, context);
|
|
58
|
+
const headers = {};
|
|
59
|
+
b.bp("/challengeMetadata/{ChallengeArn}");
|
|
60
|
+
b.p("ChallengeArn", () => input.ChallengeArn, "{ChallengeArn}", false);
|
|
61
|
+
let body;
|
|
62
|
+
b.m("GET").h(headers).b(body);
|
|
63
|
+
return b.build();
|
|
64
|
+
};
|
|
65
|
+
export const se_GetChallengePasswordCommand = async (input, context) => {
|
|
66
|
+
const b = rb(input, context);
|
|
67
|
+
const headers = {};
|
|
68
|
+
b.bp("/challengePasswords/{ChallengeArn}");
|
|
69
|
+
b.p("ChallengeArn", () => input.ChallengeArn, "{ChallengeArn}", false);
|
|
70
|
+
let body;
|
|
71
|
+
b.m("GET").h(headers).b(body);
|
|
72
|
+
return b.build();
|
|
73
|
+
};
|
|
74
|
+
export const se_GetConnectorCommand = async (input, context) => {
|
|
75
|
+
const b = rb(input, context);
|
|
76
|
+
const headers = {};
|
|
77
|
+
b.bp("/connectors/{ConnectorArn}");
|
|
78
|
+
b.p("ConnectorArn", () => input.ConnectorArn, "{ConnectorArn}", false);
|
|
79
|
+
let body;
|
|
80
|
+
b.m("GET").h(headers).b(body);
|
|
81
|
+
return b.build();
|
|
82
|
+
};
|
|
83
|
+
export const se_ListChallengeMetadataCommand = async (input, context) => {
|
|
84
|
+
const b = rb(input, context);
|
|
85
|
+
const headers = {};
|
|
86
|
+
b.bp("/challengeMetadata");
|
|
87
|
+
const query = map({
|
|
88
|
+
[_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
|
|
89
|
+
[_NT]: [, input[_NT]],
|
|
90
|
+
[_CA]: [, __expectNonNull(input[_CA], `ConnectorArn`)],
|
|
91
|
+
});
|
|
92
|
+
let body;
|
|
93
|
+
b.m("GET").h(headers).q(query).b(body);
|
|
94
|
+
return b.build();
|
|
95
|
+
};
|
|
96
|
+
export const se_ListConnectorsCommand = async (input, context) => {
|
|
97
|
+
const b = rb(input, context);
|
|
98
|
+
const headers = {};
|
|
99
|
+
b.bp("/connectors");
|
|
100
|
+
const query = map({
|
|
101
|
+
[_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
|
|
102
|
+
[_NT]: [, input[_NT]],
|
|
103
|
+
});
|
|
104
|
+
let body;
|
|
105
|
+
b.m("GET").h(headers).q(query).b(body);
|
|
106
|
+
return b.build();
|
|
107
|
+
};
|
|
108
|
+
export const se_ListTagsForResourceCommand = async (input, context) => {
|
|
109
|
+
const b = rb(input, context);
|
|
110
|
+
const headers = {};
|
|
111
|
+
b.bp("/tags/{ResourceArn}");
|
|
112
|
+
b.p("ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
|
|
113
|
+
let body;
|
|
114
|
+
b.m("GET").h(headers).b(body);
|
|
115
|
+
return b.build();
|
|
116
|
+
};
|
|
117
|
+
export const se_TagResourceCommand = async (input, context) => {
|
|
118
|
+
const b = rb(input, context);
|
|
119
|
+
const headers = {
|
|
120
|
+
"content-type": "application/json",
|
|
121
|
+
};
|
|
122
|
+
b.bp("/tags/{ResourceArn}");
|
|
123
|
+
b.p("ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
|
|
124
|
+
let body;
|
|
125
|
+
body = JSON.stringify(take(input, {
|
|
126
|
+
Tags: (_) => _json(_),
|
|
127
|
+
}));
|
|
128
|
+
b.m("POST").h(headers).b(body);
|
|
129
|
+
return b.build();
|
|
130
|
+
};
|
|
131
|
+
export const se_UntagResourceCommand = async (input, context) => {
|
|
132
|
+
const b = rb(input, context);
|
|
133
|
+
const headers = {};
|
|
134
|
+
b.bp("/tags/{ResourceArn}");
|
|
135
|
+
b.p("ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
|
|
136
|
+
const query = map({
|
|
137
|
+
[_tK]: [
|
|
138
|
+
__expectNonNull(input.TagKeys, `TagKeys`) != null,
|
|
139
|
+
() => (input[_TK] || []).map((_entry) => _entry),
|
|
140
|
+
],
|
|
141
|
+
});
|
|
142
|
+
let body;
|
|
143
|
+
b.m("DELETE").h(headers).q(query).b(body);
|
|
144
|
+
return b.build();
|
|
145
|
+
};
|
|
146
|
+
export const de_CreateChallengeCommand = async (output, context) => {
|
|
147
|
+
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
148
|
+
return de_CommandError(output, context);
|
|
149
|
+
}
|
|
150
|
+
const contents = map({
|
|
151
|
+
$metadata: deserializeMetadata(output),
|
|
152
|
+
});
|
|
153
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
154
|
+
const doc = take(data, {
|
|
155
|
+
Challenge: (_) => de_Challenge(_, context),
|
|
156
|
+
});
|
|
157
|
+
Object.assign(contents, doc);
|
|
158
|
+
return contents;
|
|
159
|
+
};
|
|
160
|
+
export const de_CreateConnectorCommand = async (output, context) => {
|
|
161
|
+
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
162
|
+
return de_CommandError(output, context);
|
|
163
|
+
}
|
|
164
|
+
const contents = map({
|
|
165
|
+
$metadata: deserializeMetadata(output),
|
|
166
|
+
});
|
|
167
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
168
|
+
const doc = take(data, {
|
|
169
|
+
ConnectorArn: __expectString,
|
|
170
|
+
});
|
|
171
|
+
Object.assign(contents, doc);
|
|
172
|
+
return contents;
|
|
173
|
+
};
|
|
174
|
+
export const de_DeleteChallengeCommand = async (output, context) => {
|
|
175
|
+
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
176
|
+
return de_CommandError(output, context);
|
|
177
|
+
}
|
|
178
|
+
const contents = map({
|
|
179
|
+
$metadata: deserializeMetadata(output),
|
|
180
|
+
});
|
|
181
|
+
await collectBody(output.body, context);
|
|
182
|
+
return contents;
|
|
183
|
+
};
|
|
184
|
+
export const de_DeleteConnectorCommand = async (output, context) => {
|
|
185
|
+
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
186
|
+
return de_CommandError(output, context);
|
|
187
|
+
}
|
|
188
|
+
const contents = map({
|
|
189
|
+
$metadata: deserializeMetadata(output),
|
|
190
|
+
});
|
|
191
|
+
await collectBody(output.body, context);
|
|
192
|
+
return contents;
|
|
193
|
+
};
|
|
194
|
+
export const de_GetChallengeMetadataCommand = async (output, context) => {
|
|
195
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
196
|
+
return de_CommandError(output, context);
|
|
197
|
+
}
|
|
198
|
+
const contents = map({
|
|
199
|
+
$metadata: deserializeMetadata(output),
|
|
200
|
+
});
|
|
201
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
202
|
+
const doc = take(data, {
|
|
203
|
+
ChallengeMetadata: (_) => de_ChallengeMetadata(_, context),
|
|
204
|
+
});
|
|
205
|
+
Object.assign(contents, doc);
|
|
206
|
+
return contents;
|
|
207
|
+
};
|
|
208
|
+
export const de_GetChallengePasswordCommand = async (output, context) => {
|
|
209
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
210
|
+
return de_CommandError(output, context);
|
|
211
|
+
}
|
|
212
|
+
const contents = map({
|
|
213
|
+
$metadata: deserializeMetadata(output),
|
|
214
|
+
});
|
|
215
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
216
|
+
const doc = take(data, {
|
|
217
|
+
Password: __expectString,
|
|
218
|
+
});
|
|
219
|
+
Object.assign(contents, doc);
|
|
220
|
+
return contents;
|
|
221
|
+
};
|
|
222
|
+
export const de_GetConnectorCommand = async (output, context) => {
|
|
223
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
224
|
+
return de_CommandError(output, context);
|
|
225
|
+
}
|
|
226
|
+
const contents = map({
|
|
227
|
+
$metadata: deserializeMetadata(output),
|
|
228
|
+
});
|
|
229
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
230
|
+
const doc = take(data, {
|
|
231
|
+
Connector: (_) => de_Connector(_, context),
|
|
232
|
+
});
|
|
233
|
+
Object.assign(contents, doc);
|
|
234
|
+
return contents;
|
|
235
|
+
};
|
|
236
|
+
export const de_ListChallengeMetadataCommand = async (output, context) => {
|
|
237
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
238
|
+
return de_CommandError(output, context);
|
|
239
|
+
}
|
|
240
|
+
const contents = map({
|
|
241
|
+
$metadata: deserializeMetadata(output),
|
|
242
|
+
});
|
|
243
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
244
|
+
const doc = take(data, {
|
|
245
|
+
Challenges: (_) => de_ChallengeMetadataList(_, context),
|
|
246
|
+
NextToken: __expectString,
|
|
247
|
+
});
|
|
248
|
+
Object.assign(contents, doc);
|
|
249
|
+
return contents;
|
|
250
|
+
};
|
|
251
|
+
export const de_ListConnectorsCommand = async (output, context) => {
|
|
252
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
253
|
+
return de_CommandError(output, context);
|
|
254
|
+
}
|
|
255
|
+
const contents = map({
|
|
256
|
+
$metadata: deserializeMetadata(output),
|
|
257
|
+
});
|
|
258
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
259
|
+
const doc = take(data, {
|
|
260
|
+
Connectors: (_) => de_ConnectorList(_, context),
|
|
261
|
+
NextToken: __expectString,
|
|
262
|
+
});
|
|
263
|
+
Object.assign(contents, doc);
|
|
264
|
+
return contents;
|
|
265
|
+
};
|
|
266
|
+
export const de_ListTagsForResourceCommand = async (output, context) => {
|
|
267
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
268
|
+
return de_CommandError(output, context);
|
|
269
|
+
}
|
|
270
|
+
const contents = map({
|
|
271
|
+
$metadata: deserializeMetadata(output),
|
|
272
|
+
});
|
|
273
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
274
|
+
const doc = take(data, {
|
|
275
|
+
Tags: _json,
|
|
276
|
+
});
|
|
277
|
+
Object.assign(contents, doc);
|
|
278
|
+
return contents;
|
|
279
|
+
};
|
|
280
|
+
export const de_TagResourceCommand = async (output, context) => {
|
|
281
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
282
|
+
return de_CommandError(output, context);
|
|
283
|
+
}
|
|
284
|
+
const contents = map({
|
|
285
|
+
$metadata: deserializeMetadata(output),
|
|
286
|
+
});
|
|
287
|
+
await collectBody(output.body, context);
|
|
288
|
+
return contents;
|
|
289
|
+
};
|
|
290
|
+
export const de_UntagResourceCommand = async (output, context) => {
|
|
291
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
292
|
+
return de_CommandError(output, context);
|
|
293
|
+
}
|
|
294
|
+
const contents = map({
|
|
295
|
+
$metadata: deserializeMetadata(output),
|
|
296
|
+
});
|
|
297
|
+
await collectBody(output.body, context);
|
|
298
|
+
return contents;
|
|
299
|
+
};
|
|
300
|
+
const de_CommandError = async (output, context) => {
|
|
301
|
+
const parsedOutput = {
|
|
302
|
+
...output,
|
|
303
|
+
body: await parseErrorBody(output.body, context),
|
|
304
|
+
};
|
|
305
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
306
|
+
switch (errorCode) {
|
|
307
|
+
case "AccessDeniedException":
|
|
308
|
+
case "com.amazonaws.pcaconnectorscep#AccessDeniedException":
|
|
309
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
310
|
+
case "BadRequestException":
|
|
311
|
+
case "com.amazonaws.pcaconnectorscep#BadRequestException":
|
|
312
|
+
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
313
|
+
case "ConflictException":
|
|
314
|
+
case "com.amazonaws.pcaconnectorscep#ConflictException":
|
|
315
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
316
|
+
case "InternalServerException":
|
|
317
|
+
case "com.amazonaws.pcaconnectorscep#InternalServerException":
|
|
318
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
319
|
+
case "ResourceNotFoundException":
|
|
320
|
+
case "com.amazonaws.pcaconnectorscep#ResourceNotFoundException":
|
|
321
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
322
|
+
case "ServiceQuotaExceededException":
|
|
323
|
+
case "com.amazonaws.pcaconnectorscep#ServiceQuotaExceededException":
|
|
324
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
325
|
+
case "ThrottlingException":
|
|
326
|
+
case "com.amazonaws.pcaconnectorscep#ThrottlingException":
|
|
327
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
328
|
+
case "ValidationException":
|
|
329
|
+
case "com.amazonaws.pcaconnectorscep#ValidationException":
|
|
330
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
331
|
+
default:
|
|
332
|
+
const parsedBody = parsedOutput.body;
|
|
333
|
+
return throwDefaultError({
|
|
334
|
+
output,
|
|
335
|
+
parsedBody,
|
|
336
|
+
errorCode,
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
const throwDefaultError = withBaseException(__BaseException);
|
|
341
|
+
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
342
|
+
const contents = map({});
|
|
343
|
+
const data = parsedOutput.body;
|
|
344
|
+
const doc = take(data, {
|
|
345
|
+
Message: __expectString,
|
|
346
|
+
});
|
|
347
|
+
Object.assign(contents, doc);
|
|
348
|
+
const exception = new AccessDeniedException({
|
|
349
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
350
|
+
...contents,
|
|
351
|
+
});
|
|
352
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
353
|
+
};
|
|
354
|
+
const de_BadRequestExceptionRes = async (parsedOutput, context) => {
|
|
355
|
+
const contents = map({});
|
|
356
|
+
const data = parsedOutput.body;
|
|
357
|
+
const doc = take(data, {
|
|
358
|
+
Message: __expectString,
|
|
359
|
+
});
|
|
360
|
+
Object.assign(contents, doc);
|
|
361
|
+
const exception = new BadRequestException({
|
|
362
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
363
|
+
...contents,
|
|
364
|
+
});
|
|
365
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
366
|
+
};
|
|
367
|
+
const de_ConflictExceptionRes = async (parsedOutput, context) => {
|
|
368
|
+
const contents = map({});
|
|
369
|
+
const data = parsedOutput.body;
|
|
370
|
+
const doc = take(data, {
|
|
371
|
+
Message: __expectString,
|
|
372
|
+
ResourceId: __expectString,
|
|
373
|
+
ResourceType: __expectString,
|
|
374
|
+
});
|
|
375
|
+
Object.assign(contents, doc);
|
|
376
|
+
const exception = new ConflictException({
|
|
377
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
378
|
+
...contents,
|
|
379
|
+
});
|
|
380
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
381
|
+
};
|
|
382
|
+
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
383
|
+
const contents = map({});
|
|
384
|
+
const data = parsedOutput.body;
|
|
385
|
+
const doc = take(data, {
|
|
386
|
+
Message: __expectString,
|
|
387
|
+
});
|
|
388
|
+
Object.assign(contents, doc);
|
|
389
|
+
const exception = new InternalServerException({
|
|
390
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
391
|
+
...contents,
|
|
392
|
+
});
|
|
393
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
394
|
+
};
|
|
395
|
+
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
396
|
+
const contents = map({});
|
|
397
|
+
const data = parsedOutput.body;
|
|
398
|
+
const doc = take(data, {
|
|
399
|
+
Message: __expectString,
|
|
400
|
+
ResourceId: __expectString,
|
|
401
|
+
ResourceType: __expectString,
|
|
402
|
+
});
|
|
403
|
+
Object.assign(contents, doc);
|
|
404
|
+
const exception = new ResourceNotFoundException({
|
|
405
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
406
|
+
...contents,
|
|
407
|
+
});
|
|
408
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
409
|
+
};
|
|
410
|
+
const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
|
|
411
|
+
const contents = map({});
|
|
412
|
+
const data = parsedOutput.body;
|
|
413
|
+
const doc = take(data, {
|
|
414
|
+
Message: __expectString,
|
|
415
|
+
QuotaCode: __expectString,
|
|
416
|
+
ResourceType: __expectString,
|
|
417
|
+
ServiceCode: __expectString,
|
|
418
|
+
});
|
|
419
|
+
Object.assign(contents, doc);
|
|
420
|
+
const exception = new ServiceQuotaExceededException({
|
|
421
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
422
|
+
...contents,
|
|
423
|
+
});
|
|
424
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
425
|
+
};
|
|
426
|
+
const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
|
|
427
|
+
const contents = map({});
|
|
428
|
+
const data = parsedOutput.body;
|
|
429
|
+
const doc = take(data, {
|
|
430
|
+
Message: __expectString,
|
|
431
|
+
});
|
|
432
|
+
Object.assign(contents, doc);
|
|
433
|
+
const exception = new ThrottlingException({
|
|
434
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
435
|
+
...contents,
|
|
436
|
+
});
|
|
437
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
438
|
+
};
|
|
439
|
+
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
440
|
+
const contents = map({});
|
|
441
|
+
const data = parsedOutput.body;
|
|
442
|
+
const doc = take(data, {
|
|
443
|
+
Message: __expectString,
|
|
444
|
+
Reason: __expectString,
|
|
445
|
+
});
|
|
446
|
+
Object.assign(contents, doc);
|
|
447
|
+
const exception = new ValidationException({
|
|
448
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
449
|
+
...contents,
|
|
450
|
+
});
|
|
451
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
452
|
+
};
|
|
453
|
+
const de_Challenge = (output, context) => {
|
|
454
|
+
return take(output, {
|
|
455
|
+
Arn: __expectString,
|
|
456
|
+
ConnectorArn: __expectString,
|
|
457
|
+
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
458
|
+
Password: __expectString,
|
|
459
|
+
UpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
460
|
+
});
|
|
461
|
+
};
|
|
462
|
+
const de_ChallengeMetadata = (output, context) => {
|
|
463
|
+
return take(output, {
|
|
464
|
+
Arn: __expectString,
|
|
465
|
+
ConnectorArn: __expectString,
|
|
466
|
+
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
467
|
+
UpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
468
|
+
});
|
|
469
|
+
};
|
|
470
|
+
const de_ChallengeMetadataList = (output, context) => {
|
|
471
|
+
const retVal = (output || [])
|
|
472
|
+
.filter((e) => e != null)
|
|
473
|
+
.map((entry) => {
|
|
474
|
+
return de_ChallengeMetadataSummary(entry, context);
|
|
475
|
+
});
|
|
476
|
+
return retVal;
|
|
477
|
+
};
|
|
478
|
+
const de_ChallengeMetadataSummary = (output, context) => {
|
|
479
|
+
return take(output, {
|
|
480
|
+
Arn: __expectString,
|
|
481
|
+
ConnectorArn: __expectString,
|
|
482
|
+
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
483
|
+
UpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
484
|
+
});
|
|
485
|
+
};
|
|
486
|
+
const de_Connector = (output, context) => {
|
|
487
|
+
return take(output, {
|
|
488
|
+
Arn: __expectString,
|
|
489
|
+
CertificateAuthorityArn: __expectString,
|
|
490
|
+
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
491
|
+
Endpoint: __expectString,
|
|
492
|
+
MobileDeviceManagement: (_) => _json(__expectUnion(_)),
|
|
493
|
+
OpenIdConfiguration: _json,
|
|
494
|
+
Status: __expectString,
|
|
495
|
+
StatusReason: __expectString,
|
|
496
|
+
Type: __expectString,
|
|
497
|
+
UpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
498
|
+
});
|
|
499
|
+
};
|
|
500
|
+
const de_ConnectorList = (output, context) => {
|
|
501
|
+
const retVal = (output || [])
|
|
502
|
+
.filter((e) => e != null)
|
|
503
|
+
.map((entry) => {
|
|
504
|
+
return de_ConnectorSummary(entry, context);
|
|
505
|
+
});
|
|
506
|
+
return retVal;
|
|
507
|
+
};
|
|
508
|
+
const de_ConnectorSummary = (output, context) => {
|
|
509
|
+
return take(output, {
|
|
510
|
+
Arn: __expectString,
|
|
511
|
+
CertificateAuthorityArn: __expectString,
|
|
512
|
+
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
513
|
+
Endpoint: __expectString,
|
|
514
|
+
MobileDeviceManagement: (_) => _json(__expectUnion(_)),
|
|
515
|
+
OpenIdConfiguration: _json,
|
|
516
|
+
Status: __expectString,
|
|
517
|
+
StatusReason: __expectString,
|
|
518
|
+
Type: __expectString,
|
|
519
|
+
UpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
520
|
+
});
|
|
521
|
+
};
|
|
522
|
+
const deserializeMetadata = (output) => ({
|
|
523
|
+
httpStatusCode: output.statusCode,
|
|
524
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
525
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
526
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
527
|
+
});
|
|
528
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
529
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
530
|
+
value !== null &&
|
|
531
|
+
value !== "" &&
|
|
532
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
533
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
534
|
+
const _CA = "ConnectorArn";
|
|
535
|
+
const _MR = "MaxResults";
|
|
536
|
+
const _NT = "NextToken";
|
|
537
|
+
const _TK = "TagKeys";
|
|
538
|
+
const _tK = "tagKeys";
|
|
@@ -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: RequestHandler.create(config?.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,44 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
|
|
3
|
+
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
|
|
4
|
+
import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
|
|
5
|
+
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";
|
|
6
|
+
import { Hash } from "@smithy/hash-node";
|
|
7
|
+
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
|
|
8
|
+
import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
|
|
9
|
+
import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
|
|
10
|
+
import { calculateBodyLength } from "@smithy/util-body-length-node";
|
|
11
|
+
import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
12
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
13
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
14
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
|
|
15
|
+
import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client";
|
|
16
|
+
export const getRuntimeConfig = (config) => {
|
|
17
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
18
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
19
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
20
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
21
|
+
awsCheckVersion(process.version);
|
|
22
|
+
return {
|
|
23
|
+
...clientSharedValues,
|
|
24
|
+
...config,
|
|
25
|
+
runtime: "node",
|
|
26
|
+
defaultsMode,
|
|
27
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
28
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
|
|
29
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
30
|
+
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
31
|
+
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
32
|
+
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
|
|
33
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
34
|
+
retryMode: config?.retryMode ??
|
|
35
|
+
loadNodeConfig({
|
|
36
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
37
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
38
|
+
}),
|
|
39
|
+
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
40
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
41
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
|
|
42
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -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,30 @@
|
|
|
1
|
+
import { AwsSdkSigV4Signer } from "@aws-sdk/core";
|
|
2
|
+
import { NoOpLogger } from "@smithy/smithy-client";
|
|
3
|
+
import { parseUrl } from "@smithy/url-parser";
|
|
4
|
+
import { fromBase64, toBase64 } from "@smithy/util-base64";
|
|
5
|
+
import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
|
|
6
|
+
import { defaultPcaConnectorScepHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider";
|
|
7
|
+
import { defaultEndpointResolver } from "./endpoint/endpointResolver";
|
|
8
|
+
export const getRuntimeConfig = (config) => {
|
|
9
|
+
return {
|
|
10
|
+
apiVersion: "2018-05-10",
|
|
11
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
12
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
13
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
14
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
15
|
+
extensions: config?.extensions ?? [],
|
|
16
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultPcaConnectorScepHttpAuthSchemeProvider,
|
|
17
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
18
|
+
{
|
|
19
|
+
schemeId: "aws.auth#sigv4",
|
|
20
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
21
|
+
signer: new AwsSdkSigV4Signer(),
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
logger: config?.logger ?? new NoOpLogger(),
|
|
25
|
+
serviceId: config?.serviceId ?? "Pca Connector Scep",
|
|
26
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
27
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
28
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration";
|
|
5
|
+
const asPartial = (t) => t;
|
|
6
|
+
export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
7
|
+
const extensionConfiguration = {
|
|
8
|
+
...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
|
|
9
|
+
...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
|
|
10
|
+
...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
|
|
11
|
+
...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)),
|
|
12
|
+
};
|
|
13
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
14
|
+
return {
|
|
15
|
+
...runtimeConfig,
|
|
16
|
+
...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
|
|
17
|
+
...resolveDefaultRuntimeConfig(extensionConfiguration),
|
|
18
|
+
...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
|
|
19
|
+
...resolveHttpAuthRuntimeConfig(extensionConfiguration),
|
|
20
|
+
};
|
|
21
|
+
};
|