@karmaniverous/get-dotenv 7.0.6 → 7.0.8
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/dist/chunks/{createCli-BkHLeYXL.mjs → createCli-CUPiFVdZ.mjs} +27 -10
- package/dist/chunks/index-CNXekCQC.mjs +96 -0
- package/dist/chunks/{index-Dd6S1nZ-.mjs → index-DnG3N6yj.mjs} +6 -6
- package/dist/chunks/{loader-V1vbmtyw.mjs → loader-C3DtD6HB.mjs} +4 -2
- package/dist/chunks/{readDotenvCascade-Dgx4SC1p.mjs → readDotenvCascade-CfFPgLCp.mjs} +52 -21
- package/dist/chunks/{readMergedOptions-CraAnYdB.mjs → readMergedOptions-BT1C87_u.mjs} +53 -13
- package/dist/chunks/{resolveCliOptions-BMBkWDYJ.mjs → resolveCliOptions-BbfouWSK.mjs} +1 -1
- package/dist/chunks/{spawnEnv-CKgnHGpr.mjs → spawnEnv-DvisqPiU.mjs} +28 -3
- package/dist/chunks/{types-BthqmnDr.mjs → types-BkQxnyZK.mjs} +1 -1
- package/dist/cli.d.ts +29 -8
- package/dist/cli.mjs +11 -15
- package/dist/cliHost.d.ts +29 -8
- package/dist/cliHost.mjs +6 -6
- package/dist/config.d.ts +1 -1
- package/dist/config.mjs +1 -1
- package/dist/env-overlay.d.ts +13 -9
- package/dist/env-overlay.mjs +2 -2
- package/dist/getdotenv.cli.mjs +11 -15
- package/dist/index.d.ts +30 -9
- package/dist/index.mjs +31 -23
- package/dist/plugins-aws.d.ts +12 -1
- package/dist/plugins-aws.mjs +8 -7
- package/dist/plugins-batch.d.ts +28 -1
- package/dist/plugins-batch.mjs +202 -68
- package/dist/plugins-cmd.d.ts +12 -1
- package/dist/plugins-cmd.mjs +6 -6
- package/dist/plugins-init.d.ts +12 -1
- package/dist/plugins-init.mjs +3 -3
- package/dist/plugins.d.ts +14 -1
- package/dist/plugins.mjs +10 -14
- package/package.json +40 -40
- package/schema/getdotenv.config.schema.json +207 -0
- package/dist/chunks/AwsRestJsonProtocol-4m7HHwvS.mjs +0 -1026
- package/dist/chunks/externalDataInterceptor-DyDNbv-D.mjs +0 -19
- package/dist/chunks/getSSOTokenFromFile-CkYcEieD.mjs +0 -22
- package/dist/chunks/index-B35hOhgq.mjs +0 -669
- package/dist/chunks/index-B3fM_U6F.mjs +0 -349
- package/dist/chunks/index-B_yJRqty.mjs +0 -541
- package/dist/chunks/index-BuxEK_Z4.mjs +0 -12529
- package/dist/chunks/index-C58EanKv.mjs +0 -383
- package/dist/chunks/index-CjWZ4uNg.mjs +0 -103
- package/dist/chunks/index-CsI5JuIM.mjs +0 -188
- package/dist/chunks/index-D-a5vkZL.mjs +0 -82
- package/dist/chunks/index-D6iVe1wh.mjs +0 -946
- package/dist/chunks/index-Dl8qC51H.mjs +0 -290
- package/dist/chunks/index-FT37CtcF.mjs +0 -31
- package/dist/chunks/index-QkVZTs6l.mjs +0 -519
- package/dist/chunks/loadSso-DF7GLUZf.mjs +0 -488
- package/dist/chunks/package-DbbYaehr.mjs +0 -5
- package/dist/chunks/parseKnownFiles-BZNrX_JE.mjs +0 -23
- package/dist/chunks/sdk-stream-mixin-BL49AxZx.mjs +0 -307
|
@@ -1,488 +0,0 @@
|
|
|
1
|
-
import { aE as resolveAwsSdkSigV4Config, au as normalizeProvider, ap as getSmithyContext, B as BinaryDecisionDiagram, l as EndpointCache, $ as decideEndpoint, Q as awsEndpointFunctions, Z as customEndpointFunctions, M as ServiceException, T as TypeRegistry, aT as toUtf8, a8 as fromUtf8, aA as parseUrl, x as NoOpLogger, b as AwsSdkSigV4Signer, w as NoAuthSigner, aR as toBase64, a6 as fromBase64, a1 as emitWarningIfUnsupportedVersion, aG as resolveDefaultsModeConfig, a2 as emitWarningIfUnsupportedVersion$1, aQ as streamCollector, V as calculateBodyLength, ar as loadConfig, N as NODE_APP_ID_CONFIG_OPTIONS, v as NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, u as NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, H as Hash, s as NODE_RETRY_MODE_CONFIG_OPTIONS, D as DEFAULT_RETRY_MODE, y as NodeHttpHandler, q as NODE_REGION_CONFIG_FILE_OPTIONS, r as NODE_REGION_CONFIG_OPTIONS, p as NODE_MAX_ATTEMPT_CONFIG_OPTIONS, Y as createDefaultUserAgentProvider, o as NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, as as loadConfigsForDefaultMode, aa as getAwsRegionExtensionConfiguration, ad as getDefaultExtensionConfiguration, ai as getHttpHandlerExtensionConfiguration, aC as resolveAwsRegionExtensionConfiguration, aF as resolveDefaultRuntimeConfig, aJ as resolveHttpHandlerRuntimeConfig, c as Client, aN as resolveUserAgentConfig, aM as resolveRetryConfig, aL as resolveRegionConfig, aH as resolveEndpointConfig, ao as getSchemaSerdePlugin, aq as getUserAgentPlugin, an as getRetryPlugin, ac as getContentLengthPlugin, ag as getHostHeaderPlugin, ak as getLoggerPlugin, am as getRecursionDetectionPlugin, ah as getHttpAuthSchemeEndpointRuleSetPlugin, f as DefaultIdentityProviderConfig, aj as getHttpSigningPlugin, aI as resolveHostHeaderConfig, d as Command, ae as getEndpointPlugin } from './index-BuxEK_Z4.mjs';
|
|
2
|
-
import { p as packageInfo } from './package-DbbYaehr.mjs';
|
|
3
|
-
import 'node:crypto';
|
|
4
|
-
import { A as AwsRestJsonProtocol } from './AwsRestJsonProtocol-4m7HHwvS.mjs';
|
|
5
|
-
import './readMergedOptions-CraAnYdB.mjs';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import '@commander-js/extra-typings';
|
|
8
|
-
import './readDotenvCascade-Dgx4SC1p.mjs';
|
|
9
|
-
import 'fs-extra';
|
|
10
|
-
import 'radash';
|
|
11
|
-
import 'node:buffer';
|
|
12
|
-
import 'node:path';
|
|
13
|
-
import './loadModuleDefault-Dj8B3Stt.mjs';
|
|
14
|
-
import 'crypto';
|
|
15
|
-
import 'path';
|
|
16
|
-
import 'url';
|
|
17
|
-
import 'dotenv';
|
|
18
|
-
import 'nanoid';
|
|
19
|
-
import './loader-V1vbmtyw.mjs';
|
|
20
|
-
import 'package-directory';
|
|
21
|
-
import 'yaml';
|
|
22
|
-
import 'execa';
|
|
23
|
-
import 'node:os';
|
|
24
|
-
import 'node:fs/promises';
|
|
25
|
-
import 'node:stream';
|
|
26
|
-
import 'node:fs';
|
|
27
|
-
import 'node:https';
|
|
28
|
-
import 'node:process';
|
|
29
|
-
import './sdk-stream-mixin-BL49AxZx.mjs';
|
|
30
|
-
|
|
31
|
-
const defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
32
|
-
return {
|
|
33
|
-
operation: getSmithyContext(context).operation,
|
|
34
|
-
region: (await normalizeProvider(config.region)()) ||
|
|
35
|
-
(() => {
|
|
36
|
-
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
37
|
-
})(),
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
41
|
-
return {
|
|
42
|
-
schemeId: "aws.auth#sigv4",
|
|
43
|
-
signingProperties: {
|
|
44
|
-
name: "awsssoportal",
|
|
45
|
-
region: authParameters.region,
|
|
46
|
-
},
|
|
47
|
-
propertiesExtractor: (config, context) => ({
|
|
48
|
-
signingProperties: {
|
|
49
|
-
config,
|
|
50
|
-
context,
|
|
51
|
-
},
|
|
52
|
-
}),
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
|
|
56
|
-
return {
|
|
57
|
-
schemeId: "smithy.api#noAuth",
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
const defaultSSOHttpAuthSchemeProvider = (authParameters) => {
|
|
61
|
-
const options = [];
|
|
62
|
-
switch (authParameters.operation) {
|
|
63
|
-
case "GetRoleCredentials": {
|
|
64
|
-
options.push(createSmithyApiNoAuthHttpAuthOption());
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
default: {
|
|
68
|
-
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return options;
|
|
72
|
-
};
|
|
73
|
-
const resolveHttpAuthSchemeConfig = (config) => {
|
|
74
|
-
const config_0 = resolveAwsSdkSigV4Config(config);
|
|
75
|
-
return Object.assign(config_0, {
|
|
76
|
-
authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const resolveClientEndpointParameters = (options) => {
|
|
81
|
-
return Object.assign(options, {
|
|
82
|
-
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
83
|
-
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
84
|
-
defaultSigningName: "awsssoportal",
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
const commonParams = {
|
|
88
|
-
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
89
|
-
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
90
|
-
Region: { type: "builtInParams", name: "region" },
|
|
91
|
-
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const k = "ref";
|
|
95
|
-
const a = -1, b = true, c = "isSet", d = "PartitionResult", e = "booleanEquals", f = "getAttr", g = { [k]: "Endpoint" }, h = { [k]: d }, i = {}, j = [{ [k]: "Region" }];
|
|
96
|
-
const _data = {
|
|
97
|
-
conditions: [
|
|
98
|
-
[c, [g]],
|
|
99
|
-
[c, j],
|
|
100
|
-
["aws.partition", j, d],
|
|
101
|
-
[e, [{ [k]: "UseFIPS" }, b]],
|
|
102
|
-
[e, [{ [k]: "UseDualStack" }, b]],
|
|
103
|
-
[e, [{ fn: f, argv: [h, "supportsDualStack"] }, b]],
|
|
104
|
-
[e, [{ fn: f, argv: [h, "supportsFIPS"] }, b]],
|
|
105
|
-
["stringEquals", [{ fn: f, argv: [h, "name"] }, "aws-us-gov"]],
|
|
106
|
-
],
|
|
107
|
-
results: [
|
|
108
|
-
[a],
|
|
109
|
-
[a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
|
|
110
|
-
[a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
|
|
111
|
-
[g, i],
|
|
112
|
-
["https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", i],
|
|
113
|
-
[a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
|
|
114
|
-
["https://portal.sso.{Region}.amazonaws.com", i],
|
|
115
|
-
["https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}", i],
|
|
116
|
-
[a, "FIPS is enabled but this partition does not support FIPS"],
|
|
117
|
-
["https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}", i],
|
|
118
|
-
[a, "DualStack is enabled but this partition does not support DualStack"],
|
|
119
|
-
["https://portal.sso.{Region}.{PartitionResult#dnsSuffix}", i],
|
|
120
|
-
[a, "Invalid Configuration: Missing Region"],
|
|
121
|
-
],
|
|
122
|
-
};
|
|
123
|
-
const root = 2;
|
|
124
|
-
const r = 100_000_000;
|
|
125
|
-
const nodes = new Int32Array([
|
|
126
|
-
-1,
|
|
127
|
-
1,
|
|
128
|
-
-1,
|
|
129
|
-
0,
|
|
130
|
-
13,
|
|
131
|
-
3,
|
|
132
|
-
1,
|
|
133
|
-
4,
|
|
134
|
-
r + 12,
|
|
135
|
-
2,
|
|
136
|
-
5,
|
|
137
|
-
r + 12,
|
|
138
|
-
3,
|
|
139
|
-
8,
|
|
140
|
-
6,
|
|
141
|
-
4,
|
|
142
|
-
7,
|
|
143
|
-
r + 11,
|
|
144
|
-
5,
|
|
145
|
-
r + 9,
|
|
146
|
-
r + 10,
|
|
147
|
-
4,
|
|
148
|
-
11,
|
|
149
|
-
9,
|
|
150
|
-
6,
|
|
151
|
-
10,
|
|
152
|
-
r + 8,
|
|
153
|
-
7,
|
|
154
|
-
r + 6,
|
|
155
|
-
r + 7,
|
|
156
|
-
5,
|
|
157
|
-
12,
|
|
158
|
-
r + 5,
|
|
159
|
-
6,
|
|
160
|
-
r + 4,
|
|
161
|
-
r + 5,
|
|
162
|
-
3,
|
|
163
|
-
r + 1,
|
|
164
|
-
14,
|
|
165
|
-
4,
|
|
166
|
-
r + 2,
|
|
167
|
-
r + 3,
|
|
168
|
-
]);
|
|
169
|
-
const bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
|
|
170
|
-
|
|
171
|
-
const cache = new EndpointCache({
|
|
172
|
-
size: 50,
|
|
173
|
-
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
|
|
174
|
-
});
|
|
175
|
-
const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
176
|
-
return cache.get(endpointParams, () => decideEndpoint(bdd, {
|
|
177
|
-
endpointParams: endpointParams,
|
|
178
|
-
logger: context.logger,
|
|
179
|
-
}));
|
|
180
|
-
};
|
|
181
|
-
customEndpointFunctions.aws = awsEndpointFunctions;
|
|
182
|
-
|
|
183
|
-
class SSOServiceException extends ServiceException {
|
|
184
|
-
constructor(options) {
|
|
185
|
-
super(options);
|
|
186
|
-
Object.setPrototypeOf(this, SSOServiceException.prototype);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
class InvalidRequestException extends SSOServiceException {
|
|
191
|
-
name = "InvalidRequestException";
|
|
192
|
-
$fault = "client";
|
|
193
|
-
constructor(opts) {
|
|
194
|
-
super({
|
|
195
|
-
name: "InvalidRequestException",
|
|
196
|
-
$fault: "client",
|
|
197
|
-
...opts,
|
|
198
|
-
});
|
|
199
|
-
Object.setPrototypeOf(this, InvalidRequestException.prototype);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
class ResourceNotFoundException extends SSOServiceException {
|
|
203
|
-
name = "ResourceNotFoundException";
|
|
204
|
-
$fault = "client";
|
|
205
|
-
constructor(opts) {
|
|
206
|
-
super({
|
|
207
|
-
name: "ResourceNotFoundException",
|
|
208
|
-
$fault: "client",
|
|
209
|
-
...opts,
|
|
210
|
-
});
|
|
211
|
-
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
class TooManyRequestsException extends SSOServiceException {
|
|
215
|
-
name = "TooManyRequestsException";
|
|
216
|
-
$fault = "client";
|
|
217
|
-
constructor(opts) {
|
|
218
|
-
super({
|
|
219
|
-
name: "TooManyRequestsException",
|
|
220
|
-
$fault: "client",
|
|
221
|
-
...opts,
|
|
222
|
-
});
|
|
223
|
-
Object.setPrototypeOf(this, TooManyRequestsException.prototype);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
class UnauthorizedException extends SSOServiceException {
|
|
227
|
-
name = "UnauthorizedException";
|
|
228
|
-
$fault = "client";
|
|
229
|
-
constructor(opts) {
|
|
230
|
-
super({
|
|
231
|
-
name: "UnauthorizedException",
|
|
232
|
-
$fault: "client",
|
|
233
|
-
...opts,
|
|
234
|
-
});
|
|
235
|
-
Object.setPrototypeOf(this, UnauthorizedException.prototype);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
const _ATT = "AccessTokenType";
|
|
240
|
-
const _GRC = "GetRoleCredentials";
|
|
241
|
-
const _GRCR = "GetRoleCredentialsRequest";
|
|
242
|
-
const _GRCRe = "GetRoleCredentialsResponse";
|
|
243
|
-
const _IRE = "InvalidRequestException";
|
|
244
|
-
const _RC = "RoleCredentials";
|
|
245
|
-
const _RNFE = "ResourceNotFoundException";
|
|
246
|
-
const _SAKT = "SecretAccessKeyType";
|
|
247
|
-
const _STT = "SessionTokenType";
|
|
248
|
-
const _TMRE = "TooManyRequestsException";
|
|
249
|
-
const _UE = "UnauthorizedException";
|
|
250
|
-
const _aI = "accountId";
|
|
251
|
-
const _aKI = "accessKeyId";
|
|
252
|
-
const _aT = "accessToken";
|
|
253
|
-
const _ai = "account_id";
|
|
254
|
-
const _c = "client";
|
|
255
|
-
const _e = "error";
|
|
256
|
-
const _ex = "expiration";
|
|
257
|
-
const _h = "http";
|
|
258
|
-
const _hE = "httpError";
|
|
259
|
-
const _hH = "httpHeader";
|
|
260
|
-
const _hQ = "httpQuery";
|
|
261
|
-
const _m = "message";
|
|
262
|
-
const _rC = "roleCredentials";
|
|
263
|
-
const _rN = "roleName";
|
|
264
|
-
const _rn = "role_name";
|
|
265
|
-
const _s = "smithy.ts.sdk.synthetic.com.amazonaws.sso";
|
|
266
|
-
const _sAK = "secretAccessKey";
|
|
267
|
-
const _sT = "sessionToken";
|
|
268
|
-
const _xasbt = "x-amz-sso_bearer_token";
|
|
269
|
-
const n0 = "com.amazonaws.sso";
|
|
270
|
-
const _s_registry = TypeRegistry.for(_s);
|
|
271
|
-
var SSOServiceException$ = [-3, _s, "SSOServiceException", 0, [], []];
|
|
272
|
-
_s_registry.registerError(SSOServiceException$, SSOServiceException);
|
|
273
|
-
const n0_registry = TypeRegistry.for(n0);
|
|
274
|
-
var InvalidRequestException$ = [-3, n0, _IRE, { [_e]: _c, [_hE]: 400 }, [_m], [0]];
|
|
275
|
-
n0_registry.registerError(InvalidRequestException$, InvalidRequestException);
|
|
276
|
-
var ResourceNotFoundException$ = [-3, n0, _RNFE, { [_e]: _c, [_hE]: 404 }, [_m], [0]];
|
|
277
|
-
n0_registry.registerError(ResourceNotFoundException$, ResourceNotFoundException);
|
|
278
|
-
var TooManyRequestsException$ = [-3, n0, _TMRE, { [_e]: _c, [_hE]: 429 }, [_m], [0]];
|
|
279
|
-
n0_registry.registerError(TooManyRequestsException$, TooManyRequestsException);
|
|
280
|
-
var UnauthorizedException$ = [-3, n0, _UE, { [_e]: _c, [_hE]: 401 }, [_m], [0]];
|
|
281
|
-
n0_registry.registerError(UnauthorizedException$, UnauthorizedException);
|
|
282
|
-
const errorTypeRegistries = [_s_registry, n0_registry];
|
|
283
|
-
var AccessTokenType = [0, n0, _ATT, 8, 0];
|
|
284
|
-
var SecretAccessKeyType = [0, n0, _SAKT, 8, 0];
|
|
285
|
-
var SessionTokenType = [0, n0, _STT, 8, 0];
|
|
286
|
-
var GetRoleCredentialsRequest$ = [
|
|
287
|
-
3,
|
|
288
|
-
n0,
|
|
289
|
-
_GRCR,
|
|
290
|
-
0,
|
|
291
|
-
[_rN, _aI, _aT],
|
|
292
|
-
[
|
|
293
|
-
[0, { [_hQ]: _rn }],
|
|
294
|
-
[0, { [_hQ]: _ai }],
|
|
295
|
-
[() => AccessTokenType, { [_hH]: _xasbt }],
|
|
296
|
-
],
|
|
297
|
-
3,
|
|
298
|
-
];
|
|
299
|
-
var GetRoleCredentialsResponse$ = [
|
|
300
|
-
3,
|
|
301
|
-
n0,
|
|
302
|
-
_GRCRe,
|
|
303
|
-
0,
|
|
304
|
-
[_rC],
|
|
305
|
-
[[() => RoleCredentials$, 0]],
|
|
306
|
-
];
|
|
307
|
-
var RoleCredentials$ = [
|
|
308
|
-
3,
|
|
309
|
-
n0,
|
|
310
|
-
_RC,
|
|
311
|
-
0,
|
|
312
|
-
[_aKI, _sAK, _sT, _ex],
|
|
313
|
-
[0, [() => SecretAccessKeyType, 0], [() => SessionTokenType, 0], 1],
|
|
314
|
-
];
|
|
315
|
-
var GetRoleCredentials$ = [
|
|
316
|
-
9,
|
|
317
|
-
n0,
|
|
318
|
-
_GRC,
|
|
319
|
-
{ [_h]: ["GET", "/federation/credentials", 200] },
|
|
320
|
-
() => GetRoleCredentialsRequest$,
|
|
321
|
-
() => GetRoleCredentialsResponse$,
|
|
322
|
-
];
|
|
323
|
-
|
|
324
|
-
const getRuntimeConfig$1 = (config) => {
|
|
325
|
-
return {
|
|
326
|
-
apiVersion: "2019-06-10",
|
|
327
|
-
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
328
|
-
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
329
|
-
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
330
|
-
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
331
|
-
extensions: config?.extensions ?? [],
|
|
332
|
-
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSSOHttpAuthSchemeProvider,
|
|
333
|
-
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
334
|
-
{
|
|
335
|
-
schemeId: "aws.auth#sigv4",
|
|
336
|
-
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
337
|
-
signer: new AwsSdkSigV4Signer(),
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
schemeId: "smithy.api#noAuth",
|
|
341
|
-
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
342
|
-
signer: new NoAuthSigner(),
|
|
343
|
-
},
|
|
344
|
-
],
|
|
345
|
-
logger: config?.logger ?? new NoOpLogger(),
|
|
346
|
-
protocol: config?.protocol ?? AwsRestJsonProtocol,
|
|
347
|
-
protocolSettings: config?.protocolSettings ?? {
|
|
348
|
-
defaultNamespace: "com.amazonaws.sso",
|
|
349
|
-
errorTypeRegistries,
|
|
350
|
-
version: "2019-06-10",
|
|
351
|
-
serviceTarget: "SWBPortalService",
|
|
352
|
-
},
|
|
353
|
-
serviceId: config?.serviceId ?? "SSO",
|
|
354
|
-
urlParser: config?.urlParser ?? parseUrl,
|
|
355
|
-
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
356
|
-
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
357
|
-
};
|
|
358
|
-
};
|
|
359
|
-
|
|
360
|
-
const getRuntimeConfig = (config) => {
|
|
361
|
-
emitWarningIfUnsupportedVersion(process.version);
|
|
362
|
-
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
363
|
-
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
364
|
-
const clientSharedValues = getRuntimeConfig$1(config);
|
|
365
|
-
emitWarningIfUnsupportedVersion$1(process.version);
|
|
366
|
-
const loaderConfig = {
|
|
367
|
-
profile: config?.profile,
|
|
368
|
-
logger: clientSharedValues.logger,
|
|
369
|
-
};
|
|
370
|
-
return {
|
|
371
|
-
...clientSharedValues,
|
|
372
|
-
...config,
|
|
373
|
-
runtime: "node",
|
|
374
|
-
defaultsMode,
|
|
375
|
-
authSchemePreference: config?.authSchemePreference ?? loadConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
376
|
-
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
377
|
-
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
378
|
-
createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
379
|
-
maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
380
|
-
region: config?.region ??
|
|
381
|
-
loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
382
|
-
requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
383
|
-
retryMode: config?.retryMode ??
|
|
384
|
-
loadConfig({
|
|
385
|
-
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
386
|
-
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
387
|
-
}, config),
|
|
388
|
-
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
389
|
-
streamCollector: config?.streamCollector ?? streamCollector,
|
|
390
|
-
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
391
|
-
useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
392
|
-
userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
393
|
-
};
|
|
394
|
-
};
|
|
395
|
-
|
|
396
|
-
const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
397
|
-
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
398
|
-
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
399
|
-
let _credentials = runtimeConfig.credentials;
|
|
400
|
-
return {
|
|
401
|
-
setHttpAuthScheme(httpAuthScheme) {
|
|
402
|
-
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
403
|
-
if (index === -1) {
|
|
404
|
-
_httpAuthSchemes.push(httpAuthScheme);
|
|
405
|
-
}
|
|
406
|
-
else {
|
|
407
|
-
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
408
|
-
}
|
|
409
|
-
},
|
|
410
|
-
httpAuthSchemes() {
|
|
411
|
-
return _httpAuthSchemes;
|
|
412
|
-
},
|
|
413
|
-
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
414
|
-
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
415
|
-
},
|
|
416
|
-
httpAuthSchemeProvider() {
|
|
417
|
-
return _httpAuthSchemeProvider;
|
|
418
|
-
},
|
|
419
|
-
setCredentials(credentials) {
|
|
420
|
-
_credentials = credentials;
|
|
421
|
-
},
|
|
422
|
-
credentials() {
|
|
423
|
-
return _credentials;
|
|
424
|
-
},
|
|
425
|
-
};
|
|
426
|
-
};
|
|
427
|
-
const resolveHttpAuthRuntimeConfig = (config) => {
|
|
428
|
-
return {
|
|
429
|
-
httpAuthSchemes: config.httpAuthSchemes(),
|
|
430
|
-
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
431
|
-
credentials: config.credentials(),
|
|
432
|
-
};
|
|
433
|
-
};
|
|
434
|
-
|
|
435
|
-
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
436
|
-
const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
|
|
437
|
-
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
438
|
-
return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
|
|
439
|
-
};
|
|
440
|
-
|
|
441
|
-
class SSOClient extends Client {
|
|
442
|
-
config;
|
|
443
|
-
constructor(...[configuration]) {
|
|
444
|
-
const _config_0 = getRuntimeConfig(configuration || {});
|
|
445
|
-
super(_config_0);
|
|
446
|
-
this.initConfig = _config_0;
|
|
447
|
-
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
448
|
-
const _config_2 = resolveUserAgentConfig(_config_1);
|
|
449
|
-
const _config_3 = resolveRetryConfig(_config_2);
|
|
450
|
-
const _config_4 = resolveRegionConfig(_config_3);
|
|
451
|
-
const _config_5 = resolveHostHeaderConfig(_config_4);
|
|
452
|
-
const _config_6 = resolveEndpointConfig(_config_5);
|
|
453
|
-
const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
|
|
454
|
-
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
|
|
455
|
-
this.config = _config_8;
|
|
456
|
-
this.middlewareStack.use(getSchemaSerdePlugin(this.config));
|
|
457
|
-
this.middlewareStack.use(getUserAgentPlugin(this.config));
|
|
458
|
-
this.middlewareStack.use(getRetryPlugin(this.config));
|
|
459
|
-
this.middlewareStack.use(getContentLengthPlugin(this.config));
|
|
460
|
-
this.middlewareStack.use(getHostHeaderPlugin(this.config));
|
|
461
|
-
this.middlewareStack.use(getLoggerPlugin(this.config));
|
|
462
|
-
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
|
|
463
|
-
this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
464
|
-
httpAuthSchemeParametersProvider: defaultSSOHttpAuthSchemeParametersProvider,
|
|
465
|
-
identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
|
|
466
|
-
"aws.auth#sigv4": config.credentials,
|
|
467
|
-
}),
|
|
468
|
-
}));
|
|
469
|
-
this.middlewareStack.use(getHttpSigningPlugin(this.config));
|
|
470
|
-
}
|
|
471
|
-
destroy() {
|
|
472
|
-
super.destroy();
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
class GetRoleCredentialsCommand extends Command
|
|
477
|
-
.classBuilder()
|
|
478
|
-
.ep(commonParams)
|
|
479
|
-
.m(function (Command, cs, config, o) {
|
|
480
|
-
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
481
|
-
})
|
|
482
|
-
.s("SWBPortalService", "GetRoleCredentials", {})
|
|
483
|
-
.n("SSOClient", "GetRoleCredentialsCommand")
|
|
484
|
-
.sc(GetRoleCredentials$)
|
|
485
|
-
.build() {
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
export { GetRoleCredentialsCommand, SSOClient };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { at as loadSharedConfigFiles } from './index-BuxEK_Z4.mjs';
|
|
2
|
-
|
|
3
|
-
const mergeConfigFiles = (...files) => {
|
|
4
|
-
const merged = {};
|
|
5
|
-
for (const file of files) {
|
|
6
|
-
for (const [key, values] of Object.entries(file)) {
|
|
7
|
-
if (merged[key] !== undefined) {
|
|
8
|
-
Object.assign(merged[key], values);
|
|
9
|
-
}
|
|
10
|
-
else {
|
|
11
|
-
merged[key] = values;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return merged;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const parseKnownFiles = async (init) => {
|
|
19
|
-
const parsedFiles = await loadSharedConfigFiles(init);
|
|
20
|
-
return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export { parseKnownFiles as p };
|