@stacksjs/actions 0.70.10 → 0.70.12
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/build/core.js +1 -1
- package/dist/build.js +18 -3
- package/dist/{chunk-8swsxabt.js → chunk-0w5577pa.js} +63 -3
- package/dist/{chunk-fxan91t8.js → chunk-2dvnt46s.js} +31 -31
- package/dist/chunk-38cnnp2b.js +3823 -0
- package/dist/chunk-76zhb40c.js +92 -0
- package/dist/{chunk-v1qz355d.js → chunk-7exdh0pw.js} +4 -4
- package/dist/{chunk-6jdq6549.js → chunk-7hbpybtk.js} +18 -3
- package/dist/chunk-7s5qcjkt.js +105 -0
- package/dist/chunk-9exgwfkw.js +1283 -0
- package/dist/chunk-a13x0e43.js +1180 -0
- package/dist/chunk-a7k3cdby.js +2266 -0
- package/dist/chunk-bf8bq8pc.js +205 -0
- package/dist/chunk-csa76zyn.js +658 -0
- package/dist/chunk-e7mp4xy5.js +169 -0
- package/dist/chunk-f6a9g4qa.js +902 -0
- package/dist/chunk-frw3va9v.js +69 -0
- package/dist/chunk-hp8vmq3g.js +179242 -0
- package/dist/chunk-mdj7x1vs.js +790 -0
- package/dist/chunk-mdqphqep.js +438 -0
- package/dist/chunk-p0c688mg.js +729 -0
- package/dist/chunk-pnre7439.js +2228 -0
- package/dist/chunk-q9dmga3k.js +11 -0
- package/dist/chunk-qhh0v93n.js +73 -0
- package/dist/chunk-qkm8e752.js +51 -0
- package/dist/chunk-r1ednxa6.js +311 -0
- package/dist/chunk-saqpg5nd.js +118 -0
- package/dist/chunk-t5em30ak.js +379 -0
- package/dist/chunk-veja9rez.js +5764 -0
- package/dist/chunk-xt9exr2c.js +1481 -0
- package/dist/chunk-zbqapk7v.js +212 -0
- package/dist/chunk-zsm2c35w.js +72 -0
- package/dist/chunk-zzerxbrm.js +107 -0
- package/dist/database/seed.js +18 -3
- package/dist/deploy/index.js +1 -1
- package/dist/examples.js +1 -1
- package/dist/fresh.js +1 -1
- package/dist/generate/index.js +19 -4
- package/dist/helpers/component-meta.js +10 -10
- package/dist/helpers/lib-entries.js +1 -1
- package/dist/index.js +18 -3
- package/dist/key-generate.js +1 -1
- package/dist/lint/fix.js +1 -1
- package/dist/make.js +1 -1
- package/dist/prepublish.js +1 -1
- package/dist/release.js +18 -3
- package/dist/test/feature.js +1 -1
- package/dist/test/index.js +1 -1
- package/dist/test/unit.js +1 -1
- package/dist/types.js +1 -1
- package/dist/upgrade/index.js +1 -1
- package/dist/upgrade.js +2 -2
- package/package.json +17 -17
- package/dist/chunk-8tjc3whz.js +0 -77989
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// ../../../../node_modules/confbox/dist/shared/confbox.CiPrvALD.mjs
|
|
2
|
+
var b = /^(?:( )+|\t+)/;
|
|
3
|
+
var d = "space";
|
|
4
|
+
var h = "tab";
|
|
5
|
+
function g(e, t) {
|
|
6
|
+
const n = new Map;
|
|
7
|
+
let s = 0, o, i;
|
|
8
|
+
for (const c of e.split(/\n/g)) {
|
|
9
|
+
if (!c)
|
|
10
|
+
continue;
|
|
11
|
+
let f, a, l, p, r;
|
|
12
|
+
const y = c.match(b);
|
|
13
|
+
if (y === null)
|
|
14
|
+
s = 0, o = "";
|
|
15
|
+
else {
|
|
16
|
+
if (f = y[0].length, a = y[1] ? d : h, t && a === d && f === 1)
|
|
17
|
+
continue;
|
|
18
|
+
a !== o && (s = 0), o = a, l = 1, p = 0;
|
|
19
|
+
const u = f - s;
|
|
20
|
+
if (s = f, u === 0)
|
|
21
|
+
l = 0, p = 1;
|
|
22
|
+
else {
|
|
23
|
+
const I = u > 0 ? u : -u;
|
|
24
|
+
i = T(a, I);
|
|
25
|
+
}
|
|
26
|
+
r = n.get(i), r = r === undefined ? [1, 0] : [r[0] + l, r[1] + p], n.set(i, r);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return n;
|
|
30
|
+
}
|
|
31
|
+
function T(e, t) {
|
|
32
|
+
return (e === d ? "s" : "t") + String(t);
|
|
33
|
+
}
|
|
34
|
+
function w(e) {
|
|
35
|
+
const n = e[0] === "s" ? d : h, s = Number(e.slice(1));
|
|
36
|
+
return { type: n, amount: s };
|
|
37
|
+
}
|
|
38
|
+
function E(e) {
|
|
39
|
+
let t, n = 0, s = 0;
|
|
40
|
+
for (const [o, [i, c]] of e)
|
|
41
|
+
(i > n || i === n && c > s) && (n = i, s = c, t = o);
|
|
42
|
+
return t;
|
|
43
|
+
}
|
|
44
|
+
function S(e, t) {
|
|
45
|
+
return (e === d ? " " : "\t").repeat(t);
|
|
46
|
+
}
|
|
47
|
+
function _(e) {
|
|
48
|
+
if (typeof e != "string")
|
|
49
|
+
throw new TypeError("Expected a string");
|
|
50
|
+
let t = g(e, true);
|
|
51
|
+
t.size === 0 && (t = g(e, false));
|
|
52
|
+
const n = E(t);
|
|
53
|
+
let s, o = 0, i = "";
|
|
54
|
+
return n !== undefined && ({ type: s, amount: o } = w(n), i = S(s, o)), { amount: o, type: s, indent: i };
|
|
55
|
+
}
|
|
56
|
+
var m = Symbol.for("__confbox_fmt__");
|
|
57
|
+
var k = /^(\s+)/;
|
|
58
|
+
var v = /(\s+)$/;
|
|
59
|
+
function x(e, t = {}) {
|
|
60
|
+
const n = t.indent === undefined && t.preserveIndentation !== false && e.slice(0, t?.sampleSize || 1024), s = t.preserveWhitespace === false ? undefined : { start: k.exec(e)?.[0] || "", end: v.exec(e)?.[0] || "" };
|
|
61
|
+
return { sample: n, whiteSpace: s };
|
|
62
|
+
}
|
|
63
|
+
function N(e, t, n) {
|
|
64
|
+
!t || typeof t != "object" || Object.defineProperty(t, m, { enumerable: false, configurable: true, writable: true, value: x(e, n) });
|
|
65
|
+
}
|
|
66
|
+
function C(e, t) {
|
|
67
|
+
if (!e || typeof e != "object" || !(m in e))
|
|
68
|
+
return { indent: t?.indent, whitespace: { start: "", end: "" } };
|
|
69
|
+
const n = e[m];
|
|
70
|
+
return { indent: t?.indent || _(n.sample || "").indent, whitespace: n.whiteSpace || { start: "", end: "" } };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { N, C };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
CredentialsProviderError
|
|
4
|
+
} from "./chunk-zzerxbrm.js";
|
|
5
|
+
import {
|
|
6
|
+
require_client
|
|
7
|
+
} from "./chunk-frw3va9v.js";
|
|
8
|
+
import {
|
|
9
|
+
__toESM
|
|
10
|
+
} from "./chunk-9v6qtbez.js";
|
|
11
|
+
|
|
12
|
+
// ../../../../node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js
|
|
13
|
+
var import_client = __toESM(require_client(), 1);
|
|
14
|
+
var ENV_KEY = "AWS_ACCESS_KEY_ID";
|
|
15
|
+
var ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
|
|
16
|
+
var ENV_SESSION = "AWS_SESSION_TOKEN";
|
|
17
|
+
var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION";
|
|
18
|
+
var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE";
|
|
19
|
+
var ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID";
|
|
20
|
+
var fromEnv = (init) => async () => {
|
|
21
|
+
init?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");
|
|
22
|
+
const accessKeyId = process.env[ENV_KEY];
|
|
23
|
+
const secretAccessKey = process.env[ENV_SECRET];
|
|
24
|
+
const sessionToken = process.env[ENV_SESSION];
|
|
25
|
+
const expiry = process.env[ENV_EXPIRATION];
|
|
26
|
+
const credentialScope = process.env[ENV_CREDENTIAL_SCOPE];
|
|
27
|
+
const accountId = process.env[ENV_ACCOUNT_ID];
|
|
28
|
+
if (accessKeyId && secretAccessKey) {
|
|
29
|
+
const credentials = {
|
|
30
|
+
accessKeyId,
|
|
31
|
+
secretAccessKey,
|
|
32
|
+
...sessionToken && { sessionToken },
|
|
33
|
+
...expiry && { expiration: new Date(expiry) },
|
|
34
|
+
...credentialScope && { credentialScope },
|
|
35
|
+
...accountId && { accountId }
|
|
36
|
+
};
|
|
37
|
+
import_client.setCredentialFeature(credentials, "CREDENTIALS_ENV_VARS", "g");
|
|
38
|
+
return credentials;
|
|
39
|
+
}
|
|
40
|
+
throw new CredentialsProviderError("Unable to find environment variable credentials.", { logger: init?.logger });
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
fromEnv,
|
|
44
|
+
ENV_SESSION,
|
|
45
|
+
ENV_SECRET,
|
|
46
|
+
ENV_KEY,
|
|
47
|
+
ENV_EXPIRATION,
|
|
48
|
+
ENV_CREDENTIAL_SCOPE,
|
|
49
|
+
ENV_ACCOUNT_ID
|
|
50
|
+
};
|
|
51
|
+
export { ENV_KEY, ENV_SECRET, fromEnv };
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
getProfileName,
|
|
4
|
+
getSSOTokenFilepath,
|
|
5
|
+
getSSOTokenFromFile,
|
|
6
|
+
loadSsoSessionData,
|
|
7
|
+
parseKnownFiles
|
|
8
|
+
} from "./chunk-bf8bq8pc.js";
|
|
9
|
+
import {
|
|
10
|
+
CredentialsProviderError,
|
|
11
|
+
TokenProviderError
|
|
12
|
+
} from "./chunk-zzerxbrm.js";
|
|
13
|
+
import {
|
|
14
|
+
require_client
|
|
15
|
+
} from "./chunk-frw3va9v.js";
|
|
16
|
+
import"./chunk-saqpg5nd.js";
|
|
17
|
+
import {
|
|
18
|
+
__require,
|
|
19
|
+
__toESM
|
|
20
|
+
} from "./chunk-9v6qtbez.js";
|
|
21
|
+
|
|
22
|
+
// ../../../../node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js
|
|
23
|
+
var 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");
|
|
24
|
+
|
|
25
|
+
// ../../../../node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js
|
|
26
|
+
var import_client = __toESM(require_client(), 1);
|
|
27
|
+
|
|
28
|
+
// ../../../../node_modules/@aws-sdk/token-providers/dist-es/constants.js
|
|
29
|
+
var EXPIRE_WINDOW_MS = 5 * 60 * 1000;
|
|
30
|
+
var REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;
|
|
31
|
+
|
|
32
|
+
// ../../../../node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js
|
|
33
|
+
var getSsoOidcClient = async (ssoRegion, init = {}) => {
|
|
34
|
+
const { SSOOIDCClient } = await import("./chunk-f6a9g4qa.js");
|
|
35
|
+
const ssoOidcClient = new SSOOIDCClient(Object.assign({}, init.clientConfig ?? {}, {
|
|
36
|
+
region: ssoRegion ?? init.clientConfig?.region,
|
|
37
|
+
logger: init.clientConfig?.logger ?? init.parentClientConfig?.logger
|
|
38
|
+
}));
|
|
39
|
+
return ssoOidcClient;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// ../../../../node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js
|
|
43
|
+
var getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}) => {
|
|
44
|
+
const { CreateTokenCommand } = await import("./chunk-f6a9g4qa.js");
|
|
45
|
+
const ssoOidcClient = await getSsoOidcClient(ssoRegion, init);
|
|
46
|
+
return ssoOidcClient.send(new CreateTokenCommand({
|
|
47
|
+
clientId: ssoToken.clientId,
|
|
48
|
+
clientSecret: ssoToken.clientSecret,
|
|
49
|
+
refreshToken: ssoToken.refreshToken,
|
|
50
|
+
grantType: "refresh_token"
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// ../../../../node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js
|
|
55
|
+
var validateTokenExpiry = (token) => {
|
|
56
|
+
if (token.expiration && token.expiration.getTime() < Date.now()) {
|
|
57
|
+
throw new TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// ../../../../node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js
|
|
62
|
+
var validateTokenKey = (key, value, forRefresh = false) => {
|
|
63
|
+
if (typeof value === "undefined") {
|
|
64
|
+
throw new TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// ../../../../node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js
|
|
69
|
+
import { promises as fsPromises } from "node:fs";
|
|
70
|
+
var { writeFile } = fsPromises;
|
|
71
|
+
var writeSSOTokenToFile = (id, ssoToken) => {
|
|
72
|
+
const tokenFilepath = getSSOTokenFilepath(id);
|
|
73
|
+
const tokenString = JSON.stringify(ssoToken, null, 2);
|
|
74
|
+
return writeFile(tokenFilepath, tokenString);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// ../../../../node_modules/@aws-sdk/token-providers/dist-es/fromSso.js
|
|
78
|
+
var lastRefreshAttemptTime = new Date(0);
|
|
79
|
+
var fromSso = (_init = {}) => async ({ callerClientConfig } = {}) => {
|
|
80
|
+
const init = {
|
|
81
|
+
..._init,
|
|
82
|
+
parentClientConfig: {
|
|
83
|
+
...callerClientConfig,
|
|
84
|
+
..._init.parentClientConfig
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
init.logger?.debug("@aws-sdk/token-providers - fromSso");
|
|
88
|
+
const profiles = await parseKnownFiles(init);
|
|
89
|
+
const profileName = getProfileName({
|
|
90
|
+
profile: init.profile ?? callerClientConfig?.profile
|
|
91
|
+
});
|
|
92
|
+
const profile = profiles[profileName];
|
|
93
|
+
if (!profile) {
|
|
94
|
+
throw new TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
|
|
95
|
+
} else if (!profile["sso_session"]) {
|
|
96
|
+
throw new TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);
|
|
97
|
+
}
|
|
98
|
+
const ssoSessionName = profile["sso_session"];
|
|
99
|
+
const ssoSessions = await loadSsoSessionData(init);
|
|
100
|
+
const ssoSession = ssoSessions[ssoSessionName];
|
|
101
|
+
if (!ssoSession) {
|
|
102
|
+
throw new TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false);
|
|
103
|
+
}
|
|
104
|
+
for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) {
|
|
105
|
+
if (!ssoSession[ssoSessionRequiredKey]) {
|
|
106
|
+
throw new TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const ssoStartUrl = ssoSession["sso_start_url"];
|
|
110
|
+
const ssoRegion = ssoSession["sso_region"];
|
|
111
|
+
let ssoToken;
|
|
112
|
+
try {
|
|
113
|
+
ssoToken = await getSSOTokenFromFile(ssoSessionName);
|
|
114
|
+
} catch (e) {
|
|
115
|
+
throw new TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false);
|
|
116
|
+
}
|
|
117
|
+
validateTokenKey("accessToken", ssoToken.accessToken);
|
|
118
|
+
validateTokenKey("expiresAt", ssoToken.expiresAt);
|
|
119
|
+
const { accessToken, expiresAt } = ssoToken;
|
|
120
|
+
const existingToken = { token: accessToken, expiration: new Date(expiresAt) };
|
|
121
|
+
if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {
|
|
122
|
+
return existingToken;
|
|
123
|
+
}
|
|
124
|
+
if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1000) {
|
|
125
|
+
validateTokenExpiry(existingToken);
|
|
126
|
+
return existingToken;
|
|
127
|
+
}
|
|
128
|
+
validateTokenKey("clientId", ssoToken.clientId, true);
|
|
129
|
+
validateTokenKey("clientSecret", ssoToken.clientSecret, true);
|
|
130
|
+
validateTokenKey("refreshToken", ssoToken.refreshToken, true);
|
|
131
|
+
try {
|
|
132
|
+
lastRefreshAttemptTime.setTime(Date.now());
|
|
133
|
+
const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init);
|
|
134
|
+
validateTokenKey("accessToken", newSsoOidcToken.accessToken);
|
|
135
|
+
validateTokenKey("expiresIn", newSsoOidcToken.expiresIn);
|
|
136
|
+
const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1000);
|
|
137
|
+
try {
|
|
138
|
+
await writeSSOTokenToFile(ssoSessionName, {
|
|
139
|
+
...ssoToken,
|
|
140
|
+
accessToken: newSsoOidcToken.accessToken,
|
|
141
|
+
expiresAt: newTokenExpiration.toISOString(),
|
|
142
|
+
refreshToken: newSsoOidcToken.refreshToken
|
|
143
|
+
});
|
|
144
|
+
} catch (error) {}
|
|
145
|
+
return {
|
|
146
|
+
token: newSsoOidcToken.accessToken,
|
|
147
|
+
expiration: newTokenExpiration
|
|
148
|
+
};
|
|
149
|
+
} catch (error) {
|
|
150
|
+
validateTokenExpiry(existingToken);
|
|
151
|
+
return existingToken;
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
// ../../../../node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js
|
|
156
|
+
var SHOULD_FAIL_CREDENTIAL_CHAIN = false;
|
|
157
|
+
var resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, profile, logger }) => {
|
|
158
|
+
let token;
|
|
159
|
+
const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
|
|
160
|
+
if (ssoSession) {
|
|
161
|
+
try {
|
|
162
|
+
const _token = await fromSso({ profile })();
|
|
163
|
+
token = {
|
|
164
|
+
accessToken: _token.token,
|
|
165
|
+
expiresAt: new Date(_token.expiration).toISOString()
|
|
166
|
+
};
|
|
167
|
+
} catch (e) {
|
|
168
|
+
throw new CredentialsProviderError(e.message, {
|
|
169
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
170
|
+
logger
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
} else {
|
|
174
|
+
try {
|
|
175
|
+
token = await getSSOTokenFromFile(ssoStartUrl);
|
|
176
|
+
} catch (e) {
|
|
177
|
+
throw new CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, {
|
|
178
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
179
|
+
logger
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {
|
|
184
|
+
throw new CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, {
|
|
185
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
186
|
+
logger
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
const { accessToken } = token;
|
|
190
|
+
const { SSOClient, GetRoleCredentialsCommand } = await import("./chunk-csa76zyn.js");
|
|
191
|
+
const sso = ssoClient || new SSOClient(Object.assign({}, clientConfig ?? {}, {
|
|
192
|
+
logger: clientConfig?.logger ?? parentClientConfig?.logger,
|
|
193
|
+
region: clientConfig?.region ?? ssoRegion
|
|
194
|
+
}));
|
|
195
|
+
let ssoResp;
|
|
196
|
+
try {
|
|
197
|
+
ssoResp = await sso.send(new GetRoleCredentialsCommand({
|
|
198
|
+
accountId: ssoAccountId,
|
|
199
|
+
roleName: ssoRoleName,
|
|
200
|
+
accessToken
|
|
201
|
+
}));
|
|
202
|
+
} catch (e) {
|
|
203
|
+
throw new CredentialsProviderError(e, {
|
|
204
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
205
|
+
logger
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {} } = ssoResp;
|
|
209
|
+
if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {
|
|
210
|
+
throw new CredentialsProviderError("SSO returns an invalid temporary credential.", {
|
|
211
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
212
|
+
logger
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
const credentials = {
|
|
216
|
+
accessKeyId,
|
|
217
|
+
secretAccessKey,
|
|
218
|
+
sessionToken,
|
|
219
|
+
expiration: new Date(expiration),
|
|
220
|
+
...credentialScope && { credentialScope },
|
|
221
|
+
...accountId && { accountId }
|
|
222
|
+
};
|
|
223
|
+
if (ssoSession) {
|
|
224
|
+
import_client.setCredentialFeature(credentials, "CREDENTIALS_SSO", "s");
|
|
225
|
+
} else {
|
|
226
|
+
import_client.setCredentialFeature(credentials, "CREDENTIALS_SSO_LEGACY", "u");
|
|
227
|
+
}
|
|
228
|
+
return credentials;
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
// ../../../../node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js
|
|
232
|
+
var validateSsoProfile = (profile, logger) => {
|
|
233
|
+
const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;
|
|
234
|
+
if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {
|
|
235
|
+
throw new 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(", ")}
|
|
236
|
+
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger });
|
|
237
|
+
}
|
|
238
|
+
return profile;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
// ../../../../node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js
|
|
242
|
+
var fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => {
|
|
243
|
+
init.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");
|
|
244
|
+
const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
|
|
245
|
+
const { ssoClient } = init;
|
|
246
|
+
const profileName = getProfileName({
|
|
247
|
+
profile: init.profile ?? callerClientConfig?.profile
|
|
248
|
+
});
|
|
249
|
+
if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
|
|
250
|
+
const profiles = await parseKnownFiles(init);
|
|
251
|
+
const profile = profiles[profileName];
|
|
252
|
+
if (!profile) {
|
|
253
|
+
throw new CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger });
|
|
254
|
+
}
|
|
255
|
+
if (!isSsoProfile(profile)) {
|
|
256
|
+
throw new CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, {
|
|
257
|
+
logger: init.logger
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
if (profile?.sso_session) {
|
|
261
|
+
const ssoSessions = await loadSsoSessionData(init);
|
|
262
|
+
const session = ssoSessions[profile.sso_session];
|
|
263
|
+
const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`;
|
|
264
|
+
if (ssoRegion && ssoRegion !== session.sso_region) {
|
|
265
|
+
throw new CredentialsProviderError(`Conflicting SSO region` + conflictMsg, {
|
|
266
|
+
tryNextLink: false,
|
|
267
|
+
logger: init.logger
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) {
|
|
271
|
+
throw new CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, {
|
|
272
|
+
tryNextLink: false,
|
|
273
|
+
logger: init.logger
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
profile.sso_region = session.sso_region;
|
|
277
|
+
profile.sso_start_url = session.sso_start_url;
|
|
278
|
+
}
|
|
279
|
+
const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile, init.logger);
|
|
280
|
+
return resolveSSOCredentials({
|
|
281
|
+
ssoStartUrl: sso_start_url,
|
|
282
|
+
ssoSession: sso_session,
|
|
283
|
+
ssoAccountId: sso_account_id,
|
|
284
|
+
ssoRegion: sso_region,
|
|
285
|
+
ssoRoleName: sso_role_name,
|
|
286
|
+
ssoClient,
|
|
287
|
+
clientConfig: init.clientConfig,
|
|
288
|
+
parentClientConfig: init.parentClientConfig,
|
|
289
|
+
profile: profileName
|
|
290
|
+
});
|
|
291
|
+
} else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) {
|
|
292
|
+
throw new CredentialsProviderError("Incomplete configuration. The fromSSO() argument hash must include " + '"ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"', { tryNextLink: false, logger: init.logger });
|
|
293
|
+
} else {
|
|
294
|
+
return resolveSSOCredentials({
|
|
295
|
+
ssoStartUrl,
|
|
296
|
+
ssoSession,
|
|
297
|
+
ssoAccountId,
|
|
298
|
+
ssoRegion,
|
|
299
|
+
ssoRoleName,
|
|
300
|
+
ssoClient,
|
|
301
|
+
clientConfig: init.clientConfig,
|
|
302
|
+
parentClientConfig: init.parentClientConfig,
|
|
303
|
+
profile: profileName
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
export {
|
|
308
|
+
validateSsoProfile,
|
|
309
|
+
isSsoProfile,
|
|
310
|
+
fromSSO
|
|
311
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__commonJS
|
|
3
|
+
} from "./chunk-9v6qtbez.js";
|
|
4
|
+
|
|
5
|
+
// ../../../../node_modules/@smithy/types/dist-cjs/index.js
|
|
6
|
+
var require_dist_cjs = __commonJS((exports, module) => {
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
12
|
+
var __export = (target, all) => {
|
|
13
|
+
for (var name in all)
|
|
14
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var src_exports = {};
|
|
26
|
+
__export(src_exports, {
|
|
27
|
+
AlgorithmId: () => AlgorithmId,
|
|
28
|
+
EndpointURLScheme: () => EndpointURLScheme,
|
|
29
|
+
FieldPosition: () => FieldPosition,
|
|
30
|
+
HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation,
|
|
31
|
+
HttpAuthLocation: () => HttpAuthLocation,
|
|
32
|
+
IniSectionType: () => IniSectionType,
|
|
33
|
+
RequestHandlerProtocol: () => RequestHandlerProtocol,
|
|
34
|
+
SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY,
|
|
35
|
+
getDefaultClientConfiguration: () => getDefaultClientConfiguration,
|
|
36
|
+
resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(src_exports);
|
|
39
|
+
var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => {
|
|
40
|
+
HttpAuthLocation2["HEADER"] = "header";
|
|
41
|
+
HttpAuthLocation2["QUERY"] = "query";
|
|
42
|
+
return HttpAuthLocation2;
|
|
43
|
+
})(HttpAuthLocation || {});
|
|
44
|
+
var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => {
|
|
45
|
+
HttpApiKeyAuthLocation2["HEADER"] = "header";
|
|
46
|
+
HttpApiKeyAuthLocation2["QUERY"] = "query";
|
|
47
|
+
return HttpApiKeyAuthLocation2;
|
|
48
|
+
})(HttpApiKeyAuthLocation || {});
|
|
49
|
+
var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => {
|
|
50
|
+
EndpointURLScheme2["HTTP"] = "http";
|
|
51
|
+
EndpointURLScheme2["HTTPS"] = "https";
|
|
52
|
+
return EndpointURLScheme2;
|
|
53
|
+
})(EndpointURLScheme || {});
|
|
54
|
+
var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => {
|
|
55
|
+
AlgorithmId2["MD5"] = "md5";
|
|
56
|
+
AlgorithmId2["CRC32"] = "crc32";
|
|
57
|
+
AlgorithmId2["CRC32C"] = "crc32c";
|
|
58
|
+
AlgorithmId2["SHA1"] = "sha1";
|
|
59
|
+
AlgorithmId2["SHA256"] = "sha256";
|
|
60
|
+
return AlgorithmId2;
|
|
61
|
+
})(AlgorithmId || {});
|
|
62
|
+
var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
|
|
63
|
+
const checksumAlgorithms = [];
|
|
64
|
+
if (runtimeConfig.sha256 !== undefined) {
|
|
65
|
+
checksumAlgorithms.push({
|
|
66
|
+
algorithmId: () => "sha256",
|
|
67
|
+
checksumConstructor: () => runtimeConfig.sha256
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
if (runtimeConfig.md5 != null) {
|
|
71
|
+
checksumAlgorithms.push({
|
|
72
|
+
algorithmId: () => "md5",
|
|
73
|
+
checksumConstructor: () => runtimeConfig.md5
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
addChecksumAlgorithm(algo) {
|
|
78
|
+
checksumAlgorithms.push(algo);
|
|
79
|
+
},
|
|
80
|
+
checksumAlgorithms() {
|
|
81
|
+
return checksumAlgorithms;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}, "getChecksumConfiguration");
|
|
85
|
+
var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => {
|
|
86
|
+
const runtimeConfig = {};
|
|
87
|
+
clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {
|
|
88
|
+
runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor();
|
|
89
|
+
});
|
|
90
|
+
return runtimeConfig;
|
|
91
|
+
}, "resolveChecksumRuntimeConfig");
|
|
92
|
+
var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
|
|
93
|
+
return getChecksumConfiguration(runtimeConfig);
|
|
94
|
+
}, "getDefaultClientConfiguration");
|
|
95
|
+
var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => {
|
|
96
|
+
return resolveChecksumRuntimeConfig(config);
|
|
97
|
+
}, "resolveDefaultRuntimeConfig");
|
|
98
|
+
var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => {
|
|
99
|
+
FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER";
|
|
100
|
+
FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER";
|
|
101
|
+
return FieldPosition2;
|
|
102
|
+
})(FieldPosition || {});
|
|
103
|
+
var SMITHY_CONTEXT_KEY = "__smithy_context";
|
|
104
|
+
var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => {
|
|
105
|
+
IniSectionType2["PROFILE"] = "profile";
|
|
106
|
+
IniSectionType2["SSO_SESSION"] = "sso-session";
|
|
107
|
+
IniSectionType2["SERVICES"] = "services";
|
|
108
|
+
return IniSectionType2;
|
|
109
|
+
})(IniSectionType || {});
|
|
110
|
+
var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => {
|
|
111
|
+
RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9";
|
|
112
|
+
RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0";
|
|
113
|
+
RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0";
|
|
114
|
+
return RequestHandlerProtocol2;
|
|
115
|
+
})(RequestHandlerProtocol || {});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export { require_dist_cjs };
|