gitframes 1.2.35
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/LICENCE +202 -0
- package/README.md +77 -0
- package/dist/audio/index.d.mts +2 -0
- package/dist/audio/index.mjs +6 -0
- package/dist/audio-C0YslYEG.d.mts +32 -0
- package/dist/audio-C0YslYEG.d.mts.map +1 -0
- package/dist/audio-C4kiPbrV.mjs +1866 -0
- package/dist/audio-C4kiPbrV.mjs.map +1 -0
- package/dist/audio-CiXUMGyk.mjs +578 -0
- package/dist/audio-CiXUMGyk.mjs.map +1 -0
- package/dist/chunk-GMkBE123.mjs +47 -0
- package/dist/client-Dyypr8tt.mjs +66 -0
- package/dist/client-Dyypr8tt.mjs.map +1 -0
- package/dist/dist-C37594c6.mjs +27195 -0
- package/dist/dist-C37594c6.mjs.map +1 -0
- package/dist/dist-CMF9eNLB.mjs +4062 -0
- package/dist/dist-CMF9eNLB.mjs.map +1 -0
- package/dist/dist-cjs--KIl7Gqy.mjs +6 -0
- package/dist/dist-cjs-B-_4TVjP.mjs +66 -0
- package/dist/dist-cjs-B-_4TVjP.mjs.map +1 -0
- package/dist/dist-cjs-B3TIyZ3K.mjs +437 -0
- package/dist/dist-cjs-B3TIyZ3K.mjs.map +1 -0
- package/dist/dist-cjs-Bsz2eGzl.mjs +9069 -0
- package/dist/dist-cjs-Bsz2eGzl.mjs.map +1 -0
- package/dist/dist-cjs-BuJ2FXob.mjs +181 -0
- package/dist/dist-cjs-BuJ2FXob.mjs.map +1 -0
- package/dist/dist-cjs-C-FMsqmo.mjs +1091 -0
- package/dist/dist-cjs-C-FMsqmo.mjs.map +1 -0
- package/dist/dist-cjs-C4b9TCXd.mjs +48 -0
- package/dist/dist-cjs-C4b9TCXd.mjs.map +1 -0
- package/dist/dist-cjs-C817PNLc.mjs +51 -0
- package/dist/dist-cjs-C817PNLc.mjs.map +1 -0
- package/dist/dist-cjs-CBnnS4k8.mjs +43 -0
- package/dist/dist-cjs-CBnnS4k8.mjs.map +1 -0
- package/dist/dist-cjs-CWbeD0Mu.mjs +64 -0
- package/dist/dist-cjs-CWbeD0Mu.mjs.map +1 -0
- package/dist/dist-cjs-ChXEJ1ro.mjs +85 -0
- package/dist/dist-cjs-ChXEJ1ro.mjs.map +1 -0
- package/dist/dist-cjs-CslF8Dju.mjs +153 -0
- package/dist/dist-cjs-CslF8Dju.mjs.map +1 -0
- package/dist/dist-cjs-D52jYyEm.mjs +98 -0
- package/dist/dist-cjs-D52jYyEm.mjs.map +1 -0
- package/dist/dist-cjs-DhWYgNfa.mjs +209 -0
- package/dist/dist-cjs-DhWYgNfa.mjs.map +1 -0
- package/dist/dist-cjs-DssYqayv.mjs +5015 -0
- package/dist/dist-cjs-DssYqayv.mjs.map +1 -0
- package/dist/dist-cjs-Du6DnSjo.mjs +137 -0
- package/dist/dist-cjs-Du6DnSjo.mjs.map +1 -0
- package/dist/dist-cjs-b-oBQaxe.mjs +323 -0
- package/dist/dist-cjs-b-oBQaxe.mjs.map +1 -0
- package/dist/effects/index.d.mts +2 -0
- package/dist/effects/index.mjs +4 -0
- package/dist/effects-4t4qk-BR.mjs +21130 -0
- package/dist/effects-4t4qk-BR.mjs.map +1 -0
- package/dist/event-streams-B0YUBtyM.mjs +204 -0
- package/dist/event-streams-B0YUBtyM.mjs.map +1 -0
- package/dist/fonts/index.d.mts +2 -0
- package/dist/fonts/index.mjs +3 -0
- package/dist/fonts-Dn18r_ST.mjs +188 -0
- package/dist/fonts-Dn18r_ST.mjs.map +1 -0
- package/dist/index-B1557AUi.d.mts +928 -0
- package/dist/index-B1557AUi.d.mts.map +1 -0
- package/dist/index-DSaMXGoA.d.mts +65 -0
- package/dist/index-DSaMXGoA.d.mts.map +1 -0
- package/dist/index-FICUHo4P.d.mts +69 -0
- package/dist/index-FICUHo4P.d.mts.map +1 -0
- package/dist/index-YZsTjqut.d.mts +147 -0
- package/dist/index-YZsTjqut.d.mts.map +1 -0
- package/dist/index.d.mts +736 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +7135 -0
- package/dist/index.mjs.map +1 -0
- package/dist/package-5RsA21g-.mjs +6 -0
- package/dist/package-5RsA21g-.mjs.map +1 -0
- package/dist/react/index.d.mts +3 -0
- package/dist/react/index.mjs +4 -0
- package/dist/renderer/index.d.mts +2 -0
- package/dist/renderer/index.mjs +6 -0
- package/dist/renderer-DVi31fSv.mjs +23274 -0
- package/dist/renderer-DVi31fSv.mjs.map +1 -0
- package/dist/renderers-CLJQRPVU-CMZnHNK0.mjs +49 -0
- package/dist/renderers-CLJQRPVU-CMZnHNK0.mjs.map +1 -0
- package/dist/signals/index.d.mts +9 -0
- package/dist/signals/index.mjs +8 -0
- package/dist/signals-BB_kdndF.mjs +227 -0
- package/dist/signals-BB_kdndF.mjs.map +1 -0
- package/dist/signin-CVUAIuED.mjs +865 -0
- package/dist/signin-CVUAIuED.mjs.map +1 -0
- package/dist/sso-oidc-D1GnNQYW.mjs +1051 -0
- package/dist/sso-oidc-D1GnNQYW.mjs.map +1 -0
- package/dist/sts-Bz-e3kNW.mjs +6 -0
- package/dist/sts-I4KhuCBs.mjs +1395 -0
- package/dist/sts-I4KhuCBs.mjs.map +1 -0
- package/package.json +174 -0
|
@@ -0,0 +1,1091 @@
|
|
|
1
|
+
import { a as __toCommonJS, i as __require, n as __esmMin, r as __exportAll, t as __commonJSMin } from "./chunk-GMkBE123.mjs";
|
|
2
|
+
import { t as require_dist_cjs$2 } from "./dist-cjs-CslF8Dju.mjs";
|
|
3
|
+
import { n as init_client, o as emitWarningIfUnsupportedVersion$1, t as client_exports } from "./client-Dyypr8tt.mjs";
|
|
4
|
+
import { A as NoAuthSigner, C as AwsRestJsonProtocol, E as resolveAwsSdkSigV4Config, F as AwsSdkSigV4Signer, M as getHttpSigningPlugin, N as getHttpAuthSchemeEndpointRuleSetPlugin, P as NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, T as init_httpAuthSchemes, _ as require_dist_cjs$13, a as require_dist_cjs$5, b as init_protocols, c as require_dist_cjs$17, d as require_dist_cjs$11, f as require_dist_cjs$3, g as require_dist_cjs$14, h as require_dist_cjs$15, i as require_dist_cjs$7, j as DefaultIdentityProviderConfig, k as init_dist_es$1, l as require_dist_cjs$6, n as require_dist_cjs$10, o as require_dist_cjs$8, p as require_dist_cjs$4, r as require_dist_cjs$9, s as require_dist_cjs$18, t as require_dist_cjs$12, u as require_dist_cjs$16, w as httpAuthSchemes_exports, y as init_dist_es } from "./dist-cjs-Bsz2eGzl.mjs";
|
|
5
|
+
import { E as TypeRegistry, I as require_dist_cjs$22, O as getSchemaSerdePlugin, R as require_dist_cjs$21, t as require_dist_cjs$20, w as init_schema, z as require_dist_cjs$19 } from "./dist-cjs-DssYqayv.mjs";
|
|
6
|
+
import { t as require_dist_cjs$23 } from "./dist-cjs-C817PNLc.mjs";
|
|
7
|
+
import { t as require_dist_cjs$24 } from "./dist-cjs-CBnnS4k8.mjs";
|
|
8
|
+
import { t as require_dist_cjs$25 } from "./dist-cjs-D52jYyEm.mjs";
|
|
9
|
+
import { t as require_dist_cjs$26 } from "./dist-cjs-DhWYgNfa.mjs";
|
|
10
|
+
import { t as require_dist_cjs$27 } from "./dist-cjs-CWbeD0Mu.mjs";
|
|
11
|
+
import { t as version } from "./package-5RsA21g-.mjs";
|
|
12
|
+
|
|
13
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+token-providers@3.1009.0/node_modules/@aws-sdk/token-providers/dist-cjs/index.js
|
|
14
|
+
var require_dist_cjs$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
15
|
+
var client = (init_client(), __toCommonJS(client_exports));
|
|
16
|
+
var httpAuthSchemes = (init_httpAuthSchemes(), __toCommonJS(httpAuthSchemes_exports));
|
|
17
|
+
var propertyProvider = require_dist_cjs$25();
|
|
18
|
+
var sharedIniFileLoader = require_dist_cjs$26();
|
|
19
|
+
var node_fs = __require("node:fs");
|
|
20
|
+
const fromEnvSigningName = ({ logger, signingName } = {}) => async () => {
|
|
21
|
+
logger?.debug?.("@aws-sdk/token-providers - fromEnvSigningName");
|
|
22
|
+
if (!signingName) throw new propertyProvider.TokenProviderError("Please pass 'signingName' to compute environment variable key", { logger });
|
|
23
|
+
const bearerTokenKey = httpAuthSchemes.getBearerTokenEnvKey(signingName);
|
|
24
|
+
if (!(bearerTokenKey in process.env)) throw new propertyProvider.TokenProviderError(`Token not present in '${bearerTokenKey}' environment variable`, { logger });
|
|
25
|
+
const token = { token: process.env[bearerTokenKey] };
|
|
26
|
+
client.setTokenFeature(token, "BEARER_SERVICE_ENV_VARS", "3");
|
|
27
|
+
return token;
|
|
28
|
+
};
|
|
29
|
+
const EXPIRE_WINDOW_MS = 300 * 1e3;
|
|
30
|
+
const REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;
|
|
31
|
+
const getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {
|
|
32
|
+
const { SSOOIDCClient } = await import("./sso-oidc-D1GnNQYW.mjs");
|
|
33
|
+
const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop] ?? callerClientConfig?.[prop];
|
|
34
|
+
return new SSOOIDCClient(Object.assign({}, init.clientConfig ?? {}, {
|
|
35
|
+
region: ssoRegion ?? init.clientConfig?.region,
|
|
36
|
+
logger: coalesce("logger"),
|
|
37
|
+
userAgentAppId: coalesce("userAgentAppId")
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
40
|
+
const getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConfig) => {
|
|
41
|
+
const { CreateTokenCommand } = await import("./sso-oidc-D1GnNQYW.mjs");
|
|
42
|
+
return (await getSsoOidcClient(ssoRegion, init, callerClientConfig)).send(new CreateTokenCommand({
|
|
43
|
+
clientId: ssoToken.clientId,
|
|
44
|
+
clientSecret: ssoToken.clientSecret,
|
|
45
|
+
refreshToken: ssoToken.refreshToken,
|
|
46
|
+
grantType: "refresh_token"
|
|
47
|
+
}));
|
|
48
|
+
};
|
|
49
|
+
const validateTokenExpiry = (token) => {
|
|
50
|
+
if (token.expiration && token.expiration.getTime() < Date.now()) throw new propertyProvider.TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
|
|
51
|
+
};
|
|
52
|
+
const validateTokenKey = (key, value, forRefresh = false) => {
|
|
53
|
+
if (typeof value === "undefined") throw new propertyProvider.TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false);
|
|
54
|
+
};
|
|
55
|
+
const { writeFile } = node_fs.promises;
|
|
56
|
+
const writeSSOTokenToFile = (id, ssoToken) => {
|
|
57
|
+
return writeFile(sharedIniFileLoader.getSSOTokenFilepath(id), JSON.stringify(ssoToken, null, 2));
|
|
58
|
+
};
|
|
59
|
+
const lastRefreshAttemptTime = /* @__PURE__ */ new Date(0);
|
|
60
|
+
const fromSso = (init = {}) => async ({ callerClientConfig } = {}) => {
|
|
61
|
+
init.logger?.debug("@aws-sdk/token-providers - fromSso");
|
|
62
|
+
const profiles = await sharedIniFileLoader.parseKnownFiles(init);
|
|
63
|
+
const profileName = sharedIniFileLoader.getProfileName({ profile: init.profile ?? callerClientConfig?.profile });
|
|
64
|
+
const profile = profiles[profileName];
|
|
65
|
+
if (!profile) throw new propertyProvider.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
|
|
66
|
+
else if (!profile["sso_session"]) throw new propertyProvider.TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);
|
|
67
|
+
const ssoSessionName = profile["sso_session"];
|
|
68
|
+
const ssoSession = (await sharedIniFileLoader.loadSsoSessionData(init))[ssoSessionName];
|
|
69
|
+
if (!ssoSession) throw new propertyProvider.TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false);
|
|
70
|
+
for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) if (!ssoSession[ssoSessionRequiredKey]) throw new propertyProvider.TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false);
|
|
71
|
+
ssoSession["sso_start_url"];
|
|
72
|
+
const ssoRegion = ssoSession["sso_region"];
|
|
73
|
+
let ssoToken;
|
|
74
|
+
try {
|
|
75
|
+
ssoToken = await sharedIniFileLoader.getSSOTokenFromFile(ssoSessionName);
|
|
76
|
+
} catch (e$1) {
|
|
77
|
+
throw new propertyProvider.TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false);
|
|
78
|
+
}
|
|
79
|
+
validateTokenKey("accessToken", ssoToken.accessToken);
|
|
80
|
+
validateTokenKey("expiresAt", ssoToken.expiresAt);
|
|
81
|
+
const { accessToken, expiresAt } = ssoToken;
|
|
82
|
+
const existingToken = {
|
|
83
|
+
token: accessToken,
|
|
84
|
+
expiration: new Date(expiresAt)
|
|
85
|
+
};
|
|
86
|
+
if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) return existingToken;
|
|
87
|
+
if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1e3) {
|
|
88
|
+
validateTokenExpiry(existingToken);
|
|
89
|
+
return existingToken;
|
|
90
|
+
}
|
|
91
|
+
validateTokenKey("clientId", ssoToken.clientId, true);
|
|
92
|
+
validateTokenKey("clientSecret", ssoToken.clientSecret, true);
|
|
93
|
+
validateTokenKey("refreshToken", ssoToken.refreshToken, true);
|
|
94
|
+
try {
|
|
95
|
+
lastRefreshAttemptTime.setTime(Date.now());
|
|
96
|
+
const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init, callerClientConfig);
|
|
97
|
+
validateTokenKey("accessToken", newSsoOidcToken.accessToken);
|
|
98
|
+
validateTokenKey("expiresIn", newSsoOidcToken.expiresIn);
|
|
99
|
+
const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1e3);
|
|
100
|
+
try {
|
|
101
|
+
await writeSSOTokenToFile(ssoSessionName, {
|
|
102
|
+
...ssoToken,
|
|
103
|
+
accessToken: newSsoOidcToken.accessToken,
|
|
104
|
+
expiresAt: newTokenExpiration.toISOString(),
|
|
105
|
+
refreshToken: newSsoOidcToken.refreshToken
|
|
106
|
+
});
|
|
107
|
+
} catch (error) {}
|
|
108
|
+
return {
|
|
109
|
+
token: newSsoOidcToken.accessToken,
|
|
110
|
+
expiration: newTokenExpiration
|
|
111
|
+
};
|
|
112
|
+
} catch (error) {
|
|
113
|
+
validateTokenExpiry(existingToken);
|
|
114
|
+
return existingToken;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const fromStatic = ({ token, logger }) => async () => {
|
|
118
|
+
logger?.debug("@aws-sdk/token-providers - fromStatic");
|
|
119
|
+
if (!token || !token.token) throw new propertyProvider.TokenProviderError(`Please pass a valid token to fromStatic`, false);
|
|
120
|
+
return token;
|
|
121
|
+
};
|
|
122
|
+
const nodeProvider = (init = {}) => propertyProvider.memoize(propertyProvider.chain(fromSso(init), async () => {
|
|
123
|
+
throw new propertyProvider.TokenProviderError("Could not load token from any providers", false);
|
|
124
|
+
}), (token) => token.expiration !== void 0 && token.expiration.getTime() - Date.now() < 3e5, (token) => token.expiration !== void 0);
|
|
125
|
+
exports.fromEnvSigningName = fromEnvSigningName;
|
|
126
|
+
exports.fromSso = fromSso;
|
|
127
|
+
exports.fromStatic = fromStatic;
|
|
128
|
+
exports.nodeProvider = nodeProvider;
|
|
129
|
+
}));
|
|
130
|
+
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.996.10/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/auth/httpAuthSchemeProvider.js
|
|
133
|
+
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
134
|
+
return {
|
|
135
|
+
schemeId: "aws.auth#sigv4",
|
|
136
|
+
signingProperties: {
|
|
137
|
+
name: "awsssoportal",
|
|
138
|
+
region: authParameters.region
|
|
139
|
+
},
|
|
140
|
+
propertiesExtractor: (config, context) => ({ signingProperties: {
|
|
141
|
+
config,
|
|
142
|
+
context
|
|
143
|
+
} })
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
|
|
147
|
+
return { schemeId: "smithy.api#noAuth" };
|
|
148
|
+
}
|
|
149
|
+
var import_dist_cjs$32, defaultSSOHttpAuthSchemeParametersProvider, defaultSSOHttpAuthSchemeProvider, resolveHttpAuthSchemeConfig;
|
|
150
|
+
var init_httpAuthSchemeProvider = __esmMin((() => {
|
|
151
|
+
init_dist_es();
|
|
152
|
+
import_dist_cjs$32 = require_dist_cjs$19();
|
|
153
|
+
defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
154
|
+
return {
|
|
155
|
+
operation: (0, import_dist_cjs$32.getSmithyContext)(context).operation,
|
|
156
|
+
region: await (0, import_dist_cjs$32.normalizeProvider)(config.region)() || (() => {
|
|
157
|
+
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
158
|
+
})()
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
defaultSSOHttpAuthSchemeProvider = (authParameters) => {
|
|
162
|
+
const options = [];
|
|
163
|
+
switch (authParameters.operation) {
|
|
164
|
+
case "GetRoleCredentials":
|
|
165
|
+
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
166
|
+
break;
|
|
167
|
+
default: options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
168
|
+
}
|
|
169
|
+
return options;
|
|
170
|
+
};
|
|
171
|
+
resolveHttpAuthSchemeConfig = (config) => {
|
|
172
|
+
const config_0 = resolveAwsSdkSigV4Config(config);
|
|
173
|
+
return Object.assign(config_0, { authSchemePreference: (0, import_dist_cjs$32.normalizeProvider)(config.authSchemePreference ?? []) });
|
|
174
|
+
};
|
|
175
|
+
}));
|
|
176
|
+
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.996.10/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/EndpointParameters.js
|
|
179
|
+
var resolveClientEndpointParameters, commonParams;
|
|
180
|
+
var init_EndpointParameters = __esmMin((() => {
|
|
181
|
+
resolveClientEndpointParameters = (options) => {
|
|
182
|
+
return Object.assign(options, {
|
|
183
|
+
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
184
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
185
|
+
defaultSigningName: "awsssoportal"
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
commonParams = {
|
|
189
|
+
UseFIPS: {
|
|
190
|
+
type: "builtInParams",
|
|
191
|
+
name: "useFipsEndpoint"
|
|
192
|
+
},
|
|
193
|
+
Endpoint: {
|
|
194
|
+
type: "builtInParams",
|
|
195
|
+
name: "endpoint"
|
|
196
|
+
},
|
|
197
|
+
Region: {
|
|
198
|
+
type: "builtInParams",
|
|
199
|
+
name: "region"
|
|
200
|
+
},
|
|
201
|
+
UseDualStack: {
|
|
202
|
+
type: "builtInParams",
|
|
203
|
+
name: "useDualstackEndpoint"
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
}));
|
|
207
|
+
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.996.10/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/ruleset.js
|
|
210
|
+
var u, v, w, x, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, _data, ruleSet;
|
|
211
|
+
var init_ruleset = __esmMin((() => {
|
|
212
|
+
u = "required", v = "fn", w = "argv", x = "ref";
|
|
213
|
+
a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = "getAttr", i = {
|
|
214
|
+
[u]: false,
|
|
215
|
+
type: "string"
|
|
216
|
+
}, j = {
|
|
217
|
+
[u]: true,
|
|
218
|
+
default: false,
|
|
219
|
+
type: "boolean"
|
|
220
|
+
}, k = { [x]: "Endpoint" }, l = {
|
|
221
|
+
[v]: c,
|
|
222
|
+
[w]: [{ [x]: "UseFIPS" }, true]
|
|
223
|
+
}, m = {
|
|
224
|
+
[v]: c,
|
|
225
|
+
[w]: [{ [x]: "UseDualStack" }, true]
|
|
226
|
+
}, n = {}, o = {
|
|
227
|
+
[v]: h,
|
|
228
|
+
[w]: [{ [x]: g }, "supportsFIPS"]
|
|
229
|
+
}, p = { [x]: g }, q = {
|
|
230
|
+
[v]: c,
|
|
231
|
+
[w]: [true, {
|
|
232
|
+
[v]: h,
|
|
233
|
+
[w]: [p, "supportsDualStack"]
|
|
234
|
+
}]
|
|
235
|
+
}, r = [l], s = [m], t = [{ [x]: "Region" }];
|
|
236
|
+
_data = {
|
|
237
|
+
version: "1.0",
|
|
238
|
+
parameters: {
|
|
239
|
+
Region: i,
|
|
240
|
+
UseDualStack: j,
|
|
241
|
+
UseFIPS: j,
|
|
242
|
+
Endpoint: i
|
|
243
|
+
},
|
|
244
|
+
rules: [
|
|
245
|
+
{
|
|
246
|
+
conditions: [{
|
|
247
|
+
[v]: b,
|
|
248
|
+
[w]: [k]
|
|
249
|
+
}],
|
|
250
|
+
rules: [
|
|
251
|
+
{
|
|
252
|
+
conditions: r,
|
|
253
|
+
error: "Invalid Configuration: FIPS and custom endpoint are not supported",
|
|
254
|
+
type: d
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
conditions: s,
|
|
258
|
+
error: "Invalid Configuration: Dualstack and custom endpoint are not supported",
|
|
259
|
+
type: d
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
endpoint: {
|
|
263
|
+
url: k,
|
|
264
|
+
properties: n,
|
|
265
|
+
headers: n
|
|
266
|
+
},
|
|
267
|
+
type: e
|
|
268
|
+
}
|
|
269
|
+
],
|
|
270
|
+
type: f
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
conditions: [{
|
|
274
|
+
[v]: b,
|
|
275
|
+
[w]: t
|
|
276
|
+
}],
|
|
277
|
+
rules: [{
|
|
278
|
+
conditions: [{
|
|
279
|
+
[v]: "aws.partition",
|
|
280
|
+
[w]: t,
|
|
281
|
+
assign: g
|
|
282
|
+
}],
|
|
283
|
+
rules: [
|
|
284
|
+
{
|
|
285
|
+
conditions: [l, m],
|
|
286
|
+
rules: [{
|
|
287
|
+
conditions: [{
|
|
288
|
+
[v]: c,
|
|
289
|
+
[w]: [a, o]
|
|
290
|
+
}, q],
|
|
291
|
+
rules: [{
|
|
292
|
+
endpoint: {
|
|
293
|
+
url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
|
|
294
|
+
properties: n,
|
|
295
|
+
headers: n
|
|
296
|
+
},
|
|
297
|
+
type: e
|
|
298
|
+
}],
|
|
299
|
+
type: f
|
|
300
|
+
}, {
|
|
301
|
+
error: "FIPS and DualStack are enabled, but this partition does not support one or both",
|
|
302
|
+
type: d
|
|
303
|
+
}],
|
|
304
|
+
type: f
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
conditions: r,
|
|
308
|
+
rules: [{
|
|
309
|
+
conditions: [{
|
|
310
|
+
[v]: c,
|
|
311
|
+
[w]: [o, a]
|
|
312
|
+
}],
|
|
313
|
+
rules: [{
|
|
314
|
+
conditions: [{
|
|
315
|
+
[v]: "stringEquals",
|
|
316
|
+
[w]: [{
|
|
317
|
+
[v]: h,
|
|
318
|
+
[w]: [p, "name"]
|
|
319
|
+
}, "aws-us-gov"]
|
|
320
|
+
}],
|
|
321
|
+
endpoint: {
|
|
322
|
+
url: "https://portal.sso.{Region}.amazonaws.com",
|
|
323
|
+
properties: n,
|
|
324
|
+
headers: n
|
|
325
|
+
},
|
|
326
|
+
type: e
|
|
327
|
+
}, {
|
|
328
|
+
endpoint: {
|
|
329
|
+
url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",
|
|
330
|
+
properties: n,
|
|
331
|
+
headers: n
|
|
332
|
+
},
|
|
333
|
+
type: e
|
|
334
|
+
}],
|
|
335
|
+
type: f
|
|
336
|
+
}, {
|
|
337
|
+
error: "FIPS is enabled but this partition does not support FIPS",
|
|
338
|
+
type: d
|
|
339
|
+
}],
|
|
340
|
+
type: f
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
conditions: s,
|
|
344
|
+
rules: [{
|
|
345
|
+
conditions: [q],
|
|
346
|
+
rules: [{
|
|
347
|
+
endpoint: {
|
|
348
|
+
url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",
|
|
349
|
+
properties: n,
|
|
350
|
+
headers: n
|
|
351
|
+
},
|
|
352
|
+
type: e
|
|
353
|
+
}],
|
|
354
|
+
type: f
|
|
355
|
+
}, {
|
|
356
|
+
error: "DualStack is enabled but this partition does not support DualStack",
|
|
357
|
+
type: d
|
|
358
|
+
}],
|
|
359
|
+
type: f
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
endpoint: {
|
|
363
|
+
url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",
|
|
364
|
+
properties: n,
|
|
365
|
+
headers: n
|
|
366
|
+
},
|
|
367
|
+
type: e
|
|
368
|
+
}
|
|
369
|
+
],
|
|
370
|
+
type: f
|
|
371
|
+
}],
|
|
372
|
+
type: f
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
error: "Invalid Configuration: Missing Region",
|
|
376
|
+
type: d
|
|
377
|
+
}
|
|
378
|
+
]
|
|
379
|
+
};
|
|
380
|
+
ruleSet = _data;
|
|
381
|
+
}));
|
|
382
|
+
|
|
383
|
+
//#endregion
|
|
384
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.996.10/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/endpointResolver.js
|
|
385
|
+
var import_dist_cjs$30, import_dist_cjs$31, cache, defaultEndpointResolver;
|
|
386
|
+
var init_endpointResolver = __esmMin((() => {
|
|
387
|
+
import_dist_cjs$30 = require_dist_cjs$3();
|
|
388
|
+
import_dist_cjs$31 = require_dist_cjs$4();
|
|
389
|
+
init_ruleset();
|
|
390
|
+
cache = new import_dist_cjs$31.EndpointCache({
|
|
391
|
+
size: 50,
|
|
392
|
+
params: [
|
|
393
|
+
"Endpoint",
|
|
394
|
+
"Region",
|
|
395
|
+
"UseDualStack",
|
|
396
|
+
"UseFIPS"
|
|
397
|
+
]
|
|
398
|
+
});
|
|
399
|
+
defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
400
|
+
return cache.get(endpointParams, () => (0, import_dist_cjs$31.resolveEndpoint)(ruleSet, {
|
|
401
|
+
endpointParams,
|
|
402
|
+
logger: context.logger
|
|
403
|
+
}));
|
|
404
|
+
};
|
|
405
|
+
import_dist_cjs$31.customEndpointFunctions.aws = import_dist_cjs$30.awsEndpointFunctions;
|
|
406
|
+
}));
|
|
407
|
+
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.996.10/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/SSOServiceException.js
|
|
410
|
+
var import_dist_cjs$29, SSOServiceException;
|
|
411
|
+
var init_SSOServiceException = __esmMin((() => {
|
|
412
|
+
import_dist_cjs$29 = require_dist_cjs$20();
|
|
413
|
+
SSOServiceException = class SSOServiceException extends import_dist_cjs$29.ServiceException {
|
|
414
|
+
constructor(options) {
|
|
415
|
+
super(options);
|
|
416
|
+
Object.setPrototypeOf(this, SSOServiceException.prototype);
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
}));
|
|
420
|
+
|
|
421
|
+
//#endregion
|
|
422
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.996.10/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/errors.js
|
|
423
|
+
var InvalidRequestException, ResourceNotFoundException, TooManyRequestsException, UnauthorizedException;
|
|
424
|
+
var init_errors = __esmMin((() => {
|
|
425
|
+
init_SSOServiceException();
|
|
426
|
+
InvalidRequestException = class InvalidRequestException extends SSOServiceException {
|
|
427
|
+
name = "InvalidRequestException";
|
|
428
|
+
$fault = "client";
|
|
429
|
+
constructor(opts) {
|
|
430
|
+
super({
|
|
431
|
+
name: "InvalidRequestException",
|
|
432
|
+
$fault: "client",
|
|
433
|
+
...opts
|
|
434
|
+
});
|
|
435
|
+
Object.setPrototypeOf(this, InvalidRequestException.prototype);
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
ResourceNotFoundException = class ResourceNotFoundException extends SSOServiceException {
|
|
439
|
+
name = "ResourceNotFoundException";
|
|
440
|
+
$fault = "client";
|
|
441
|
+
constructor(opts) {
|
|
442
|
+
super({
|
|
443
|
+
name: "ResourceNotFoundException",
|
|
444
|
+
$fault: "client",
|
|
445
|
+
...opts
|
|
446
|
+
});
|
|
447
|
+
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
TooManyRequestsException = class TooManyRequestsException extends SSOServiceException {
|
|
451
|
+
name = "TooManyRequestsException";
|
|
452
|
+
$fault = "client";
|
|
453
|
+
constructor(opts) {
|
|
454
|
+
super({
|
|
455
|
+
name: "TooManyRequestsException",
|
|
456
|
+
$fault: "client",
|
|
457
|
+
...opts
|
|
458
|
+
});
|
|
459
|
+
Object.setPrototypeOf(this, TooManyRequestsException.prototype);
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
UnauthorizedException = class UnauthorizedException extends SSOServiceException {
|
|
463
|
+
name = "UnauthorizedException";
|
|
464
|
+
$fault = "client";
|
|
465
|
+
constructor(opts) {
|
|
466
|
+
super({
|
|
467
|
+
name: "UnauthorizedException",
|
|
468
|
+
$fault: "client",
|
|
469
|
+
...opts
|
|
470
|
+
});
|
|
471
|
+
Object.setPrototypeOf(this, UnauthorizedException.prototype);
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
}));
|
|
475
|
+
|
|
476
|
+
//#endregion
|
|
477
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.996.10/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/schemas/schemas_0.js
|
|
478
|
+
var _ATT, _GRC, _GRCR, _GRCRe, _IRE, _RC, _RNFE, _SAKT, _STT, _TMRE, _UE, _aI, _aKI, _aT, _ai, _c, _e, _ex, _h, _hE, _hH, _hQ, _m, _rC, _rN, _rn, _s, _sAK, _sT, _xasbt, n0, _s_registry, SSOServiceException$, n0_registry, InvalidRequestException$, ResourceNotFoundException$, TooManyRequestsException$, UnauthorizedException$, errorTypeRegistries, AccessTokenType, SecretAccessKeyType, SessionTokenType, GetRoleCredentialsRequest$, GetRoleCredentialsResponse$, RoleCredentials$, GetRoleCredentials$;
|
|
479
|
+
var init_schemas_0 = __esmMin((() => {
|
|
480
|
+
init_schema();
|
|
481
|
+
init_errors();
|
|
482
|
+
init_SSOServiceException();
|
|
483
|
+
_ATT = "AccessTokenType";
|
|
484
|
+
_GRC = "GetRoleCredentials";
|
|
485
|
+
_GRCR = "GetRoleCredentialsRequest";
|
|
486
|
+
_GRCRe = "GetRoleCredentialsResponse";
|
|
487
|
+
_IRE = "InvalidRequestException";
|
|
488
|
+
_RC = "RoleCredentials";
|
|
489
|
+
_RNFE = "ResourceNotFoundException";
|
|
490
|
+
_SAKT = "SecretAccessKeyType";
|
|
491
|
+
_STT = "SessionTokenType";
|
|
492
|
+
_TMRE = "TooManyRequestsException";
|
|
493
|
+
_UE = "UnauthorizedException";
|
|
494
|
+
_aI = "accountId";
|
|
495
|
+
_aKI = "accessKeyId";
|
|
496
|
+
_aT = "accessToken";
|
|
497
|
+
_ai = "account_id";
|
|
498
|
+
_c = "client";
|
|
499
|
+
_e = "error";
|
|
500
|
+
_ex = "expiration";
|
|
501
|
+
_h = "http";
|
|
502
|
+
_hE = "httpError";
|
|
503
|
+
_hH = "httpHeader";
|
|
504
|
+
_hQ = "httpQuery";
|
|
505
|
+
_m = "message";
|
|
506
|
+
_rC = "roleCredentials";
|
|
507
|
+
_rN = "roleName";
|
|
508
|
+
_rn = "role_name";
|
|
509
|
+
_s = "smithy.ts.sdk.synthetic.com.amazonaws.sso";
|
|
510
|
+
_sAK = "secretAccessKey";
|
|
511
|
+
_sT = "sessionToken";
|
|
512
|
+
_xasbt = "x-amz-sso_bearer_token";
|
|
513
|
+
n0 = "com.amazonaws.sso";
|
|
514
|
+
_s_registry = TypeRegistry.for(_s);
|
|
515
|
+
SSOServiceException$ = [
|
|
516
|
+
-3,
|
|
517
|
+
_s,
|
|
518
|
+
"SSOServiceException",
|
|
519
|
+
0,
|
|
520
|
+
[],
|
|
521
|
+
[]
|
|
522
|
+
];
|
|
523
|
+
_s_registry.registerError(SSOServiceException$, SSOServiceException);
|
|
524
|
+
n0_registry = TypeRegistry.for(n0);
|
|
525
|
+
InvalidRequestException$ = [
|
|
526
|
+
-3,
|
|
527
|
+
n0,
|
|
528
|
+
_IRE,
|
|
529
|
+
{
|
|
530
|
+
[_e]: _c,
|
|
531
|
+
[_hE]: 400
|
|
532
|
+
},
|
|
533
|
+
[_m],
|
|
534
|
+
[0]
|
|
535
|
+
];
|
|
536
|
+
n0_registry.registerError(InvalidRequestException$, InvalidRequestException);
|
|
537
|
+
ResourceNotFoundException$ = [
|
|
538
|
+
-3,
|
|
539
|
+
n0,
|
|
540
|
+
_RNFE,
|
|
541
|
+
{
|
|
542
|
+
[_e]: _c,
|
|
543
|
+
[_hE]: 404
|
|
544
|
+
},
|
|
545
|
+
[_m],
|
|
546
|
+
[0]
|
|
547
|
+
];
|
|
548
|
+
n0_registry.registerError(ResourceNotFoundException$, ResourceNotFoundException);
|
|
549
|
+
TooManyRequestsException$ = [
|
|
550
|
+
-3,
|
|
551
|
+
n0,
|
|
552
|
+
_TMRE,
|
|
553
|
+
{
|
|
554
|
+
[_e]: _c,
|
|
555
|
+
[_hE]: 429
|
|
556
|
+
},
|
|
557
|
+
[_m],
|
|
558
|
+
[0]
|
|
559
|
+
];
|
|
560
|
+
n0_registry.registerError(TooManyRequestsException$, TooManyRequestsException);
|
|
561
|
+
UnauthorizedException$ = [
|
|
562
|
+
-3,
|
|
563
|
+
n0,
|
|
564
|
+
_UE,
|
|
565
|
+
{
|
|
566
|
+
[_e]: _c,
|
|
567
|
+
[_hE]: 401
|
|
568
|
+
},
|
|
569
|
+
[_m],
|
|
570
|
+
[0]
|
|
571
|
+
];
|
|
572
|
+
n0_registry.registerError(UnauthorizedException$, UnauthorizedException);
|
|
573
|
+
errorTypeRegistries = [_s_registry, n0_registry];
|
|
574
|
+
AccessTokenType = [
|
|
575
|
+
0,
|
|
576
|
+
n0,
|
|
577
|
+
_ATT,
|
|
578
|
+
8,
|
|
579
|
+
0
|
|
580
|
+
];
|
|
581
|
+
SecretAccessKeyType = [
|
|
582
|
+
0,
|
|
583
|
+
n0,
|
|
584
|
+
_SAKT,
|
|
585
|
+
8,
|
|
586
|
+
0
|
|
587
|
+
];
|
|
588
|
+
SessionTokenType = [
|
|
589
|
+
0,
|
|
590
|
+
n0,
|
|
591
|
+
_STT,
|
|
592
|
+
8,
|
|
593
|
+
0
|
|
594
|
+
];
|
|
595
|
+
GetRoleCredentialsRequest$ = [
|
|
596
|
+
3,
|
|
597
|
+
n0,
|
|
598
|
+
_GRCR,
|
|
599
|
+
0,
|
|
600
|
+
[
|
|
601
|
+
_rN,
|
|
602
|
+
_aI,
|
|
603
|
+
_aT
|
|
604
|
+
],
|
|
605
|
+
[
|
|
606
|
+
[0, { [_hQ]: _rn }],
|
|
607
|
+
[0, { [_hQ]: _ai }],
|
|
608
|
+
[() => AccessTokenType, { [_hH]: _xasbt }]
|
|
609
|
+
],
|
|
610
|
+
3
|
|
611
|
+
];
|
|
612
|
+
GetRoleCredentialsResponse$ = [
|
|
613
|
+
3,
|
|
614
|
+
n0,
|
|
615
|
+
_GRCRe,
|
|
616
|
+
0,
|
|
617
|
+
[_rC],
|
|
618
|
+
[[() => RoleCredentials$, 0]]
|
|
619
|
+
];
|
|
620
|
+
RoleCredentials$ = [
|
|
621
|
+
3,
|
|
622
|
+
n0,
|
|
623
|
+
_RC,
|
|
624
|
+
0,
|
|
625
|
+
[
|
|
626
|
+
_aKI,
|
|
627
|
+
_sAK,
|
|
628
|
+
_sT,
|
|
629
|
+
_ex
|
|
630
|
+
],
|
|
631
|
+
[
|
|
632
|
+
0,
|
|
633
|
+
[() => SecretAccessKeyType, 0],
|
|
634
|
+
[() => SessionTokenType, 0],
|
|
635
|
+
1
|
|
636
|
+
]
|
|
637
|
+
];
|
|
638
|
+
GetRoleCredentials$ = [
|
|
639
|
+
9,
|
|
640
|
+
n0,
|
|
641
|
+
_GRC,
|
|
642
|
+
{ [_h]: [
|
|
643
|
+
"GET",
|
|
644
|
+
"/federation/credentials",
|
|
645
|
+
200
|
|
646
|
+
] },
|
|
647
|
+
() => GetRoleCredentialsRequest$,
|
|
648
|
+
() => GetRoleCredentialsResponse$
|
|
649
|
+
];
|
|
650
|
+
}));
|
|
651
|
+
|
|
652
|
+
//#endregion
|
|
653
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.996.10/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.shared.js
|
|
654
|
+
var import_dist_cjs$25, import_dist_cjs$26, import_dist_cjs$27, import_dist_cjs$28, getRuntimeConfig$1;
|
|
655
|
+
var init_runtimeConfig_shared = __esmMin((() => {
|
|
656
|
+
init_dist_es();
|
|
657
|
+
init_protocols();
|
|
658
|
+
init_dist_es$1();
|
|
659
|
+
import_dist_cjs$25 = require_dist_cjs$20();
|
|
660
|
+
import_dist_cjs$26 = require_dist_cjs$24();
|
|
661
|
+
import_dist_cjs$27 = require_dist_cjs$21();
|
|
662
|
+
import_dist_cjs$28 = require_dist_cjs$23();
|
|
663
|
+
init_httpAuthSchemeProvider();
|
|
664
|
+
init_endpointResolver();
|
|
665
|
+
init_schemas_0();
|
|
666
|
+
getRuntimeConfig$1 = (config) => {
|
|
667
|
+
return {
|
|
668
|
+
apiVersion: "2019-06-10",
|
|
669
|
+
base64Decoder: config?.base64Decoder ?? import_dist_cjs$27.fromBase64,
|
|
670
|
+
base64Encoder: config?.base64Encoder ?? import_dist_cjs$27.toBase64,
|
|
671
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
672
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
673
|
+
extensions: config?.extensions ?? [],
|
|
674
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSSOHttpAuthSchemeProvider,
|
|
675
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [{
|
|
676
|
+
schemeId: "aws.auth#sigv4",
|
|
677
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
678
|
+
signer: new AwsSdkSigV4Signer()
|
|
679
|
+
}, {
|
|
680
|
+
schemeId: "smithy.api#noAuth",
|
|
681
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
682
|
+
signer: new NoAuthSigner()
|
|
683
|
+
}],
|
|
684
|
+
logger: config?.logger ?? new import_dist_cjs$25.NoOpLogger(),
|
|
685
|
+
protocol: config?.protocol ?? AwsRestJsonProtocol,
|
|
686
|
+
protocolSettings: config?.protocolSettings ?? {
|
|
687
|
+
defaultNamespace: "com.amazonaws.sso",
|
|
688
|
+
errorTypeRegistries,
|
|
689
|
+
version: "2019-06-10",
|
|
690
|
+
serviceTarget: "SWBPortalService"
|
|
691
|
+
},
|
|
692
|
+
serviceId: config?.serviceId ?? "SSO",
|
|
693
|
+
urlParser: config?.urlParser ?? import_dist_cjs$26.parseUrl,
|
|
694
|
+
utf8Decoder: config?.utf8Decoder ?? import_dist_cjs$28.fromUtf8,
|
|
695
|
+
utf8Encoder: config?.utf8Encoder ?? import_dist_cjs$28.toUtf8
|
|
696
|
+
};
|
|
697
|
+
};
|
|
698
|
+
}));
|
|
699
|
+
|
|
700
|
+
//#endregion
|
|
701
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.996.10/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js
|
|
702
|
+
var import_dist_cjs$15, import_dist_cjs$16, import_dist_cjs$17, import_dist_cjs$18, import_dist_cjs$19, import_dist_cjs$20, import_dist_cjs$21, import_dist_cjs$22, import_dist_cjs$23, import_dist_cjs$24, getRuntimeConfig;
|
|
703
|
+
var init_runtimeConfig = __esmMin((() => {
|
|
704
|
+
init_dist_es();
|
|
705
|
+
import_dist_cjs$15 = require_dist_cjs$5();
|
|
706
|
+
import_dist_cjs$16 = require_dist_cjs$6();
|
|
707
|
+
import_dist_cjs$17 = require_dist_cjs$7();
|
|
708
|
+
import_dist_cjs$18 = require_dist_cjs$8();
|
|
709
|
+
import_dist_cjs$19 = require_dist_cjs$27();
|
|
710
|
+
import_dist_cjs$20 = require_dist_cjs$22();
|
|
711
|
+
import_dist_cjs$21 = require_dist_cjs$20();
|
|
712
|
+
import_dist_cjs$22 = require_dist_cjs$9();
|
|
713
|
+
import_dist_cjs$23 = require_dist_cjs$10();
|
|
714
|
+
import_dist_cjs$24 = require_dist_cjs$11();
|
|
715
|
+
init_runtimeConfig_shared();
|
|
716
|
+
getRuntimeConfig = (config) => {
|
|
717
|
+
(0, import_dist_cjs$21.emitWarningIfUnsupportedVersion)(process.version);
|
|
718
|
+
const defaultsMode = (0, import_dist_cjs$23.resolveDefaultsModeConfig)(config);
|
|
719
|
+
const defaultConfigProvider = () => defaultsMode().then(import_dist_cjs$21.loadConfigsForDefaultMode);
|
|
720
|
+
const clientSharedValues = getRuntimeConfig$1(config);
|
|
721
|
+
emitWarningIfUnsupportedVersion$1(process.version);
|
|
722
|
+
const loaderConfig = {
|
|
723
|
+
profile: config?.profile,
|
|
724
|
+
logger: clientSharedValues.logger
|
|
725
|
+
};
|
|
726
|
+
return {
|
|
727
|
+
...clientSharedValues,
|
|
728
|
+
...config,
|
|
729
|
+
runtime: "node",
|
|
730
|
+
defaultsMode,
|
|
731
|
+
authSchemePreference: config?.authSchemePreference ?? (0, import_dist_cjs$19.loadConfig)(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
732
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? import_dist_cjs$22.calculateBodyLength,
|
|
733
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, import_dist_cjs$15.createDefaultUserAgentProvider)({
|
|
734
|
+
serviceId: clientSharedValues.serviceId,
|
|
735
|
+
clientVersion: version
|
|
736
|
+
}),
|
|
737
|
+
maxAttempts: config?.maxAttempts ?? (0, import_dist_cjs$19.loadConfig)(import_dist_cjs$18.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
738
|
+
region: config?.region ?? (0, import_dist_cjs$19.loadConfig)(import_dist_cjs$16.NODE_REGION_CONFIG_OPTIONS, {
|
|
739
|
+
...import_dist_cjs$16.NODE_REGION_CONFIG_FILE_OPTIONS,
|
|
740
|
+
...loaderConfig
|
|
741
|
+
}),
|
|
742
|
+
requestHandler: import_dist_cjs$20.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
743
|
+
retryMode: config?.retryMode ?? (0, import_dist_cjs$19.loadConfig)({
|
|
744
|
+
...import_dist_cjs$18.NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
745
|
+
default: async () => (await defaultConfigProvider()).retryMode || import_dist_cjs$24.DEFAULT_RETRY_MODE
|
|
746
|
+
}, config),
|
|
747
|
+
sha256: config?.sha256 ?? import_dist_cjs$17.Hash.bind(null, "sha256"),
|
|
748
|
+
streamCollector: config?.streamCollector ?? import_dist_cjs$20.streamCollector,
|
|
749
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, import_dist_cjs$19.loadConfig)(import_dist_cjs$16.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
750
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (0, import_dist_cjs$19.loadConfig)(import_dist_cjs$16.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
751
|
+
userAgentAppId: config?.userAgentAppId ?? (0, import_dist_cjs$19.loadConfig)(import_dist_cjs$15.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig)
|
|
752
|
+
};
|
|
753
|
+
};
|
|
754
|
+
}));
|
|
755
|
+
|
|
756
|
+
//#endregion
|
|
757
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.996.10/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/auth/httpAuthExtensionConfiguration.js
|
|
758
|
+
var getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig;
|
|
759
|
+
var init_httpAuthExtensionConfiguration = __esmMin((() => {
|
|
760
|
+
getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
761
|
+
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
762
|
+
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
763
|
+
let _credentials = runtimeConfig.credentials;
|
|
764
|
+
return {
|
|
765
|
+
setHttpAuthScheme(httpAuthScheme) {
|
|
766
|
+
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
767
|
+
if (index === -1) _httpAuthSchemes.push(httpAuthScheme);
|
|
768
|
+
else _httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
769
|
+
},
|
|
770
|
+
httpAuthSchemes() {
|
|
771
|
+
return _httpAuthSchemes;
|
|
772
|
+
},
|
|
773
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
774
|
+
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
775
|
+
},
|
|
776
|
+
httpAuthSchemeProvider() {
|
|
777
|
+
return _httpAuthSchemeProvider;
|
|
778
|
+
},
|
|
779
|
+
setCredentials(credentials) {
|
|
780
|
+
_credentials = credentials;
|
|
781
|
+
},
|
|
782
|
+
credentials() {
|
|
783
|
+
return _credentials;
|
|
784
|
+
}
|
|
785
|
+
};
|
|
786
|
+
};
|
|
787
|
+
resolveHttpAuthRuntimeConfig = (config) => {
|
|
788
|
+
return {
|
|
789
|
+
httpAuthSchemes: config.httpAuthSchemes(),
|
|
790
|
+
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
791
|
+
credentials: config.credentials()
|
|
792
|
+
};
|
|
793
|
+
};
|
|
794
|
+
}));
|
|
795
|
+
|
|
796
|
+
//#endregion
|
|
797
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.996.10/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeExtensions.js
|
|
798
|
+
var import_dist_cjs$12, import_dist_cjs$13, import_dist_cjs$14, resolveRuntimeExtensions;
|
|
799
|
+
var init_runtimeExtensions = __esmMin((() => {
|
|
800
|
+
import_dist_cjs$12 = require_dist_cjs$12();
|
|
801
|
+
import_dist_cjs$13 = require_dist_cjs$2();
|
|
802
|
+
import_dist_cjs$14 = require_dist_cjs$20();
|
|
803
|
+
init_httpAuthExtensionConfiguration();
|
|
804
|
+
resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
805
|
+
const extensionConfiguration = Object.assign((0, import_dist_cjs$12.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, import_dist_cjs$14.getDefaultExtensionConfiguration)(runtimeConfig), (0, import_dist_cjs$13.getHttpHandlerExtensionConfiguration)(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
|
|
806
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
807
|
+
return Object.assign(runtimeConfig, (0, import_dist_cjs$12.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, import_dist_cjs$14.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, import_dist_cjs$13.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
|
|
808
|
+
};
|
|
809
|
+
}));
|
|
810
|
+
|
|
811
|
+
//#endregion
|
|
812
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.996.10/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSOClient.js
|
|
813
|
+
var import_dist_cjs$3, import_dist_cjs$4, import_dist_cjs$5, import_dist_cjs$6, import_dist_cjs$7, import_dist_cjs$8, import_dist_cjs$9, import_dist_cjs$10, import_dist_cjs$11, SSOClient;
|
|
814
|
+
var init_SSOClient = __esmMin((() => {
|
|
815
|
+
import_dist_cjs$3 = require_dist_cjs$13();
|
|
816
|
+
import_dist_cjs$4 = require_dist_cjs$14();
|
|
817
|
+
import_dist_cjs$5 = require_dist_cjs$15();
|
|
818
|
+
import_dist_cjs$6 = require_dist_cjs$16();
|
|
819
|
+
import_dist_cjs$7 = require_dist_cjs$6();
|
|
820
|
+
init_dist_es$1();
|
|
821
|
+
init_schema();
|
|
822
|
+
import_dist_cjs$8 = require_dist_cjs$17();
|
|
823
|
+
import_dist_cjs$9 = require_dist_cjs$18();
|
|
824
|
+
import_dist_cjs$10 = require_dist_cjs$8();
|
|
825
|
+
import_dist_cjs$11 = require_dist_cjs$20();
|
|
826
|
+
init_httpAuthSchemeProvider();
|
|
827
|
+
init_EndpointParameters();
|
|
828
|
+
init_runtimeConfig();
|
|
829
|
+
init_runtimeExtensions();
|
|
830
|
+
SSOClient = class extends import_dist_cjs$11.Client {
|
|
831
|
+
config;
|
|
832
|
+
constructor(...[configuration]) {
|
|
833
|
+
const _config_0 = getRuntimeConfig(configuration || {});
|
|
834
|
+
super(_config_0);
|
|
835
|
+
this.initConfig = _config_0;
|
|
836
|
+
this.config = resolveRuntimeExtensions(resolveHttpAuthSchemeConfig((0, import_dist_cjs$9.resolveEndpointConfig)((0, import_dist_cjs$3.resolveHostHeaderConfig)((0, import_dist_cjs$7.resolveRegionConfig)((0, import_dist_cjs$10.resolveRetryConfig)((0, import_dist_cjs$6.resolveUserAgentConfig)(resolveClientEndpointParameters(_config_0))))))), configuration?.extensions || []);
|
|
837
|
+
this.middlewareStack.use(getSchemaSerdePlugin(this.config));
|
|
838
|
+
this.middlewareStack.use((0, import_dist_cjs$6.getUserAgentPlugin)(this.config));
|
|
839
|
+
this.middlewareStack.use((0, import_dist_cjs$10.getRetryPlugin)(this.config));
|
|
840
|
+
this.middlewareStack.use((0, import_dist_cjs$8.getContentLengthPlugin)(this.config));
|
|
841
|
+
this.middlewareStack.use((0, import_dist_cjs$3.getHostHeaderPlugin)(this.config));
|
|
842
|
+
this.middlewareStack.use((0, import_dist_cjs$4.getLoggerPlugin)(this.config));
|
|
843
|
+
this.middlewareStack.use((0, import_dist_cjs$5.getRecursionDetectionPlugin)(this.config));
|
|
844
|
+
this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
845
|
+
httpAuthSchemeParametersProvider: defaultSSOHttpAuthSchemeParametersProvider,
|
|
846
|
+
identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({ "aws.auth#sigv4": config.credentials })
|
|
847
|
+
}));
|
|
848
|
+
this.middlewareStack.use(getHttpSigningPlugin(this.config));
|
|
849
|
+
}
|
|
850
|
+
destroy() {
|
|
851
|
+
super.destroy();
|
|
852
|
+
}
|
|
853
|
+
};
|
|
854
|
+
}));
|
|
855
|
+
|
|
856
|
+
//#endregion
|
|
857
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.996.10/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commands/GetRoleCredentialsCommand.js
|
|
858
|
+
var import_dist_cjs$1, import_dist_cjs$2, GetRoleCredentialsCommand;
|
|
859
|
+
var init_GetRoleCredentialsCommand = __esmMin((() => {
|
|
860
|
+
import_dist_cjs$1 = require_dist_cjs$18();
|
|
861
|
+
import_dist_cjs$2 = require_dist_cjs$20();
|
|
862
|
+
init_EndpointParameters();
|
|
863
|
+
init_schemas_0();
|
|
864
|
+
GetRoleCredentialsCommand = class extends import_dist_cjs$2.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o$1) {
|
|
865
|
+
return [(0, import_dist_cjs$1.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())];
|
|
866
|
+
}).s("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").sc(GetRoleCredentials$).build() {};
|
|
867
|
+
}));
|
|
868
|
+
|
|
869
|
+
//#endregion
|
|
870
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.996.10/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSO.js
|
|
871
|
+
var import_dist_cjs, commands, SSO;
|
|
872
|
+
var init_SSO = __esmMin((() => {
|
|
873
|
+
import_dist_cjs = require_dist_cjs$20();
|
|
874
|
+
init_GetRoleCredentialsCommand();
|
|
875
|
+
init_SSOClient();
|
|
876
|
+
commands = { GetRoleCredentialsCommand };
|
|
877
|
+
SSO = class extends SSOClient {};
|
|
878
|
+
(0, import_dist_cjs.createAggregatedClient)(commands, SSO);
|
|
879
|
+
}));
|
|
880
|
+
|
|
881
|
+
//#endregion
|
|
882
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.996.10/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commands/index.js
|
|
883
|
+
var init_commands = __esmMin((() => {
|
|
884
|
+
init_GetRoleCredentialsCommand();
|
|
885
|
+
}));
|
|
886
|
+
|
|
887
|
+
//#endregion
|
|
888
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.996.10/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/models_0.js
|
|
889
|
+
var init_models_0 = __esmMin((() => {}));
|
|
890
|
+
|
|
891
|
+
//#endregion
|
|
892
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.996.10/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/index.js
|
|
893
|
+
var sso_exports = /* @__PURE__ */ __exportAll({
|
|
894
|
+
$Command: () => import_dist_cjs$2.Command,
|
|
895
|
+
GetRoleCredentials$: () => GetRoleCredentials$,
|
|
896
|
+
GetRoleCredentialsCommand: () => GetRoleCredentialsCommand,
|
|
897
|
+
GetRoleCredentialsRequest$: () => GetRoleCredentialsRequest$,
|
|
898
|
+
GetRoleCredentialsResponse$: () => GetRoleCredentialsResponse$,
|
|
899
|
+
InvalidRequestException: () => InvalidRequestException,
|
|
900
|
+
InvalidRequestException$: () => InvalidRequestException$,
|
|
901
|
+
ResourceNotFoundException: () => ResourceNotFoundException,
|
|
902
|
+
ResourceNotFoundException$: () => ResourceNotFoundException$,
|
|
903
|
+
RoleCredentials$: () => RoleCredentials$,
|
|
904
|
+
SSO: () => SSO,
|
|
905
|
+
SSOClient: () => SSOClient,
|
|
906
|
+
SSOServiceException: () => SSOServiceException,
|
|
907
|
+
SSOServiceException$: () => SSOServiceException$,
|
|
908
|
+
TooManyRequestsException: () => TooManyRequestsException,
|
|
909
|
+
TooManyRequestsException$: () => TooManyRequestsException$,
|
|
910
|
+
UnauthorizedException: () => UnauthorizedException,
|
|
911
|
+
UnauthorizedException$: () => UnauthorizedException$,
|
|
912
|
+
__Client: () => import_dist_cjs$11.Client,
|
|
913
|
+
errorTypeRegistries: () => errorTypeRegistries
|
|
914
|
+
});
|
|
915
|
+
var init_sso = __esmMin((() => {
|
|
916
|
+
init_SSOClient();
|
|
917
|
+
init_SSO();
|
|
918
|
+
init_commands();
|
|
919
|
+
init_schemas_0();
|
|
920
|
+
init_errors();
|
|
921
|
+
init_models_0();
|
|
922
|
+
init_SSOServiceException();
|
|
923
|
+
}));
|
|
924
|
+
|
|
925
|
+
//#endregion
|
|
926
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.972.20/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BKDNrsal.js
|
|
927
|
+
var require_loadSso_BKDNrsal = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
928
|
+
var sso = (init_sso(), __toCommonJS(sso_exports));
|
|
929
|
+
exports.GetRoleCredentialsCommand = sso.GetRoleCredentialsCommand;
|
|
930
|
+
exports.SSOClient = sso.SSOClient;
|
|
931
|
+
}));
|
|
932
|
+
|
|
933
|
+
//#endregion
|
|
934
|
+
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.972.20/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js
|
|
935
|
+
var require_dist_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
936
|
+
var propertyProvider = require_dist_cjs$25();
|
|
937
|
+
var sharedIniFileLoader = require_dist_cjs$26();
|
|
938
|
+
var client = (init_client(), __toCommonJS(client_exports));
|
|
939
|
+
var tokenProviders = require_dist_cjs$1();
|
|
940
|
+
const isSsoProfile = (arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string");
|
|
941
|
+
const SHOULD_FAIL_CREDENTIAL_CHAIN = false;
|
|
942
|
+
const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, callerClientConfig, profile, filepath, configFilepath, ignoreCache, logger }) => {
|
|
943
|
+
let token;
|
|
944
|
+
const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
|
|
945
|
+
if (ssoSession) try {
|
|
946
|
+
const _token = await tokenProviders.fromSso({
|
|
947
|
+
profile,
|
|
948
|
+
filepath,
|
|
949
|
+
configFilepath,
|
|
950
|
+
ignoreCache
|
|
951
|
+
})();
|
|
952
|
+
token = {
|
|
953
|
+
accessToken: _token.token,
|
|
954
|
+
expiresAt: new Date(_token.expiration).toISOString()
|
|
955
|
+
};
|
|
956
|
+
} catch (e$1) {
|
|
957
|
+
throw new propertyProvider.CredentialsProviderError(e$1.message, {
|
|
958
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
959
|
+
logger
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
else try {
|
|
963
|
+
token = await sharedIniFileLoader.getSSOTokenFromFile(ssoStartUrl);
|
|
964
|
+
} catch (e$1) {
|
|
965
|
+
throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, {
|
|
966
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
967
|
+
logger
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
if (new Date(token.expiresAt).getTime() - Date.now() <= 0) throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, {
|
|
971
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
972
|
+
logger
|
|
973
|
+
});
|
|
974
|
+
const { accessToken } = token;
|
|
975
|
+
const { SSOClient: SSOClient$1, GetRoleCredentialsCommand: GetRoleCredentialsCommand$1 } = await Promise.resolve().then(function() {
|
|
976
|
+
return require_loadSso_BKDNrsal();
|
|
977
|
+
});
|
|
978
|
+
const sso = ssoClient || new SSOClient$1(Object.assign({}, clientConfig ?? {}, {
|
|
979
|
+
logger: clientConfig?.logger ?? callerClientConfig?.logger ?? parentClientConfig?.logger,
|
|
980
|
+
region: clientConfig?.region ?? ssoRegion,
|
|
981
|
+
userAgentAppId: clientConfig?.userAgentAppId ?? callerClientConfig?.userAgentAppId ?? parentClientConfig?.userAgentAppId
|
|
982
|
+
}));
|
|
983
|
+
let ssoResp;
|
|
984
|
+
try {
|
|
985
|
+
ssoResp = await sso.send(new GetRoleCredentialsCommand$1({
|
|
986
|
+
accountId: ssoAccountId,
|
|
987
|
+
roleName: ssoRoleName,
|
|
988
|
+
accessToken
|
|
989
|
+
}));
|
|
990
|
+
} catch (e$1) {
|
|
991
|
+
throw new propertyProvider.CredentialsProviderError(e$1, {
|
|
992
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
993
|
+
logger
|
|
994
|
+
});
|
|
995
|
+
}
|
|
996
|
+
const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {} } = ssoResp;
|
|
997
|
+
if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) throw new propertyProvider.CredentialsProviderError("SSO returns an invalid temporary credential.", {
|
|
998
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
999
|
+
logger
|
|
1000
|
+
});
|
|
1001
|
+
const credentials = {
|
|
1002
|
+
accessKeyId,
|
|
1003
|
+
secretAccessKey,
|
|
1004
|
+
sessionToken,
|
|
1005
|
+
expiration: new Date(expiration),
|
|
1006
|
+
...credentialScope && { credentialScope },
|
|
1007
|
+
...accountId && { accountId }
|
|
1008
|
+
};
|
|
1009
|
+
if (ssoSession) client.setCredentialFeature(credentials, "CREDENTIALS_SSO", "s");
|
|
1010
|
+
else client.setCredentialFeature(credentials, "CREDENTIALS_SSO_LEGACY", "u");
|
|
1011
|
+
return credentials;
|
|
1012
|
+
};
|
|
1013
|
+
const validateSsoProfile = (profile, logger) => {
|
|
1014
|
+
const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;
|
|
1015
|
+
if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) throw new propertyProvider.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, {
|
|
1016
|
+
tryNextLink: false,
|
|
1017
|
+
logger
|
|
1018
|
+
});
|
|
1019
|
+
return profile;
|
|
1020
|
+
};
|
|
1021
|
+
const fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => {
|
|
1022
|
+
init.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");
|
|
1023
|
+
const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
|
|
1024
|
+
const { ssoClient } = init;
|
|
1025
|
+
const profileName = sharedIniFileLoader.getProfileName({ profile: init.profile ?? callerClientConfig?.profile });
|
|
1026
|
+
if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
|
|
1027
|
+
const profile = (await sharedIniFileLoader.parseKnownFiles(init))[profileName];
|
|
1028
|
+
if (!profile) throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger });
|
|
1029
|
+
if (!isSsoProfile(profile)) throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, { logger: init.logger });
|
|
1030
|
+
if (profile?.sso_session) {
|
|
1031
|
+
const session = (await sharedIniFileLoader.loadSsoSessionData(init))[profile.sso_session];
|
|
1032
|
+
const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`;
|
|
1033
|
+
if (ssoRegion && ssoRegion !== session.sso_region) throw new propertyProvider.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, {
|
|
1034
|
+
tryNextLink: false,
|
|
1035
|
+
logger: init.logger
|
|
1036
|
+
});
|
|
1037
|
+
if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) throw new propertyProvider.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, {
|
|
1038
|
+
tryNextLink: false,
|
|
1039
|
+
logger: init.logger
|
|
1040
|
+
});
|
|
1041
|
+
profile.sso_region = session.sso_region;
|
|
1042
|
+
profile.sso_start_url = session.sso_start_url;
|
|
1043
|
+
}
|
|
1044
|
+
const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile, init.logger);
|
|
1045
|
+
return resolveSSOCredentials({
|
|
1046
|
+
ssoStartUrl: sso_start_url,
|
|
1047
|
+
ssoSession: sso_session,
|
|
1048
|
+
ssoAccountId: sso_account_id,
|
|
1049
|
+
ssoRegion: sso_region,
|
|
1050
|
+
ssoRoleName: sso_role_name,
|
|
1051
|
+
ssoClient,
|
|
1052
|
+
clientConfig: init.clientConfig,
|
|
1053
|
+
parentClientConfig: init.parentClientConfig,
|
|
1054
|
+
callerClientConfig: init.callerClientConfig,
|
|
1055
|
+
profile: profileName,
|
|
1056
|
+
filepath: init.filepath,
|
|
1057
|
+
configFilepath: init.configFilepath,
|
|
1058
|
+
ignoreCache: init.ignoreCache,
|
|
1059
|
+
logger: init.logger
|
|
1060
|
+
});
|
|
1061
|
+
} else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) throw new propertyProvider.CredentialsProviderError("Incomplete configuration. The fromSSO() argument hash must include \"ssoStartUrl\", \"ssoAccountId\", \"ssoRegion\", \"ssoRoleName\"", {
|
|
1062
|
+
tryNextLink: false,
|
|
1063
|
+
logger: init.logger
|
|
1064
|
+
});
|
|
1065
|
+
else return resolveSSOCredentials({
|
|
1066
|
+
ssoStartUrl,
|
|
1067
|
+
ssoSession,
|
|
1068
|
+
ssoAccountId,
|
|
1069
|
+
ssoRegion,
|
|
1070
|
+
ssoRoleName,
|
|
1071
|
+
ssoClient,
|
|
1072
|
+
clientConfig: init.clientConfig,
|
|
1073
|
+
parentClientConfig: init.parentClientConfig,
|
|
1074
|
+
callerClientConfig: init.callerClientConfig,
|
|
1075
|
+
profile: profileName,
|
|
1076
|
+
filepath: init.filepath,
|
|
1077
|
+
configFilepath: init.configFilepath,
|
|
1078
|
+
ignoreCache: init.ignoreCache,
|
|
1079
|
+
logger: init.logger
|
|
1080
|
+
});
|
|
1081
|
+
};
|
|
1082
|
+
exports.fromSSO = fromSSO;
|
|
1083
|
+
exports.isSsoProfile = isSsoProfile;
|
|
1084
|
+
exports.validateSsoProfile = validateSsoProfile;
|
|
1085
|
+
}));
|
|
1086
|
+
|
|
1087
|
+
//#endregion
|
|
1088
|
+
export default require_dist_cjs();
|
|
1089
|
+
|
|
1090
|
+
export { };
|
|
1091
|
+
//# sourceMappingURL=dist-cjs-C-FMsqmo.mjs.map
|