monorise 1.0.0 → 1.1.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base/index.d.ts +84 -3
- package/dist/base/index.js.map +1 -1
- package/dist/cli/cli.js +6 -0
- package/dist/cli/cli.js.map +1 -1
- package/dist/core/chunk-QV4Q5377.js +76 -0
- package/dist/core/chunk-QV4Q5377.js.map +1 -0
- package/dist/core/index.d.ts +182 -35
- package/dist/core/index.js +1486 -94
- package/dist/core/index.js.map +1 -1
- package/dist/core/service.config-ZJEZ6EKA.js +13 -0
- package/dist/core/service.config-ZJEZ6EKA.js.map +1 -0
- package/dist/proxy/index.d.ts +35 -0
- package/dist/proxy/index.js +75 -0
- package/dist/proxy/index.js.map +1 -0
- package/dist/react/actions/websocket.action.d.ts +71 -0
- package/dist/react/actions/websocket.action.d.ts.map +1 -0
- package/dist/react/chunk-4D22OCZG.js +65 -0
- package/dist/react/chunk-4D22OCZG.js.map +1 -0
- package/dist/react/chunk-4N3P4ONH.js +588 -0
- package/dist/react/chunk-4N3P4ONH.js.map +1 -0
- package/dist/react/chunk-4Y4KWGJD.js +182 -0
- package/dist/react/chunk-4Y4KWGJD.js.map +1 -0
- package/dist/react/chunk-757E5UYA.js +893 -0
- package/dist/react/chunk-757E5UYA.js.map +1 -0
- package/dist/react/chunk-A5TI2FW3.js +13 -0
- package/dist/react/chunk-A5TI2FW3.js.map +1 -0
- package/dist/react/chunk-B3XDGUFO.js +489 -0
- package/dist/react/chunk-B3XDGUFO.js.map +1 -0
- package/dist/react/chunk-BPBCUO2Z.js +248 -0
- package/dist/react/chunk-BPBCUO2Z.js.map +1 -0
- package/dist/react/chunk-CQBOIXWK.js +142 -0
- package/dist/react/chunk-CQBOIXWK.js.map +1 -0
- package/dist/react/chunk-DRH2BB7I.js +383 -0
- package/dist/react/chunk-DRH2BB7I.js.map +1 -0
- package/dist/react/chunk-EQ3PKQ2S.js +402 -0
- package/dist/react/chunk-EQ3PKQ2S.js.map +1 -0
- package/dist/react/chunk-H64MMAL7.js +245 -0
- package/dist/react/chunk-H64MMAL7.js.map +1 -0
- package/dist/react/chunk-KJX5LOMN.js +43 -0
- package/dist/react/chunk-KJX5LOMN.js.map +1 -0
- package/dist/react/chunk-MO35V2Y7.js +172 -0
- package/dist/react/chunk-MO35V2Y7.js.map +1 -0
- package/dist/react/chunk-UC3E72G7.js +73 -0
- package/dist/react/chunk-UC3E72G7.js.map +1 -0
- package/dist/react/chunk-UHMKB3OR.js +5568 -0
- package/dist/react/chunk-UHMKB3OR.js.map +1 -0
- package/dist/react/chunk-UQPQBWEQ.js +54 -0
- package/dist/react/chunk-UQPQBWEQ.js.map +1 -0
- package/dist/react/chunk-XCDCVRJR.js +43 -0
- package/dist/react/chunk-XCDCVRJR.js.map +1 -0
- package/dist/react/chunk-XOYAZDIH.js +47 -0
- package/dist/react/chunk-XOYAZDIH.js.map +1 -0
- package/dist/react/chunk-YNFQEPO5.js +29 -0
- package/dist/react/chunk-YNFQEPO5.js.map +1 -0
- package/dist/react/dist-es-35AO47NO.js +90 -0
- package/dist/react/dist-es-35AO47NO.js.map +1 -0
- package/dist/react/dist-es-5GDBXNKQ.js +333 -0
- package/dist/react/dist-es-5GDBXNKQ.js.map +1 -0
- package/dist/react/dist-es-B3JDGWY6.js +71 -0
- package/dist/react/dist-es-B3JDGWY6.js.map +1 -0
- package/dist/react/dist-es-IWIE5JLA.js +169 -0
- package/dist/react/dist-es-IWIE5JLA.js.map +1 -0
- package/dist/react/dist-es-NRIS3TYJ.js +494 -0
- package/dist/react/dist-es-NRIS3TYJ.js.map +1 -0
- package/dist/react/dist-es-VCXAEYYN.js +22 -0
- package/dist/react/dist-es-VCXAEYYN.js.map +1 -0
- package/dist/react/dist-es-VU33JFTZ.js +379 -0
- package/dist/react/dist-es-VU33JFTZ.js.map +1 -0
- package/dist/react/event-streams-OSOTOTTP.js +277 -0
- package/dist/react/event-streams-OSOTOTTP.js.map +1 -0
- package/dist/react/index.d.ts +53 -4
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +10948 -190
- package/dist/react/index.js.map +1 -1
- package/dist/react/loadSso-ME7MKAM3.js +556 -0
- package/dist/react/loadSso-ME7MKAM3.js.map +1 -0
- package/dist/react/service.config-ZJEZ6EKA-FC2TR3GH.js +14 -0
- package/dist/react/service.config-ZJEZ6EKA-FC2TR3GH.js.map +1 -0
- package/dist/react/services/core.service.d.ts +11 -1
- package/dist/react/services/core.service.d.ts.map +1 -1
- package/dist/react/signin-LOXYIE5I.js +653 -0
- package/dist/react/signin-LOXYIE5I.js.map +1 -0
- package/dist/react/sso-oidc-X63KRRLO.js +786 -0
- package/dist/react/sso-oidc-X63KRRLO.js.map +1 -0
- package/dist/react/sts-OXBEY7HY.js +3948 -0
- package/dist/react/sts-OXBEY7HY.js.map +1 -0
- package/dist/react/websocket/WebSocketManager.d.ts +68 -0
- package/dist/react/websocket/WebSocketManager.d.ts.map +1 -0
- package/dist/react/websocket/index.d.ts +3 -0
- package/dist/react/websocket/index.d.ts.map +1 -0
- package/dist/react/websocket/optimistic.d.ts +51 -0
- package/dist/react/websocket/optimistic.d.ts.map +1 -0
- package/dist/react/websocket-QHA7SQXG.js +10 -0
- package/dist/react/websocket-QHA7SQXG.js.map +1 -0
- package/dist/sst/components/monorise-core.d.ts +10 -0
- package/dist/sst/components/monorise-core.d.ts.map +1 -1
- package/dist/sst/index.js +75 -12
- package/dist/sst/index.js.map +1 -1
- package/package.json +9 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "./chunk-CQBOIXWK.js";
|
|
5
|
+
|
|
6
|
+
// ../../node_modules/@smithy/smithy-client/dist-es/create-aggregated-client.js
|
|
7
|
+
var createAggregatedClient = (commands, Client, options) => {
|
|
8
|
+
for (const [command, CommandCtor] of Object.entries(commands)) {
|
|
9
|
+
const methodImpl = async function(args, optionsOrCb, cb) {
|
|
10
|
+
const command2 = new CommandCtor(args);
|
|
11
|
+
if (typeof optionsOrCb === "function") {
|
|
12
|
+
this.send(command2, optionsOrCb);
|
|
13
|
+
} else if (typeof cb === "function") {
|
|
14
|
+
if (typeof optionsOrCb !== "object")
|
|
15
|
+
throw new Error(`Expected http options but got ${typeof optionsOrCb}`);
|
|
16
|
+
this.send(command2, optionsOrCb || {}, cb);
|
|
17
|
+
} else {
|
|
18
|
+
return this.send(command2, optionsOrCb);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, "");
|
|
22
|
+
Client.prototype[methodName] = methodImpl;
|
|
23
|
+
}
|
|
24
|
+
const { paginators = {}, waiters = {} } = options != null ? options : {};
|
|
25
|
+
for (const [paginatorName, paginatorFn] of Object.entries(paginators)) {
|
|
26
|
+
if (Client.prototype[paginatorName] === void 0) {
|
|
27
|
+
Client.prototype[paginatorName] = function(commandInput = {}, paginationConfiguration, ...rest) {
|
|
28
|
+
return paginatorFn(__spreadProps(__spreadValues({}, paginationConfiguration), {
|
|
29
|
+
client: this
|
|
30
|
+
}), commandInput, ...rest);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
for (const [waiterName, waiterFn] of Object.entries(waiters)) {
|
|
35
|
+
if (Client.prototype[waiterName] === void 0) {
|
|
36
|
+
Client.prototype[waiterName] = async function(commandInput = {}, waiterConfiguration, ...rest) {
|
|
37
|
+
let config = waiterConfiguration;
|
|
38
|
+
if (typeof waiterConfiguration === "number") {
|
|
39
|
+
config = {
|
|
40
|
+
maxWaitTime: waiterConfiguration
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return waiterFn(__spreadProps(__spreadValues({}, config), {
|
|
44
|
+
client: this
|
|
45
|
+
}), commandInput, ...rest);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
createAggregatedClient
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=chunk-UQPQBWEQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/@smithy/smithy-client/dist-es/create-aggregated-client.js"],"sourcesContent":["export const createAggregatedClient = (commands, Client, options) => {\n for (const [command, CommandCtor] of Object.entries(commands)) {\n const methodImpl = async function (args, optionsOrCb, cb) {\n const command = new CommandCtor(args);\n if (typeof optionsOrCb === \"function\") {\n this.send(command, optionsOrCb);\n }\n else if (typeof cb === \"function\") {\n if (typeof optionsOrCb !== \"object\")\n throw new Error(`Expected http options but got ${typeof optionsOrCb}`);\n this.send(command, optionsOrCb || {}, cb);\n }\n else {\n return this.send(command, optionsOrCb);\n }\n };\n const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, \"\");\n Client.prototype[methodName] = methodImpl;\n }\n const { paginators = {}, waiters = {} } = options ?? {};\n for (const [paginatorName, paginatorFn] of Object.entries(paginators)) {\n if (Client.prototype[paginatorName] === void 0) {\n Client.prototype[paginatorName] = function (commandInput = {}, paginationConfiguration, ...rest) {\n return paginatorFn({\n ...paginationConfiguration,\n client: this,\n }, commandInput, ...rest);\n };\n }\n }\n for (const [waiterName, waiterFn] of Object.entries(waiters)) {\n if (Client.prototype[waiterName] === void 0) {\n Client.prototype[waiterName] = async function (commandInput = {}, waiterConfiguration, ...rest) {\n let config = waiterConfiguration;\n if (typeof waiterConfiguration === \"number\") {\n config = {\n maxWaitTime: waiterConfiguration,\n };\n }\n return waiterFn({\n ...config,\n client: this,\n }, commandInput, ...rest);\n };\n }\n }\n};\n"],"mappings":";;;;;;AAAO,IAAM,yBAAyB,CAAC,UAAU,QAAQ,YAAY;AACjE,aAAW,CAAC,SAAS,WAAW,KAAK,OAAO,QAAQ,QAAQ,GAAG;AAC3D,UAAM,aAAa,eAAgB,MAAM,aAAa,IAAI;AACtD,YAAMA,WAAU,IAAI,YAAY,IAAI;AACpC,UAAI,OAAO,gBAAgB,YAAY;AACnC,aAAK,KAAKA,UAAS,WAAW;AAAA,MAClC,WACS,OAAO,OAAO,YAAY;AAC/B,YAAI,OAAO,gBAAgB;AACvB,gBAAM,IAAI,MAAM,iCAAiC,OAAO,WAAW,EAAE;AACzE,aAAK,KAAKA,UAAS,eAAe,CAAC,GAAG,EAAE;AAAA,MAC5C,OACK;AACD,eAAO,KAAK,KAAKA,UAAS,WAAW;AAAA,MACzC;AAAA,IACJ;AACA,UAAM,cAAc,QAAQ,CAAC,EAAE,YAAY,IAAI,QAAQ,MAAM,CAAC,GAAG,QAAQ,YAAY,EAAE;AACvF,WAAO,UAAU,UAAU,IAAI;AAAA,EACnC;AACA,QAAM,EAAE,aAAa,CAAC,GAAG,UAAU,CAAC,EAAE,IAAI,4BAAW,CAAC;AACtD,aAAW,CAAC,eAAe,WAAW,KAAK,OAAO,QAAQ,UAAU,GAAG;AACnE,QAAI,OAAO,UAAU,aAAa,MAAM,QAAQ;AAC5C,aAAO,UAAU,aAAa,IAAI,SAAU,eAAe,CAAC,GAAG,4BAA4B,MAAM;AAC7F,eAAO,YAAY,iCACZ,0BADY;AAAA,UAEf,QAAQ;AAAA,QACZ,IAAG,cAAc,GAAG,IAAI;AAAA,MAC5B;AAAA,IACJ;AAAA,EACJ;AACA,aAAW,CAAC,YAAY,QAAQ,KAAK,OAAO,QAAQ,OAAO,GAAG;AAC1D,QAAI,OAAO,UAAU,UAAU,MAAM,QAAQ;AACzC,aAAO,UAAU,UAAU,IAAI,eAAgB,eAAe,CAAC,GAAG,wBAAwB,MAAM;AAC5F,YAAI,SAAS;AACb,YAAI,OAAO,wBAAwB,UAAU;AACzC,mBAAS;AAAA,YACL,aAAa;AAAA,UACjB;AAAA,QACJ;AACA,eAAO,SAAS,iCACT,SADS;AAAA,UAEZ,QAAQ;AAAA,QACZ,IAAG,cAAc,GAAG,IAAI;AAAA,MAC5B;AAAA,IACJ;AAAA,EACJ;AACJ;","names":["command"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__publicField
|
|
3
|
+
} from "./chunk-CQBOIXWK.js";
|
|
4
|
+
|
|
5
|
+
// ../../node_modules/@smithy/property-provider/dist-es/ProviderError.js
|
|
6
|
+
var ProviderError = class _ProviderError extends Error {
|
|
7
|
+
constructor(message, options = true) {
|
|
8
|
+
var _a, _b;
|
|
9
|
+
let logger;
|
|
10
|
+
let tryNextLink = true;
|
|
11
|
+
if (typeof options === "boolean") {
|
|
12
|
+
logger = void 0;
|
|
13
|
+
tryNextLink = options;
|
|
14
|
+
} else if (options != null && typeof options === "object") {
|
|
15
|
+
logger = options.logger;
|
|
16
|
+
tryNextLink = (_a = options.tryNextLink) != null ? _a : true;
|
|
17
|
+
}
|
|
18
|
+
super(message);
|
|
19
|
+
__publicField(this, "name", "ProviderError");
|
|
20
|
+
__publicField(this, "tryNextLink");
|
|
21
|
+
this.tryNextLink = tryNextLink;
|
|
22
|
+
Object.setPrototypeOf(this, _ProviderError.prototype);
|
|
23
|
+
(_b = logger == null ? void 0 : logger.debug) == null ? void 0 : _b.call(logger, `@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`);
|
|
24
|
+
}
|
|
25
|
+
static from(error, options = true) {
|
|
26
|
+
return Object.assign(new this(error.message, options), error);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// ../../node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js
|
|
31
|
+
var CredentialsProviderError = class _CredentialsProviderError extends ProviderError {
|
|
32
|
+
constructor(message, options = true) {
|
|
33
|
+
super(message, options);
|
|
34
|
+
__publicField(this, "name", "CredentialsProviderError");
|
|
35
|
+
Object.setPrototypeOf(this, _CredentialsProviderError.prototype);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
ProviderError,
|
|
41
|
+
CredentialsProviderError
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=chunk-XCDCVRJR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/@smithy/property-provider/dist-es/ProviderError.js","../../../node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js"],"sourcesContent":["export class ProviderError extends Error {\n name = \"ProviderError\";\n tryNextLink;\n constructor(message, options = true) {\n let logger;\n let tryNextLink = true;\n if (typeof options === \"boolean\") {\n logger = undefined;\n tryNextLink = options;\n }\n else if (options != null && typeof options === \"object\") {\n logger = options.logger;\n tryNextLink = options.tryNextLink ?? true;\n }\n super(message);\n this.tryNextLink = tryNextLink;\n Object.setPrototypeOf(this, ProviderError.prototype);\n logger?.debug?.(`@smithy/property-provider ${tryNextLink ? \"->\" : \"(!)\"} ${message}`);\n }\n static from(error, options = true) {\n return Object.assign(new this(error.message, options), error);\n }\n}\n","import { ProviderError } from \"./ProviderError\";\nexport class CredentialsProviderError extends ProviderError {\n name = \"CredentialsProviderError\";\n constructor(message, options = true) {\n super(message, options);\n Object.setPrototypeOf(this, CredentialsProviderError.prototype);\n }\n}\n"],"mappings":";;;;;AAAO,IAAM,gBAAN,MAAM,uBAAsB,MAAM;AAAA,EAGrC,YAAY,SAAS,UAAU,MAAM;AAHzC;AAIQ,QAAI;AACJ,QAAI,cAAc;AAClB,QAAI,OAAO,YAAY,WAAW;AAC9B,eAAS;AACT,oBAAc;AAAA,IAClB,WACS,WAAW,QAAQ,OAAO,YAAY,UAAU;AACrD,eAAS,QAAQ;AACjB,qBAAc,aAAQ,gBAAR,YAAuB;AAAA,IACzC;AACA,UAAM,OAAO;AAbjB,gCAAO;AACP;AAaI,SAAK,cAAc;AACnB,WAAO,eAAe,MAAM,eAAc,SAAS;AACnD,2CAAQ,UAAR,gCAAgB,6BAA6B,cAAc,OAAO,KAAK,IAAI,OAAO;AAAA,EACtF;AAAA,EACA,OAAO,KAAK,OAAO,UAAU,MAAM;AAC/B,WAAO,OAAO,OAAO,IAAI,KAAK,MAAM,SAAS,OAAO,GAAG,KAAK;AAAA,EAChE;AACJ;;;ACrBO,IAAM,2BAAN,MAAM,kCAAiC,cAAc;AAAA,EAExD,YAAY,SAAS,UAAU,MAAM;AACjC,UAAM,SAAS,OAAO;AAF1B,gCAAO;AAGH,WAAO,eAAe,MAAM,0BAAyB,SAAS;AAAA,EAClE;AACJ;","names":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
setCredentialFeature
|
|
3
|
+
} from "./chunk-A5TI2FW3.js";
|
|
4
|
+
import {
|
|
5
|
+
CredentialsProviderError
|
|
6
|
+
} from "./chunk-XCDCVRJR.js";
|
|
7
|
+
import {
|
|
8
|
+
__spreadValues
|
|
9
|
+
} from "./chunk-CQBOIXWK.js";
|
|
10
|
+
|
|
11
|
+
// ../../node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js
|
|
12
|
+
var ENV_KEY = "AWS_ACCESS_KEY_ID";
|
|
13
|
+
var ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
|
|
14
|
+
var ENV_SESSION = "AWS_SESSION_TOKEN";
|
|
15
|
+
var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION";
|
|
16
|
+
var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE";
|
|
17
|
+
var ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID";
|
|
18
|
+
var fromEnv = (init) => async () => {
|
|
19
|
+
var _a;
|
|
20
|
+
(_a = init == null ? void 0 : init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-env - fromEnv");
|
|
21
|
+
const accessKeyId = process.env[ENV_KEY];
|
|
22
|
+
const secretAccessKey = process.env[ENV_SECRET];
|
|
23
|
+
const sessionToken = process.env[ENV_SESSION];
|
|
24
|
+
const expiry = process.env[ENV_EXPIRATION];
|
|
25
|
+
const credentialScope = process.env[ENV_CREDENTIAL_SCOPE];
|
|
26
|
+
const accountId = process.env[ENV_ACCOUNT_ID];
|
|
27
|
+
if (accessKeyId && secretAccessKey) {
|
|
28
|
+
const credentials = __spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
29
|
+
accessKeyId,
|
|
30
|
+
secretAccessKey
|
|
31
|
+
}, sessionToken && { sessionToken }), expiry && { expiration: new Date(expiry) }), credentialScope && { credentialScope }), accountId && { accountId });
|
|
32
|
+
setCredentialFeature(credentials, "CREDENTIALS_ENV_VARS", "g");
|
|
33
|
+
return credentials;
|
|
34
|
+
}
|
|
35
|
+
throw new CredentialsProviderError("Unable to find environment variable credentials.", { logger: init == null ? void 0 : init.logger });
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
ENV_KEY,
|
|
40
|
+
ENV_SECRET,
|
|
41
|
+
ENV_SESSION,
|
|
42
|
+
ENV_EXPIRATION,
|
|
43
|
+
ENV_CREDENTIAL_SCOPE,
|
|
44
|
+
ENV_ACCOUNT_ID,
|
|
45
|
+
fromEnv
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=chunk-XOYAZDIH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js"],"sourcesContent":["import { setCredentialFeature } from \"@aws-sdk/core/client\";\nimport { CredentialsProviderError } from \"@smithy/property-provider\";\nexport const ENV_KEY = \"AWS_ACCESS_KEY_ID\";\nexport const ENV_SECRET = \"AWS_SECRET_ACCESS_KEY\";\nexport const ENV_SESSION = \"AWS_SESSION_TOKEN\";\nexport const ENV_EXPIRATION = \"AWS_CREDENTIAL_EXPIRATION\";\nexport const ENV_CREDENTIAL_SCOPE = \"AWS_CREDENTIAL_SCOPE\";\nexport const ENV_ACCOUNT_ID = \"AWS_ACCOUNT_ID\";\nexport const fromEnv = (init) => async () => {\n init?.logger?.debug(\"@aws-sdk/credential-provider-env - fromEnv\");\n const accessKeyId = process.env[ENV_KEY];\n const secretAccessKey = process.env[ENV_SECRET];\n const sessionToken = process.env[ENV_SESSION];\n const expiry = process.env[ENV_EXPIRATION];\n const credentialScope = process.env[ENV_CREDENTIAL_SCOPE];\n const accountId = process.env[ENV_ACCOUNT_ID];\n if (accessKeyId && secretAccessKey) {\n const credentials = {\n accessKeyId,\n secretAccessKey,\n ...(sessionToken && { sessionToken }),\n ...(expiry && { expiration: new Date(expiry) }),\n ...(credentialScope && { credentialScope }),\n ...(accountId && { accountId }),\n };\n setCredentialFeature(credentials, \"CREDENTIALS_ENV_VARS\", \"g\");\n return credentials;\n }\n throw new CredentialsProviderError(\"Unable to find environment variable credentials.\", { logger: init?.logger });\n};\n"],"mappings":";;;;;;;;;;;AAEO,IAAM,UAAU;AAChB,IAAM,aAAa;AACnB,IAAM,cAAc;AACpB,IAAM,iBAAiB;AACvB,IAAM,uBAAuB;AAC7B,IAAM,iBAAiB;AACvB,IAAM,UAAU,CAAC,SAAS,YAAY;AAR7C;AASI,qCAAM,WAAN,mBAAc,MAAM;AACpB,QAAM,cAAc,QAAQ,IAAI,OAAO;AACvC,QAAM,kBAAkB,QAAQ,IAAI,UAAU;AAC9C,QAAM,eAAe,QAAQ,IAAI,WAAW;AAC5C,QAAM,SAAS,QAAQ,IAAI,cAAc;AACzC,QAAM,kBAAkB,QAAQ,IAAI,oBAAoB;AACxD,QAAM,YAAY,QAAQ,IAAI,cAAc;AAC5C,MAAI,eAAe,iBAAiB;AAChC,UAAM,cAAc;AAAA,MAChB;AAAA,MACA;AAAA,OACI,gBAAgB,EAAE,aAAa,IAC/B,UAAU,EAAE,YAAY,IAAI,KAAK,MAAM,EAAE,IACzC,mBAAmB,EAAE,gBAAgB,IACrC,aAAa,EAAE,UAAU;AAEjC,yBAAqB,aAAa,wBAAwB,GAAG;AAC7D,WAAO;AAAA,EACX;AACA,QAAM,IAAI,yBAAyB,oDAAoD,EAAE,QAAQ,6BAAM,OAAO,CAAC;AACnH;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ProviderError
|
|
3
|
+
} from "./chunk-XCDCVRJR.js";
|
|
4
|
+
|
|
5
|
+
// ../../node_modules/@smithy/property-provider/dist-es/chain.js
|
|
6
|
+
var chain = (...providers) => async () => {
|
|
7
|
+
if (providers.length === 0) {
|
|
8
|
+
throw new ProviderError("No providers in chain");
|
|
9
|
+
}
|
|
10
|
+
let lastProviderError;
|
|
11
|
+
for (const provider of providers) {
|
|
12
|
+
try {
|
|
13
|
+
const credentials = await provider();
|
|
14
|
+
return credentials;
|
|
15
|
+
} catch (err) {
|
|
16
|
+
lastProviderError = err;
|
|
17
|
+
if (err == null ? void 0 : err.tryNextLink) {
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
throw err;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
throw lastProviderError;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
chain
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=chunk-YNFQEPO5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/@smithy/property-provider/dist-es/chain.js"],"sourcesContent":["import { ProviderError } from \"./ProviderError\";\nexport const chain = (...providers) => async () => {\n if (providers.length === 0) {\n throw new ProviderError(\"No providers in chain\");\n }\n let lastProviderError;\n for (const provider of providers) {\n try {\n const credentials = await provider();\n return credentials;\n }\n catch (err) {\n lastProviderError = err;\n if (err?.tryNextLink) {\n continue;\n }\n throw err;\n }\n }\n throw lastProviderError;\n};\n"],"mappings":";;;;;AACO,IAAM,QAAQ,IAAI,cAAc,YAAY;AAC/C,MAAI,UAAU,WAAW,GAAG;AACxB,UAAM,IAAI,cAAc,uBAAuB;AAAA,EACnD;AACA,MAAI;AACJ,aAAW,YAAY,WAAW;AAC9B,QAAI;AACA,YAAM,cAAc,MAAM,SAAS;AACnC,aAAO;AAAA,IACX,SACO,KAAK;AACR,0BAAoB;AACpB,UAAI,2BAAK,aAAa;AAClB;AAAA,MACJ;AACA,YAAM;AAAA,IACV;AAAA,EACJ;AACA,QAAM;AACV;","names":[]}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import {
|
|
2
|
+
externalDataInterceptor,
|
|
3
|
+
getProfileName,
|
|
4
|
+
parseKnownFiles
|
|
5
|
+
} from "./chunk-BPBCUO2Z.js";
|
|
6
|
+
import {
|
|
7
|
+
setCredentialFeature
|
|
8
|
+
} from "./chunk-A5TI2FW3.js";
|
|
9
|
+
import {
|
|
10
|
+
CredentialsProviderError
|
|
11
|
+
} from "./chunk-XCDCVRJR.js";
|
|
12
|
+
import {
|
|
13
|
+
__spreadValues
|
|
14
|
+
} from "./chunk-CQBOIXWK.js";
|
|
15
|
+
|
|
16
|
+
// ../../node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js
|
|
17
|
+
import { exec } from "child_process";
|
|
18
|
+
import { promisify } from "util";
|
|
19
|
+
|
|
20
|
+
// ../../node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js
|
|
21
|
+
var getValidatedProcessCredentials = (profileName, data, profiles) => {
|
|
22
|
+
var _a;
|
|
23
|
+
if (data.Version !== 1) {
|
|
24
|
+
throw Error(`Profile ${profileName} credential_process did not return Version 1.`);
|
|
25
|
+
}
|
|
26
|
+
if (data.AccessKeyId === void 0 || data.SecretAccessKey === void 0) {
|
|
27
|
+
throw Error(`Profile ${profileName} credential_process returned invalid credentials.`);
|
|
28
|
+
}
|
|
29
|
+
if (data.Expiration) {
|
|
30
|
+
const currentTime = /* @__PURE__ */ new Date();
|
|
31
|
+
const expireTime = new Date(data.Expiration);
|
|
32
|
+
if (expireTime < currentTime) {
|
|
33
|
+
throw Error(`Profile ${profileName} credential_process returned expired credentials.`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
let accountId = data.AccountId;
|
|
37
|
+
if (!accountId && ((_a = profiles == null ? void 0 : profiles[profileName]) == null ? void 0 : _a.aws_account_id)) {
|
|
38
|
+
accountId = profiles[profileName].aws_account_id;
|
|
39
|
+
}
|
|
40
|
+
const credentials = __spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
41
|
+
accessKeyId: data.AccessKeyId,
|
|
42
|
+
secretAccessKey: data.SecretAccessKey
|
|
43
|
+
}, data.SessionToken && { sessionToken: data.SessionToken }), data.Expiration && { expiration: new Date(data.Expiration) }), data.CredentialScope && { credentialScope: data.CredentialScope }), accountId && { accountId });
|
|
44
|
+
setCredentialFeature(credentials, "CREDENTIALS_PROCESS", "w");
|
|
45
|
+
return credentials;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// ../../node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js
|
|
49
|
+
var resolveProcessCredentials = async (profileName, profiles, logger) => {
|
|
50
|
+
var _a, _b, _c;
|
|
51
|
+
const profile = profiles[profileName];
|
|
52
|
+
if (profiles[profileName]) {
|
|
53
|
+
const credentialProcess = profile["credential_process"];
|
|
54
|
+
if (credentialProcess !== void 0) {
|
|
55
|
+
const execPromise = promisify((_c = (_b = (_a = externalDataInterceptor) == null ? void 0 : _a.getTokenRecord) == null ? void 0 : _b.call(_a).exec) != null ? _c : exec);
|
|
56
|
+
try {
|
|
57
|
+
const { stdout } = await execPromise(credentialProcess);
|
|
58
|
+
let data;
|
|
59
|
+
try {
|
|
60
|
+
data = JSON.parse(stdout.trim());
|
|
61
|
+
} catch (e) {
|
|
62
|
+
throw Error(`Profile ${profileName} credential_process returned invalid JSON.`);
|
|
63
|
+
}
|
|
64
|
+
return getValidatedProcessCredentials(profileName, data, profiles);
|
|
65
|
+
} catch (error) {
|
|
66
|
+
throw new CredentialsProviderError(error.message, { logger });
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
throw new CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger });
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
throw new CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, {
|
|
73
|
+
logger
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// ../../node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js
|
|
79
|
+
var fromProcess = (init = {}) => async ({ callerClientConfig } = {}) => {
|
|
80
|
+
var _a, _b;
|
|
81
|
+
(_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-process - fromProcess");
|
|
82
|
+
const profiles = await parseKnownFiles(init);
|
|
83
|
+
return resolveProcessCredentials(getProfileName({
|
|
84
|
+
profile: (_b = init.profile) != null ? _b : callerClientConfig == null ? void 0 : callerClientConfig.profile
|
|
85
|
+
}), profiles, init.logger);
|
|
86
|
+
};
|
|
87
|
+
export {
|
|
88
|
+
fromProcess
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=dist-es-35AO47NO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js","../../../node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js","../../../node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js"],"sourcesContent":["import { CredentialsProviderError } from \"@smithy/property-provider\";\nimport { externalDataInterceptor } from \"@smithy/shared-ini-file-loader\";\nimport { exec } from \"node:child_process\";\nimport { promisify } from \"node:util\";\nimport { getValidatedProcessCredentials } from \"./getValidatedProcessCredentials\";\nexport const resolveProcessCredentials = async (profileName, profiles, logger) => {\n const profile = profiles[profileName];\n if (profiles[profileName]) {\n const credentialProcess = profile[\"credential_process\"];\n if (credentialProcess !== undefined) {\n const execPromise = promisify(externalDataInterceptor?.getTokenRecord?.().exec ?? exec);\n try {\n const { stdout } = await execPromise(credentialProcess);\n let data;\n try {\n data = JSON.parse(stdout.trim());\n }\n catch {\n throw Error(`Profile ${profileName} credential_process returned invalid JSON.`);\n }\n return getValidatedProcessCredentials(profileName, data, profiles);\n }\n catch (error) {\n throw new CredentialsProviderError(error.message, { logger });\n }\n }\n else {\n throw new CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger });\n }\n }\n else {\n throw new CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, {\n logger,\n });\n }\n};\n","import { setCredentialFeature } from \"@aws-sdk/core/client\";\nexport const getValidatedProcessCredentials = (profileName, data, profiles) => {\n if (data.Version !== 1) {\n throw Error(`Profile ${profileName} credential_process did not return Version 1.`);\n }\n if (data.AccessKeyId === undefined || data.SecretAccessKey === undefined) {\n throw Error(`Profile ${profileName} credential_process returned invalid credentials.`);\n }\n if (data.Expiration) {\n const currentTime = new Date();\n const expireTime = new Date(data.Expiration);\n if (expireTime < currentTime) {\n throw Error(`Profile ${profileName} credential_process returned expired credentials.`);\n }\n }\n let accountId = data.AccountId;\n if (!accountId && profiles?.[profileName]?.aws_account_id) {\n accountId = profiles[profileName].aws_account_id;\n }\n const credentials = {\n accessKeyId: data.AccessKeyId,\n secretAccessKey: data.SecretAccessKey,\n ...(data.SessionToken && { sessionToken: data.SessionToken }),\n ...(data.Expiration && { expiration: new Date(data.Expiration) }),\n ...(data.CredentialScope && { credentialScope: data.CredentialScope }),\n ...(accountId && { accountId }),\n };\n setCredentialFeature(credentials, \"CREDENTIALS_PROCESS\", \"w\");\n return credentials;\n};\n","import { getProfileName, parseKnownFiles } from \"@smithy/shared-ini-file-loader\";\nimport { resolveProcessCredentials } from \"./resolveProcessCredentials\";\nexport const fromProcess = (init = {}) => async ({ callerClientConfig } = {}) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-process - fromProcess\");\n const profiles = await parseKnownFiles(init);\n return resolveProcessCredentials(getProfileName({\n profile: init.profile ?? callerClientConfig?.profile,\n }), profiles, init.logger);\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAEA,SAAS,YAAY;AACrB,SAAS,iBAAiB;;;ACFnB,IAAM,iCAAiC,CAAC,aAAa,MAAM,aAAa;AAD/E;AAEI,MAAI,KAAK,YAAY,GAAG;AACpB,UAAM,MAAM,WAAW,WAAW,+CAA+C;AAAA,EACrF;AACA,MAAI,KAAK,gBAAgB,UAAa,KAAK,oBAAoB,QAAW;AACtE,UAAM,MAAM,WAAW,WAAW,mDAAmD;AAAA,EACzF;AACA,MAAI,KAAK,YAAY;AACjB,UAAM,cAAc,oBAAI,KAAK;AAC7B,UAAM,aAAa,IAAI,KAAK,KAAK,UAAU;AAC3C,QAAI,aAAa,aAAa;AAC1B,YAAM,MAAM,WAAW,WAAW,mDAAmD;AAAA,IACzF;AAAA,EACJ;AACA,MAAI,YAAY,KAAK;AACrB,MAAI,CAAC,eAAa,0CAAW,iBAAX,mBAAyB,iBAAgB;AACvD,gBAAY,SAAS,WAAW,EAAE;AAAA,EACtC;AACA,QAAM,cAAc;AAAA,IAChB,aAAa,KAAK;AAAA,IAClB,iBAAiB,KAAK;AAAA,KAClB,KAAK,gBAAgB,EAAE,cAAc,KAAK,aAAa,IACvD,KAAK,cAAc,EAAE,YAAY,IAAI,KAAK,KAAK,UAAU,EAAE,IAC3D,KAAK,mBAAmB,EAAE,iBAAiB,KAAK,gBAAgB,IAChE,aAAa,EAAE,UAAU;AAEjC,uBAAqB,aAAa,uBAAuB,GAAG;AAC5D,SAAO;AACX;;;ADxBO,IAAM,4BAA4B,OAAO,aAAa,UAAU,WAAW;AALlF;AAMI,QAAM,UAAU,SAAS,WAAW;AACpC,MAAI,SAAS,WAAW,GAAG;AACvB,UAAM,oBAAoB,QAAQ,oBAAoB;AACtD,QAAI,sBAAsB,QAAW;AACjC,YAAM,cAAc,WAAU,gEAAyB,mBAAzB,4BAA4C,SAA5C,YAAoD,IAAI;AACtF,UAAI;AACA,cAAM,EAAE,OAAO,IAAI,MAAM,YAAY,iBAAiB;AACtD,YAAI;AACJ,YAAI;AACA,iBAAO,KAAK,MAAM,OAAO,KAAK,CAAC;AAAA,QACnC,SACM;AACF,gBAAM,MAAM,WAAW,WAAW,4CAA4C;AAAA,QAClF;AACA,eAAO,+BAA+B,aAAa,MAAM,QAAQ;AAAA,MACrE,SACO,OAAO;AACV,cAAM,IAAI,yBAAyB,MAAM,SAAS,EAAE,OAAO,CAAC;AAAA,MAChE;AAAA,IACJ,OACK;AACD,YAAM,IAAI,yBAAyB,WAAW,WAAW,wCAAwC,EAAE,OAAO,CAAC;AAAA,IAC/G;AAAA,EACJ,OACK;AACD,UAAM,IAAI,yBAAyB,WAAW,WAAW,mDAAmD;AAAA,MACxG;AAAA,IACJ,CAAC;AAAA,EACL;AACJ;;;AEjCO,IAAM,cAAc,CAAC,OAAO,CAAC,MAAM,OAAO,EAAE,mBAAmB,IAAI,CAAC,MAAM;AAFjF;AAGI,aAAK,WAAL,mBAAa,MAAM;AACnB,QAAM,WAAW,MAAM,gBAAgB,IAAI;AAC3C,SAAO,0BAA0B,eAAe;AAAA,IAC5C,UAAS,UAAK,YAAL,YAAgB,yDAAoB;AAAA,EACjD,CAAC,GAAG,UAAU,KAAK,MAAM;AAC7B;","names":[]}
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getProfileName,
|
|
3
|
+
getSSOTokenFilepath,
|
|
4
|
+
getSSOTokenFromFile,
|
|
5
|
+
loadSsoSessionData,
|
|
6
|
+
parseKnownFiles
|
|
7
|
+
} from "./chunk-BPBCUO2Z.js";
|
|
8
|
+
import {
|
|
9
|
+
setCredentialFeature
|
|
10
|
+
} from "./chunk-A5TI2FW3.js";
|
|
11
|
+
import {
|
|
12
|
+
CredentialsProviderError,
|
|
13
|
+
ProviderError
|
|
14
|
+
} from "./chunk-XCDCVRJR.js";
|
|
15
|
+
import {
|
|
16
|
+
__publicField,
|
|
17
|
+
__spreadProps,
|
|
18
|
+
__spreadValues
|
|
19
|
+
} from "./chunk-CQBOIXWK.js";
|
|
20
|
+
|
|
21
|
+
// ../../node_modules/@smithy/property-provider/dist-es/TokenProviderError.js
|
|
22
|
+
var TokenProviderError = class _TokenProviderError extends ProviderError {
|
|
23
|
+
constructor(message, options = true) {
|
|
24
|
+
super(message, options);
|
|
25
|
+
__publicField(this, "name", "TokenProviderError");
|
|
26
|
+
Object.setPrototypeOf(this, _TokenProviderError.prototype);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// ../../node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js
|
|
31
|
+
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");
|
|
32
|
+
|
|
33
|
+
// ../../node_modules/@aws-sdk/token-providers/dist-es/constants.js
|
|
34
|
+
var EXPIRE_WINDOW_MS = 5 * 60 * 1e3;
|
|
35
|
+
var REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;
|
|
36
|
+
|
|
37
|
+
// ../../node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js
|
|
38
|
+
var getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
const { SSOOIDCClient } = await import("./sso-oidc-X63KRRLO.js");
|
|
41
|
+
const coalesce = (prop) => {
|
|
42
|
+
var _a2, _b2, _c, _d;
|
|
43
|
+
return (_d = (_c = (_a2 = init.clientConfig) == null ? void 0 : _a2[prop]) != null ? _c : (_b2 = init.parentClientConfig) == null ? void 0 : _b2[prop]) != null ? _d : callerClientConfig == null ? void 0 : callerClientConfig[prop];
|
|
44
|
+
};
|
|
45
|
+
const ssoOidcClient = new SSOOIDCClient(Object.assign({}, (_a = init.clientConfig) != null ? _a : {}, {
|
|
46
|
+
region: ssoRegion != null ? ssoRegion : (_b = init.clientConfig) == null ? void 0 : _b.region,
|
|
47
|
+
logger: coalesce("logger"),
|
|
48
|
+
userAgentAppId: coalesce("userAgentAppId")
|
|
49
|
+
}));
|
|
50
|
+
return ssoOidcClient;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// ../../node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js
|
|
54
|
+
var getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConfig) => {
|
|
55
|
+
const { CreateTokenCommand } = await import("./sso-oidc-X63KRRLO.js");
|
|
56
|
+
const ssoOidcClient = await getSsoOidcClient(ssoRegion, init, callerClientConfig);
|
|
57
|
+
return ssoOidcClient.send(new CreateTokenCommand({
|
|
58
|
+
clientId: ssoToken.clientId,
|
|
59
|
+
clientSecret: ssoToken.clientSecret,
|
|
60
|
+
refreshToken: ssoToken.refreshToken,
|
|
61
|
+
grantType: "refresh_token"
|
|
62
|
+
}));
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// ../../node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js
|
|
66
|
+
var validateTokenExpiry = (token) => {
|
|
67
|
+
if (token.expiration && token.expiration.getTime() < Date.now()) {
|
|
68
|
+
throw new TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// ../../node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js
|
|
73
|
+
var validateTokenKey = (key, value, forRefresh = false) => {
|
|
74
|
+
if (typeof value === "undefined") {
|
|
75
|
+
throw new TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// ../../node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js
|
|
80
|
+
import { promises as fsPromises } from "fs";
|
|
81
|
+
var { writeFile } = fsPromises;
|
|
82
|
+
var writeSSOTokenToFile = (id, ssoToken) => {
|
|
83
|
+
const tokenFilepath = getSSOTokenFilepath(id);
|
|
84
|
+
const tokenString = JSON.stringify(ssoToken, null, 2);
|
|
85
|
+
return writeFile(tokenFilepath, tokenString);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// ../../node_modules/@aws-sdk/token-providers/dist-es/fromSso.js
|
|
89
|
+
var lastRefreshAttemptTime = /* @__PURE__ */ new Date(0);
|
|
90
|
+
var fromSso = (init = {}) => async ({ callerClientConfig } = {}) => {
|
|
91
|
+
var _a, _b;
|
|
92
|
+
(_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/token-providers - fromSso");
|
|
93
|
+
const profiles = await parseKnownFiles(init);
|
|
94
|
+
const profileName = getProfileName({
|
|
95
|
+
profile: (_b = init.profile) != null ? _b : callerClientConfig == null ? void 0 : callerClientConfig.profile
|
|
96
|
+
});
|
|
97
|
+
const profile = profiles[profileName];
|
|
98
|
+
if (!profile) {
|
|
99
|
+
throw new TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
|
|
100
|
+
} else if (!profile["sso_session"]) {
|
|
101
|
+
throw new TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);
|
|
102
|
+
}
|
|
103
|
+
const ssoSessionName = profile["sso_session"];
|
|
104
|
+
const ssoSessions = await loadSsoSessionData(init);
|
|
105
|
+
const ssoSession = ssoSessions[ssoSessionName];
|
|
106
|
+
if (!ssoSession) {
|
|
107
|
+
throw new TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false);
|
|
108
|
+
}
|
|
109
|
+
for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) {
|
|
110
|
+
if (!ssoSession[ssoSessionRequiredKey]) {
|
|
111
|
+
throw new TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const ssoStartUrl = ssoSession["sso_start_url"];
|
|
115
|
+
const ssoRegion = ssoSession["sso_region"];
|
|
116
|
+
let ssoToken;
|
|
117
|
+
try {
|
|
118
|
+
ssoToken = await getSSOTokenFromFile(ssoSessionName);
|
|
119
|
+
} catch (e) {
|
|
120
|
+
throw new TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false);
|
|
121
|
+
}
|
|
122
|
+
validateTokenKey("accessToken", ssoToken.accessToken);
|
|
123
|
+
validateTokenKey("expiresAt", ssoToken.expiresAt);
|
|
124
|
+
const { accessToken, expiresAt } = ssoToken;
|
|
125
|
+
const existingToken = { token: accessToken, expiration: new Date(expiresAt) };
|
|
126
|
+
if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {
|
|
127
|
+
return existingToken;
|
|
128
|
+
}
|
|
129
|
+
if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1e3) {
|
|
130
|
+
validateTokenExpiry(existingToken);
|
|
131
|
+
return existingToken;
|
|
132
|
+
}
|
|
133
|
+
validateTokenKey("clientId", ssoToken.clientId, true);
|
|
134
|
+
validateTokenKey("clientSecret", ssoToken.clientSecret, true);
|
|
135
|
+
validateTokenKey("refreshToken", ssoToken.refreshToken, true);
|
|
136
|
+
try {
|
|
137
|
+
lastRefreshAttemptTime.setTime(Date.now());
|
|
138
|
+
const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init, callerClientConfig);
|
|
139
|
+
validateTokenKey("accessToken", newSsoOidcToken.accessToken);
|
|
140
|
+
validateTokenKey("expiresIn", newSsoOidcToken.expiresIn);
|
|
141
|
+
const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1e3);
|
|
142
|
+
try {
|
|
143
|
+
await writeSSOTokenToFile(ssoSessionName, __spreadProps(__spreadValues({}, ssoToken), {
|
|
144
|
+
accessToken: newSsoOidcToken.accessToken,
|
|
145
|
+
expiresAt: newTokenExpiration.toISOString(),
|
|
146
|
+
refreshToken: newSsoOidcToken.refreshToken
|
|
147
|
+
}));
|
|
148
|
+
} catch (error) {
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
token: newSsoOidcToken.accessToken,
|
|
152
|
+
expiration: newTokenExpiration
|
|
153
|
+
};
|
|
154
|
+
} catch (error) {
|
|
155
|
+
validateTokenExpiry(existingToken);
|
|
156
|
+
return existingToken;
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// ../../node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js
|
|
161
|
+
var SHOULD_FAIL_CREDENTIAL_CHAIN = false;
|
|
162
|
+
var resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, callerClientConfig, profile, filepath, configFilepath, ignoreCache, logger }) => {
|
|
163
|
+
var _a, _b, _c, _d, _e;
|
|
164
|
+
let token;
|
|
165
|
+
const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
|
|
166
|
+
if (ssoSession) {
|
|
167
|
+
try {
|
|
168
|
+
const _token = await fromSso({
|
|
169
|
+
profile,
|
|
170
|
+
filepath,
|
|
171
|
+
configFilepath,
|
|
172
|
+
ignoreCache
|
|
173
|
+
})();
|
|
174
|
+
token = {
|
|
175
|
+
accessToken: _token.token,
|
|
176
|
+
expiresAt: new Date(_token.expiration).toISOString()
|
|
177
|
+
};
|
|
178
|
+
} catch (e) {
|
|
179
|
+
throw new CredentialsProviderError(e.message, {
|
|
180
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
181
|
+
logger
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
} else {
|
|
185
|
+
try {
|
|
186
|
+
token = await getSSOTokenFromFile(ssoStartUrl);
|
|
187
|
+
} catch (e) {
|
|
188
|
+
throw new CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, {
|
|
189
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
190
|
+
logger
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {
|
|
195
|
+
throw new CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, {
|
|
196
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
197
|
+
logger
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
const { accessToken } = token;
|
|
201
|
+
const { SSOClient, GetRoleCredentialsCommand } = await import("./loadSso-ME7MKAM3.js");
|
|
202
|
+
const sso = ssoClient || new SSOClient(Object.assign({}, clientConfig != null ? clientConfig : {}, {
|
|
203
|
+
logger: (_b = (_a = clientConfig == null ? void 0 : clientConfig.logger) != null ? _a : callerClientConfig == null ? void 0 : callerClientConfig.logger) != null ? _b : parentClientConfig == null ? void 0 : parentClientConfig.logger,
|
|
204
|
+
region: (_c = clientConfig == null ? void 0 : clientConfig.region) != null ? _c : ssoRegion,
|
|
205
|
+
userAgentAppId: (_e = (_d = clientConfig == null ? void 0 : clientConfig.userAgentAppId) != null ? _d : callerClientConfig == null ? void 0 : callerClientConfig.userAgentAppId) != null ? _e : parentClientConfig == null ? void 0 : parentClientConfig.userAgentAppId
|
|
206
|
+
}));
|
|
207
|
+
let ssoResp;
|
|
208
|
+
try {
|
|
209
|
+
ssoResp = await sso.send(new GetRoleCredentialsCommand({
|
|
210
|
+
accountId: ssoAccountId,
|
|
211
|
+
roleName: ssoRoleName,
|
|
212
|
+
accessToken
|
|
213
|
+
}));
|
|
214
|
+
} catch (e) {
|
|
215
|
+
throw new CredentialsProviderError(e, {
|
|
216
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
217
|
+
logger
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {} } = ssoResp;
|
|
221
|
+
if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {
|
|
222
|
+
throw new CredentialsProviderError("SSO returns an invalid temporary credential.", {
|
|
223
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
224
|
+
logger
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
const credentials = __spreadValues(__spreadValues({
|
|
228
|
+
accessKeyId,
|
|
229
|
+
secretAccessKey,
|
|
230
|
+
sessionToken,
|
|
231
|
+
expiration: new Date(expiration)
|
|
232
|
+
}, credentialScope && { credentialScope }), accountId && { accountId });
|
|
233
|
+
if (ssoSession) {
|
|
234
|
+
setCredentialFeature(credentials, "CREDENTIALS_SSO", "s");
|
|
235
|
+
} else {
|
|
236
|
+
setCredentialFeature(credentials, "CREDENTIALS_SSO_LEGACY", "u");
|
|
237
|
+
}
|
|
238
|
+
return credentials;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
// ../../node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js
|
|
242
|
+
var validateSsoProfile = (profile, logger) => {
|
|
243
|
+
const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;
|
|
244
|
+
if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {
|
|
245
|
+
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(", ")}
|
|
246
|
+
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger });
|
|
247
|
+
}
|
|
248
|
+
return profile;
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
// ../../node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js
|
|
252
|
+
var fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => {
|
|
253
|
+
var _a, _b;
|
|
254
|
+
(_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-sso - fromSSO");
|
|
255
|
+
const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
|
|
256
|
+
const { ssoClient } = init;
|
|
257
|
+
const profileName = getProfileName({
|
|
258
|
+
profile: (_b = init.profile) != null ? _b : callerClientConfig == null ? void 0 : callerClientConfig.profile
|
|
259
|
+
});
|
|
260
|
+
if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
|
|
261
|
+
const profiles = await parseKnownFiles(init);
|
|
262
|
+
const profile = profiles[profileName];
|
|
263
|
+
if (!profile) {
|
|
264
|
+
throw new CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger });
|
|
265
|
+
}
|
|
266
|
+
if (!isSsoProfile(profile)) {
|
|
267
|
+
throw new CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, {
|
|
268
|
+
logger: init.logger
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
if (profile == null ? void 0 : profile.sso_session) {
|
|
272
|
+
const ssoSessions = await loadSsoSessionData(init);
|
|
273
|
+
const session = ssoSessions[profile.sso_session];
|
|
274
|
+
const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`;
|
|
275
|
+
if (ssoRegion && ssoRegion !== session.sso_region) {
|
|
276
|
+
throw new CredentialsProviderError(`Conflicting SSO region` + conflictMsg, {
|
|
277
|
+
tryNextLink: false,
|
|
278
|
+
logger: init.logger
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) {
|
|
282
|
+
throw new CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, {
|
|
283
|
+
tryNextLink: false,
|
|
284
|
+
logger: init.logger
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
profile.sso_region = session.sso_region;
|
|
288
|
+
profile.sso_start_url = session.sso_start_url;
|
|
289
|
+
}
|
|
290
|
+
const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile, init.logger);
|
|
291
|
+
return resolveSSOCredentials({
|
|
292
|
+
ssoStartUrl: sso_start_url,
|
|
293
|
+
ssoSession: sso_session,
|
|
294
|
+
ssoAccountId: sso_account_id,
|
|
295
|
+
ssoRegion: sso_region,
|
|
296
|
+
ssoRoleName: sso_role_name,
|
|
297
|
+
ssoClient,
|
|
298
|
+
clientConfig: init.clientConfig,
|
|
299
|
+
parentClientConfig: init.parentClientConfig,
|
|
300
|
+
callerClientConfig: init.callerClientConfig,
|
|
301
|
+
profile: profileName,
|
|
302
|
+
filepath: init.filepath,
|
|
303
|
+
configFilepath: init.configFilepath,
|
|
304
|
+
ignoreCache: init.ignoreCache,
|
|
305
|
+
logger: init.logger
|
|
306
|
+
});
|
|
307
|
+
} else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) {
|
|
308
|
+
throw new CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"', { tryNextLink: false, logger: init.logger });
|
|
309
|
+
} else {
|
|
310
|
+
return resolveSSOCredentials({
|
|
311
|
+
ssoStartUrl,
|
|
312
|
+
ssoSession,
|
|
313
|
+
ssoAccountId,
|
|
314
|
+
ssoRegion,
|
|
315
|
+
ssoRoleName,
|
|
316
|
+
ssoClient,
|
|
317
|
+
clientConfig: init.clientConfig,
|
|
318
|
+
parentClientConfig: init.parentClientConfig,
|
|
319
|
+
callerClientConfig: init.callerClientConfig,
|
|
320
|
+
profile: profileName,
|
|
321
|
+
filepath: init.filepath,
|
|
322
|
+
configFilepath: init.configFilepath,
|
|
323
|
+
ignoreCache: init.ignoreCache,
|
|
324
|
+
logger: init.logger
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
export {
|
|
329
|
+
fromSSO,
|
|
330
|
+
isSsoProfile,
|
|
331
|
+
validateSsoProfile
|
|
332
|
+
};
|
|
333
|
+
//# sourceMappingURL=dist-es-5GDBXNKQ.js.map
|