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.
Files changed (94) hide show
  1. package/LICENCE +202 -0
  2. package/README.md +77 -0
  3. package/dist/audio/index.d.mts +2 -0
  4. package/dist/audio/index.mjs +6 -0
  5. package/dist/audio-C0YslYEG.d.mts +32 -0
  6. package/dist/audio-C0YslYEG.d.mts.map +1 -0
  7. package/dist/audio-C4kiPbrV.mjs +1866 -0
  8. package/dist/audio-C4kiPbrV.mjs.map +1 -0
  9. package/dist/audio-CiXUMGyk.mjs +578 -0
  10. package/dist/audio-CiXUMGyk.mjs.map +1 -0
  11. package/dist/chunk-GMkBE123.mjs +47 -0
  12. package/dist/client-Dyypr8tt.mjs +66 -0
  13. package/dist/client-Dyypr8tt.mjs.map +1 -0
  14. package/dist/dist-C37594c6.mjs +27195 -0
  15. package/dist/dist-C37594c6.mjs.map +1 -0
  16. package/dist/dist-CMF9eNLB.mjs +4062 -0
  17. package/dist/dist-CMF9eNLB.mjs.map +1 -0
  18. package/dist/dist-cjs--KIl7Gqy.mjs +6 -0
  19. package/dist/dist-cjs-B-_4TVjP.mjs +66 -0
  20. package/dist/dist-cjs-B-_4TVjP.mjs.map +1 -0
  21. package/dist/dist-cjs-B3TIyZ3K.mjs +437 -0
  22. package/dist/dist-cjs-B3TIyZ3K.mjs.map +1 -0
  23. package/dist/dist-cjs-Bsz2eGzl.mjs +9069 -0
  24. package/dist/dist-cjs-Bsz2eGzl.mjs.map +1 -0
  25. package/dist/dist-cjs-BuJ2FXob.mjs +181 -0
  26. package/dist/dist-cjs-BuJ2FXob.mjs.map +1 -0
  27. package/dist/dist-cjs-C-FMsqmo.mjs +1091 -0
  28. package/dist/dist-cjs-C-FMsqmo.mjs.map +1 -0
  29. package/dist/dist-cjs-C4b9TCXd.mjs +48 -0
  30. package/dist/dist-cjs-C4b9TCXd.mjs.map +1 -0
  31. package/dist/dist-cjs-C817PNLc.mjs +51 -0
  32. package/dist/dist-cjs-C817PNLc.mjs.map +1 -0
  33. package/dist/dist-cjs-CBnnS4k8.mjs +43 -0
  34. package/dist/dist-cjs-CBnnS4k8.mjs.map +1 -0
  35. package/dist/dist-cjs-CWbeD0Mu.mjs +64 -0
  36. package/dist/dist-cjs-CWbeD0Mu.mjs.map +1 -0
  37. package/dist/dist-cjs-ChXEJ1ro.mjs +85 -0
  38. package/dist/dist-cjs-ChXEJ1ro.mjs.map +1 -0
  39. package/dist/dist-cjs-CslF8Dju.mjs +153 -0
  40. package/dist/dist-cjs-CslF8Dju.mjs.map +1 -0
  41. package/dist/dist-cjs-D52jYyEm.mjs +98 -0
  42. package/dist/dist-cjs-D52jYyEm.mjs.map +1 -0
  43. package/dist/dist-cjs-DhWYgNfa.mjs +209 -0
  44. package/dist/dist-cjs-DhWYgNfa.mjs.map +1 -0
  45. package/dist/dist-cjs-DssYqayv.mjs +5015 -0
  46. package/dist/dist-cjs-DssYqayv.mjs.map +1 -0
  47. package/dist/dist-cjs-Du6DnSjo.mjs +137 -0
  48. package/dist/dist-cjs-Du6DnSjo.mjs.map +1 -0
  49. package/dist/dist-cjs-b-oBQaxe.mjs +323 -0
  50. package/dist/dist-cjs-b-oBQaxe.mjs.map +1 -0
  51. package/dist/effects/index.d.mts +2 -0
  52. package/dist/effects/index.mjs +4 -0
  53. package/dist/effects-4t4qk-BR.mjs +21130 -0
  54. package/dist/effects-4t4qk-BR.mjs.map +1 -0
  55. package/dist/event-streams-B0YUBtyM.mjs +204 -0
  56. package/dist/event-streams-B0YUBtyM.mjs.map +1 -0
  57. package/dist/fonts/index.d.mts +2 -0
  58. package/dist/fonts/index.mjs +3 -0
  59. package/dist/fonts-Dn18r_ST.mjs +188 -0
  60. package/dist/fonts-Dn18r_ST.mjs.map +1 -0
  61. package/dist/index-B1557AUi.d.mts +928 -0
  62. package/dist/index-B1557AUi.d.mts.map +1 -0
  63. package/dist/index-DSaMXGoA.d.mts +65 -0
  64. package/dist/index-DSaMXGoA.d.mts.map +1 -0
  65. package/dist/index-FICUHo4P.d.mts +69 -0
  66. package/dist/index-FICUHo4P.d.mts.map +1 -0
  67. package/dist/index-YZsTjqut.d.mts +147 -0
  68. package/dist/index-YZsTjqut.d.mts.map +1 -0
  69. package/dist/index.d.mts +736 -0
  70. package/dist/index.d.mts.map +1 -0
  71. package/dist/index.mjs +7135 -0
  72. package/dist/index.mjs.map +1 -0
  73. package/dist/package-5RsA21g-.mjs +6 -0
  74. package/dist/package-5RsA21g-.mjs.map +1 -0
  75. package/dist/react/index.d.mts +3 -0
  76. package/dist/react/index.mjs +4 -0
  77. package/dist/renderer/index.d.mts +2 -0
  78. package/dist/renderer/index.mjs +6 -0
  79. package/dist/renderer-DVi31fSv.mjs +23274 -0
  80. package/dist/renderer-DVi31fSv.mjs.map +1 -0
  81. package/dist/renderers-CLJQRPVU-CMZnHNK0.mjs +49 -0
  82. package/dist/renderers-CLJQRPVU-CMZnHNK0.mjs.map +1 -0
  83. package/dist/signals/index.d.mts +9 -0
  84. package/dist/signals/index.mjs +8 -0
  85. package/dist/signals-BB_kdndF.mjs +227 -0
  86. package/dist/signals-BB_kdndF.mjs.map +1 -0
  87. package/dist/signin-CVUAIuED.mjs +865 -0
  88. package/dist/signin-CVUAIuED.mjs.map +1 -0
  89. package/dist/sso-oidc-D1GnNQYW.mjs +1051 -0
  90. package/dist/sso-oidc-D1GnNQYW.mjs.map +1 -0
  91. package/dist/sts-Bz-e3kNW.mjs +6 -0
  92. package/dist/sts-I4KhuCBs.mjs +1395 -0
  93. package/dist/sts-I4KhuCBs.mjs.map +1 -0
  94. package/package.json +174 -0
@@ -0,0 +1,6 @@
1
+ import "./chunk-GMkBE123.mjs";
2
+ import { t as require_dist_cjs } from "./dist-cjs-C4b9TCXd.mjs";
3
+
4
+ export default require_dist_cjs();
5
+
6
+ export { };
@@ -0,0 +1,66 @@
1
+ import { a as __toCommonJS, i as __require, t as __commonJSMin } from "./chunk-GMkBE123.mjs";
2
+ import { n as init_client, t as client_exports } from "./client-Dyypr8tt.mjs";
3
+ import { t as require_dist_cjs$1 } from "./dist-cjs-D52jYyEm.mjs";
4
+ import { t as require_dist_cjs$2 } from "./dist-cjs-DhWYgNfa.mjs";
5
+
6
+ //#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.972.18/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js
7
+ var require_dist_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
8
+ var sharedIniFileLoader = require_dist_cjs$2();
9
+ var propertyProvider = require_dist_cjs$1();
10
+ var node_child_process = __require("node:child_process");
11
+ var node_util = __require("node:util");
12
+ var client = (init_client(), __toCommonJS(client_exports));
13
+ const getValidatedProcessCredentials = (profileName, data, profiles) => {
14
+ if (data.Version !== 1) throw Error(`Profile ${profileName} credential_process did not return Version 1.`);
15
+ if (data.AccessKeyId === void 0 || data.SecretAccessKey === void 0) throw Error(`Profile ${profileName} credential_process returned invalid credentials.`);
16
+ if (data.Expiration) {
17
+ const currentTime = /* @__PURE__ */ new Date();
18
+ if (new Date(data.Expiration) < currentTime) throw Error(`Profile ${profileName} credential_process returned expired credentials.`);
19
+ }
20
+ let accountId = data.AccountId;
21
+ if (!accountId && profiles?.[profileName]?.aws_account_id) accountId = profiles[profileName].aws_account_id;
22
+ const credentials = {
23
+ accessKeyId: data.AccessKeyId,
24
+ secretAccessKey: data.SecretAccessKey,
25
+ ...data.SessionToken && { sessionToken: data.SessionToken },
26
+ ...data.Expiration && { expiration: new Date(data.Expiration) },
27
+ ...data.CredentialScope && { credentialScope: data.CredentialScope },
28
+ ...accountId && { accountId }
29
+ };
30
+ client.setCredentialFeature(credentials, "CREDENTIALS_PROCESS", "w");
31
+ return credentials;
32
+ };
33
+ const resolveProcessCredentials = async (profileName, profiles, logger) => {
34
+ const profile = profiles[profileName];
35
+ if (profiles[profileName]) {
36
+ const credentialProcess = profile["credential_process"];
37
+ if (credentialProcess !== void 0) {
38
+ const execPromise = node_util.promisify(sharedIniFileLoader.externalDataInterceptor?.getTokenRecord?.().exec ?? node_child_process.exec);
39
+ try {
40
+ const { stdout } = await execPromise(credentialProcess);
41
+ let data;
42
+ try {
43
+ data = JSON.parse(stdout.trim());
44
+ } catch {
45
+ throw Error(`Profile ${profileName} credential_process returned invalid JSON.`);
46
+ }
47
+ return getValidatedProcessCredentials(profileName, data, profiles);
48
+ } catch (error) {
49
+ throw new propertyProvider.CredentialsProviderError(error.message, { logger });
50
+ }
51
+ } else throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger });
52
+ } else throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, { logger });
53
+ };
54
+ const fromProcess = (init = {}) => async ({ callerClientConfig } = {}) => {
55
+ init.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");
56
+ const profiles = await sharedIniFileLoader.parseKnownFiles(init);
57
+ return resolveProcessCredentials(sharedIniFileLoader.getProfileName({ profile: init.profile ?? callerClientConfig?.profile }), profiles, init.logger);
58
+ };
59
+ exports.fromProcess = fromProcess;
60
+ }));
61
+
62
+ //#endregion
63
+ export default require_dist_cjs();
64
+
65
+ export { };
66
+ //# sourceMappingURL=dist-cjs-B-_4TVjP.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dist-cjs-B-_4TVjP.mjs","names":[],"sources":["../../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.972.18/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js"],"sourcesContent":["'use strict';\n\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\nvar propertyProvider = require('@smithy/property-provider');\nvar node_child_process = require('node:child_process');\nvar node_util = require('node:util');\nvar client = require('@aws-sdk/core/client');\n\nconst 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 client.setCredentialFeature(credentials, \"CREDENTIALS_PROCESS\", \"w\");\n return credentials;\n};\n\nconst 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 = node_util.promisify(sharedIniFileLoader.externalDataInterceptor?.getTokenRecord?.().exec ?? node_child_process.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 propertyProvider.CredentialsProviderError(error.message, { logger });\n }\n }\n else {\n throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger });\n }\n }\n else {\n throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, {\n logger,\n });\n }\n};\n\nconst fromProcess = (init = {}) => async ({ callerClientConfig } = {}) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-process - fromProcess\");\n const profiles = await sharedIniFileLoader.parseKnownFiles(init);\n return resolveProcessCredentials(sharedIniFileLoader.getProfileName({\n profile: init.profile ?? callerClientConfig?.profile,\n }), profiles, init.logger);\n};\n\nexports.fromProcess = fromProcess;\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AM,WAAW,YAAY,4CAA4C;;AAEnF,YAAO,+BAA+B,aAAa,MAAM,SAAS;aAE/D,OAAO;AACV,WAAM,IAAI,iBAAiB,yBAAyB,MAAM,SAAS,EAAE,QAAQ,CAAC;;SAIlF,OAAM,IAAI,iBAAiB,yBAAyB,WAAW,YAAY,uCAAuC,EAAE,QAAQ,CAAC;QAIjI,OAAM,IAAI,iBAAiB,yBAAyB,WAAW,YAAY,kDAAkD,EACzH,QACH,CAAC;;CAIV,MAAM,eAAe,OAAO,EAAE,KAAK,OAAO,EAAE,uBAAuB,EAAE,KAAK;AACtE,OAAK,QAAQ,MAAM,qDAAqD;EACxE,MAAM,WAAW,MAAM,oBAAoB,gBAAgB,KAAK;AAChE,SAAO,0BAA0B,oBAAoB,eAAe,EAChE,SAAS,KAAK,WAAW,oBAAoB,SAChD,CAAC,EAAE,UAAU,KAAK,OAAO;;AAG9B,SAAQ,cAAc"}
@@ -0,0 +1,437 @@
1
+ import { a as __toCommonJS, i as __require, o as __toESM, 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, t as client_exports } from "./client-Dyypr8tt.mjs";
4
+ import { t as require_dist_cjs$3 } from "./dist-cjs-D52jYyEm.mjs";
5
+ import { t as require_dist_cjs$4 } from "./dist-cjs-DhWYgNfa.mjs";
6
+
7
+ //#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-login@3.972.20/node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js
8
+ var require_dist_cjs$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
9
+ var client = (init_client(), __toCommonJS(client_exports));
10
+ var propertyProvider = require_dist_cjs$3();
11
+ var sharedIniFileLoader = require_dist_cjs$4();
12
+ var protocolHttp = require_dist_cjs$2();
13
+ var node_crypto = __require("node:crypto");
14
+ var node_fs = __require("node:fs");
15
+ var node_os = __require("node:os");
16
+ var node_path = __require("node:path");
17
+ var LoginCredentialsFetcher = class LoginCredentialsFetcher {
18
+ profileData;
19
+ init;
20
+ callerClientConfig;
21
+ static REFRESH_THRESHOLD = 300 * 1e3;
22
+ constructor(profileData, init, callerClientConfig) {
23
+ this.profileData = profileData;
24
+ this.init = init;
25
+ this.callerClientConfig = callerClientConfig;
26
+ }
27
+ async loadCredentials() {
28
+ const token = await this.loadToken();
29
+ if (!token) throw new propertyProvider.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`, {
30
+ tryNextLink: false,
31
+ logger: this.logger
32
+ });
33
+ const accessToken = token.accessToken;
34
+ const now = Date.now();
35
+ if (new Date(accessToken.expiresAt).getTime() - now <= LoginCredentialsFetcher.REFRESH_THRESHOLD) return this.refresh(token);
36
+ return {
37
+ accessKeyId: accessToken.accessKeyId,
38
+ secretAccessKey: accessToken.secretAccessKey,
39
+ sessionToken: accessToken.sessionToken,
40
+ accountId: accessToken.accountId,
41
+ expiration: new Date(accessToken.expiresAt)
42
+ };
43
+ }
44
+ get logger() {
45
+ return this.init?.logger;
46
+ }
47
+ get loginSession() {
48
+ return this.profileData.login_session;
49
+ }
50
+ async refresh(token) {
51
+ const { SigninClient, CreateOAuth2TokenCommand } = await import("./signin-CVUAIuED.mjs");
52
+ const { logger, userAgentAppId } = this.callerClientConfig ?? {};
53
+ const isH2 = (requestHandler$1) => {
54
+ return requestHandler$1?.metadata?.handlerProtocol === "h2";
55
+ };
56
+ const requestHandler = isH2(this.callerClientConfig?.requestHandler) ? void 0 : this.callerClientConfig?.requestHandler;
57
+ const client = new SigninClient({
58
+ credentials: {
59
+ accessKeyId: "",
60
+ secretAccessKey: ""
61
+ },
62
+ region: this.profileData.region ?? await this.callerClientConfig?.region?.() ?? process.env.AWS_REGION,
63
+ requestHandler,
64
+ logger,
65
+ userAgentAppId,
66
+ ...this.init?.clientConfig
67
+ });
68
+ this.createDPoPInterceptor(client.middlewareStack);
69
+ const commandInput = { tokenInput: {
70
+ clientId: token.clientId,
71
+ refreshToken: token.refreshToken,
72
+ grantType: "refresh_token"
73
+ } };
74
+ try {
75
+ const response = await client.send(new CreateOAuth2TokenCommand(commandInput));
76
+ const { accessKeyId, secretAccessKey, sessionToken } = response.tokenOutput?.accessToken ?? {};
77
+ const { refreshToken, expiresIn } = response.tokenOutput ?? {};
78
+ if (!accessKeyId || !secretAccessKey || !sessionToken || !refreshToken) throw new propertyProvider.CredentialsProviderError("Token refresh response missing required fields", {
79
+ logger: this.logger,
80
+ tryNextLink: false
81
+ });
82
+ const expiresInMs = (expiresIn ?? 900) * 1e3;
83
+ const expiration = new Date(Date.now() + expiresInMs);
84
+ const updatedToken = {
85
+ ...token,
86
+ accessToken: {
87
+ ...token.accessToken,
88
+ accessKeyId,
89
+ secretAccessKey,
90
+ sessionToken,
91
+ expiresAt: expiration.toISOString()
92
+ },
93
+ refreshToken
94
+ };
95
+ await this.saveToken(updatedToken);
96
+ const newAccessToken = updatedToken.accessToken;
97
+ return {
98
+ accessKeyId: newAccessToken.accessKeyId,
99
+ secretAccessKey: newAccessToken.secretAccessKey,
100
+ sessionToken: newAccessToken.sessionToken,
101
+ accountId: newAccessToken.accountId,
102
+ expiration
103
+ };
104
+ } catch (error) {
105
+ if (error.name === "AccessDeniedException") {
106
+ const errorType = error.error;
107
+ let message;
108
+ switch (errorType) {
109
+ case "TOKEN_EXPIRED":
110
+ message = "Your session has expired. Please reauthenticate.";
111
+ break;
112
+ case "USER_CREDENTIALS_CHANGED":
113
+ message = "Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";
114
+ break;
115
+ case "INSUFFICIENT_PERMISSIONS":
116
+ message = "Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";
117
+ break;
118
+ default: message = `Failed to refresh token: ${String(error)}. Please re-authenticate using \`aws login\``;
119
+ }
120
+ throw new propertyProvider.CredentialsProviderError(message, {
121
+ logger: this.logger,
122
+ tryNextLink: false
123
+ });
124
+ }
125
+ throw new propertyProvider.CredentialsProviderError(`Failed to refresh token: ${String(error)}. Please re-authenticate using aws login`, { logger: this.logger });
126
+ }
127
+ }
128
+ async loadToken() {
129
+ const tokenFilePath = this.getTokenFilePath();
130
+ try {
131
+ let tokenData;
132
+ try {
133
+ tokenData = await sharedIniFileLoader.readFile(tokenFilePath, { ignoreCache: this.init?.ignoreCache });
134
+ } catch {
135
+ tokenData = await node_fs.promises.readFile(tokenFilePath, "utf8");
136
+ }
137
+ const token = JSON.parse(tokenData);
138
+ const missingFields = [
139
+ "accessToken",
140
+ "clientId",
141
+ "refreshToken",
142
+ "dpopKey"
143
+ ].filter((k) => !token[k]);
144
+ if (!token.accessToken?.accountId) missingFields.push("accountId");
145
+ if (missingFields.length > 0) throw new propertyProvider.CredentialsProviderError(`Token validation failed, missing fields: ${missingFields.join(", ")}`, {
146
+ logger: this.logger,
147
+ tryNextLink: false
148
+ });
149
+ return token;
150
+ } catch (error) {
151
+ throw new propertyProvider.CredentialsProviderError(`Failed to load token from ${tokenFilePath}: ${String(error)}`, {
152
+ logger: this.logger,
153
+ tryNextLink: false
154
+ });
155
+ }
156
+ }
157
+ async saveToken(token) {
158
+ const tokenFilePath = this.getTokenFilePath();
159
+ const directory = node_path.dirname(tokenFilePath);
160
+ try {
161
+ await node_fs.promises.mkdir(directory, { recursive: true });
162
+ } catch (error) {}
163
+ await node_fs.promises.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8");
164
+ }
165
+ getTokenFilePath() {
166
+ const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? node_path.join(node_os.homedir(), ".aws", "login", "cache");
167
+ const loginSessionBytes = Buffer.from(this.loginSession, "utf8");
168
+ const loginSessionSha256 = node_crypto.createHash("sha256").update(loginSessionBytes).digest("hex");
169
+ return node_path.join(directory, `${loginSessionSha256}.json`);
170
+ }
171
+ derToRawSignature(derSignature) {
172
+ let offset = 2;
173
+ if (derSignature[offset] !== 2) throw new Error("Invalid DER signature");
174
+ offset++;
175
+ const rLength = derSignature[offset++];
176
+ let r = derSignature.subarray(offset, offset + rLength);
177
+ offset += rLength;
178
+ if (derSignature[offset] !== 2) throw new Error("Invalid DER signature");
179
+ offset++;
180
+ const sLength = derSignature[offset++];
181
+ let s = derSignature.subarray(offset, offset + sLength);
182
+ r = r[0] === 0 ? r.subarray(1) : r;
183
+ s = s[0] === 0 ? s.subarray(1) : s;
184
+ const rPadded = Buffer.concat([Buffer.alloc(32 - r.length), r]);
185
+ const sPadded = Buffer.concat([Buffer.alloc(32 - s.length), s]);
186
+ return Buffer.concat([rPadded, sPadded]);
187
+ }
188
+ createDPoPInterceptor(middlewareStack) {
189
+ middlewareStack.add((next) => async (args) => {
190
+ if (protocolHttp.HttpRequest.isInstance(args.request)) {
191
+ const request = args.request;
192
+ const actualEndpoint = `${request.protocol}//${request.hostname}${request.port ? `:${request.port}` : ""}${request.path}`;
193
+ const dpop = await this.generateDpop(request.method, actualEndpoint);
194
+ request.headers = {
195
+ ...request.headers,
196
+ DPoP: dpop
197
+ };
198
+ }
199
+ return next(args);
200
+ }, {
201
+ step: "finalizeRequest",
202
+ name: "dpopInterceptor",
203
+ override: true
204
+ });
205
+ }
206
+ async generateDpop(method = "POST", endpoint) {
207
+ const token = await this.loadToken();
208
+ try {
209
+ const privateKey = node_crypto.createPrivateKey({
210
+ key: token.dpopKey,
211
+ format: "pem",
212
+ type: "sec1"
213
+ });
214
+ const publicDer = node_crypto.createPublicKey(privateKey).export({
215
+ format: "der",
216
+ type: "spki"
217
+ });
218
+ let pointStart = -1;
219
+ for (let i = 0; i < publicDer.length; i++) if (publicDer[i] === 4) {
220
+ pointStart = i;
221
+ break;
222
+ }
223
+ const x = publicDer.slice(pointStart + 1, pointStart + 33);
224
+ const y = publicDer.slice(pointStart + 33, pointStart + 65);
225
+ const header = {
226
+ alg: "ES256",
227
+ typ: "dpop+jwt",
228
+ jwk: {
229
+ kty: "EC",
230
+ crv: "P-256",
231
+ x: x.toString("base64url"),
232
+ y: y.toString("base64url")
233
+ }
234
+ };
235
+ const payload = {
236
+ jti: crypto.randomUUID(),
237
+ htm: method,
238
+ htu: endpoint,
239
+ iat: Math.floor(Date.now() / 1e3)
240
+ };
241
+ const message = `${Buffer.from(JSON.stringify(header)).toString("base64url")}.${Buffer.from(JSON.stringify(payload)).toString("base64url")}`;
242
+ const asn1Signature = node_crypto.sign("sha256", Buffer.from(message), privateKey);
243
+ return `${message}.${this.derToRawSignature(asn1Signature).toString("base64url")}`;
244
+ } catch (error) {
245
+ throw new propertyProvider.CredentialsProviderError(`Failed to generate Dpop proof: ${error instanceof Error ? error.message : String(error)}`, {
246
+ logger: this.logger,
247
+ tryNextLink: false
248
+ });
249
+ }
250
+ }
251
+ };
252
+ const fromLoginCredentials = (init) => async ({ callerClientConfig } = {}) => {
253
+ init?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");
254
+ const profiles = await sharedIniFileLoader.parseKnownFiles(init || {});
255
+ const profileName = sharedIniFileLoader.getProfileName({ profile: init?.profile ?? callerClientConfig?.profile });
256
+ const profile = profiles[profileName];
257
+ if (!profile?.login_session) throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} does not contain login_session.`, {
258
+ tryNextLink: true,
259
+ logger: init?.logger
260
+ });
261
+ const credentials = await new LoginCredentialsFetcher(profile, init, callerClientConfig).loadCredentials();
262
+ return client.setCredentialFeature(credentials, "CREDENTIALS_LOGIN", "AD");
263
+ };
264
+ exports.fromLoginCredentials = fromLoginCredentials;
265
+ }));
266
+
267
+ //#endregion
268
+ //#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.972.20/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js
269
+ var require_dist_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
270
+ var sharedIniFileLoader = require_dist_cjs$4();
271
+ var propertyProvider = require_dist_cjs$3();
272
+ var client = (init_client(), __toCommonJS(client_exports));
273
+ var credentialProviderLogin = require_dist_cjs$1();
274
+ const resolveCredentialSource = (credentialSource, profileName, logger) => {
275
+ const sourceProvidersMap = {
276
+ EcsContainer: async (options) => {
277
+ const { fromHttp } = await import("./dist-cjs-BuJ2FXob.mjs").then((m) => /* @__PURE__ */ __toESM(m.default));
278
+ const { fromContainerMetadata } = await import("./dist-cjs-b-oBQaxe.mjs").then((m) => /* @__PURE__ */ __toESM(m.default));
279
+ logger?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer");
280
+ return async () => propertyProvider.chain(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider);
281
+ },
282
+ Ec2InstanceMetadata: async (options) => {
283
+ logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");
284
+ const { fromInstanceMetadata } = await import("./dist-cjs-b-oBQaxe.mjs").then((m) => /* @__PURE__ */ __toESM(m.default));
285
+ return async () => fromInstanceMetadata(options)().then(setNamedProvider);
286
+ },
287
+ Environment: async (options) => {
288
+ logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");
289
+ const { fromEnv } = await import("./dist-cjs--KIl7Gqy.mjs").then((m) => /* @__PURE__ */ __toESM(m.default));
290
+ return async () => fromEnv(options)().then(setNamedProvider);
291
+ }
292
+ };
293
+ if (credentialSource in sourceProvidersMap) return sourceProvidersMap[credentialSource];
294
+ else throw new propertyProvider.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger });
295
+ };
296
+ const setNamedProvider = (creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_NAMED_PROVIDER", "p");
297
+ const isAssumeRoleProfile = (arg, { profile = "default", logger } = {}) => {
298
+ return Boolean(arg) && typeof arg === "object" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && (isAssumeRoleWithSourceProfile(arg, {
299
+ profile,
300
+ logger
301
+ }) || isCredentialSourceProfile(arg, {
302
+ profile,
303
+ logger
304
+ }));
305
+ };
306
+ const isAssumeRoleWithSourceProfile = (arg, { profile, logger }) => {
307
+ const withSourceProfile = typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined";
308
+ if (withSourceProfile) logger?.debug?.(` ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`);
309
+ return withSourceProfile;
310
+ };
311
+ const isCredentialSourceProfile = (arg, { profile, logger }) => {
312
+ const withProviderProfile = typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined";
313
+ if (withProviderProfile) logger?.debug?.(` ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`);
314
+ return withProviderProfile;
315
+ };
316
+ const resolveAssumeRoleCredentials = async (profileName, profiles, options, callerClientConfig, visitedProfiles = {}, resolveProfileData) => {
317
+ options.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");
318
+ const profileData = profiles[profileName];
319
+ const { source_profile, region } = profileData;
320
+ if (!options.roleAssumer) {
321
+ const { getDefaultRoleAssumer } = await import("./sts-Bz-e3kNW.mjs");
322
+ options.roleAssumer = getDefaultRoleAssumer({
323
+ ...options.clientConfig,
324
+ credentialProviderLogger: options.logger,
325
+ parentClientConfig: {
326
+ ...callerClientConfig,
327
+ ...options?.parentClientConfig,
328
+ region: region ?? options?.parentClientConfig?.region ?? callerClientConfig?.region
329
+ }
330
+ }, options.clientPlugins);
331
+ }
332
+ if (source_profile && source_profile in visitedProfiles) throw new propertyProvider.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${sharedIniFileLoader.getProfileName(options)}. Profiles visited: ` + Object.keys(visitedProfiles).join(", "), { logger: options.logger });
333
+ options.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`);
334
+ const sourceCredsProvider = source_profile ? resolveProfileData(source_profile, profiles, options, callerClientConfig, {
335
+ ...visitedProfiles,
336
+ [source_profile]: true
337
+ }, isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {})) : (await resolveCredentialSource(profileData.credential_source, profileName, options.logger)(options))();
338
+ if (isCredentialSourceWithoutRoleArn(profileData)) return sourceCredsProvider.then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o"));
339
+ else {
340
+ const params = {
341
+ RoleArn: profileData.role_arn,
342
+ RoleSessionName: profileData.role_session_name || `aws-sdk-js-${Date.now()}`,
343
+ ExternalId: profileData.external_id,
344
+ DurationSeconds: parseInt(profileData.duration_seconds || "3600", 10)
345
+ };
346
+ const { mfa_serial } = profileData;
347
+ if (mfa_serial) {
348
+ if (!options.mfaCodeProvider) throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, {
349
+ logger: options.logger,
350
+ tryNextLink: false
351
+ });
352
+ params.SerialNumber = mfa_serial;
353
+ params.TokenCode = await options.mfaCodeProvider(mfa_serial);
354
+ }
355
+ const sourceCreds = await sourceCredsProvider;
356
+ return options.roleAssumer(sourceCreds, params).then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o"));
357
+ }
358
+ };
359
+ const isCredentialSourceWithoutRoleArn = (section) => {
360
+ return !section.role_arn && !!section.credential_source;
361
+ };
362
+ const isLoginProfile = (data) => {
363
+ return Boolean(data && data.login_session);
364
+ };
365
+ const resolveLoginCredentials = async (profileName, options, callerClientConfig) => {
366
+ const credentials = await credentialProviderLogin.fromLoginCredentials({
367
+ ...options,
368
+ profile: profileName
369
+ })({ callerClientConfig });
370
+ return client.setCredentialFeature(credentials, "CREDENTIALS_PROFILE_LOGIN", "AC");
371
+ };
372
+ const isProcessProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string";
373
+ const resolveProcessCredentials = async (options, profile) => import("./dist-cjs-B-_4TVjP.mjs").then((m) => /* @__PURE__ */ __toESM(m.default)).then(({ fromProcess }) => fromProcess({
374
+ ...options,
375
+ profile
376
+ })().then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_PROCESS", "v")));
377
+ const resolveSsoCredentials = async (profile, profileData, options = {}, callerClientConfig) => {
378
+ const { fromSSO } = await import("./dist-cjs-C-FMsqmo.mjs").then((m) => /* @__PURE__ */ __toESM(m.default));
379
+ return fromSSO({
380
+ profile,
381
+ logger: options.logger,
382
+ parentClientConfig: options.parentClientConfig,
383
+ clientConfig: options.clientConfig
384
+ })({ callerClientConfig }).then((creds) => {
385
+ if (profileData.sso_session) return client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO", "r");
386
+ else return client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO_LEGACY", "t");
387
+ });
388
+ };
389
+ 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");
390
+ const isStaticCredsProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.aws_access_key_id === "string" && typeof arg.aws_secret_access_key === "string" && ["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1 && ["undefined", "string"].indexOf(typeof arg.aws_account_id) > -1;
391
+ const resolveStaticCredentials = async (profile, options) => {
392
+ options?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");
393
+ const credentials = {
394
+ accessKeyId: profile.aws_access_key_id,
395
+ secretAccessKey: profile.aws_secret_access_key,
396
+ sessionToken: profile.aws_session_token,
397
+ ...profile.aws_credential_scope && { credentialScope: profile.aws_credential_scope },
398
+ ...profile.aws_account_id && { accountId: profile.aws_account_id }
399
+ };
400
+ return client.setCredentialFeature(credentials, "CREDENTIALS_PROFILE", "n");
401
+ };
402
+ const isWebIdentityProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.web_identity_token_file === "string" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1;
403
+ const resolveWebIdentityCredentials = async (profile, options, callerClientConfig) => import("./dist-cjs-Du6DnSjo.mjs").then((m) => /* @__PURE__ */ __toESM(m.default)).then(({ fromTokenFile }) => fromTokenFile({
404
+ webIdentityTokenFile: profile.web_identity_token_file,
405
+ roleArn: profile.role_arn,
406
+ roleSessionName: profile.role_session_name,
407
+ roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,
408
+ logger: options.logger,
409
+ parentClientConfig: options.parentClientConfig
410
+ })({ callerClientConfig }).then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN", "q")));
411
+ const resolveProfileData = async (profileName, profiles, options, callerClientConfig, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => {
412
+ const data = profiles[profileName];
413
+ if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) return resolveStaticCredentials(data, options);
414
+ if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data, {
415
+ profile: profileName,
416
+ logger: options.logger
417
+ })) return resolveAssumeRoleCredentials(profileName, profiles, options, callerClientConfig, visitedProfiles, resolveProfileData);
418
+ if (isStaticCredsProfile(data)) return resolveStaticCredentials(data, options);
419
+ if (isWebIdentityProfile(data)) return resolveWebIdentityCredentials(data, options, callerClientConfig);
420
+ if (isProcessProfile(data)) return resolveProcessCredentials(options, profileName);
421
+ if (isSsoProfile(data)) return await resolveSsoCredentials(profileName, data, options, callerClientConfig);
422
+ if (isLoginProfile(data)) return resolveLoginCredentials(profileName, options, callerClientConfig);
423
+ throw new propertyProvider.CredentialsProviderError(`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`, { logger: options.logger });
424
+ };
425
+ const fromIni = (init = {}) => async ({ callerClientConfig } = {}) => {
426
+ init.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");
427
+ const profiles = await sharedIniFileLoader.parseKnownFiles(init);
428
+ return resolveProfileData(sharedIniFileLoader.getProfileName({ profile: init.profile ?? callerClientConfig?.profile }), profiles, init, callerClientConfig);
429
+ };
430
+ exports.fromIni = fromIni;
431
+ }));
432
+
433
+ //#endregion
434
+ export default require_dist_cjs();
435
+
436
+ export { };
437
+ //# sourceMappingURL=dist-cjs-B3TIyZ3K.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dist-cjs-B3TIyZ3K.mjs","names":["requestHandler"],"sources":["../../../node_modules/.pnpm/@aws-sdk+credential-provider-login@3.972.20/node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js","../../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.972.20/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js"],"sourcesContent":["'use strict';\n\nvar client = require('@aws-sdk/core/client');\nvar propertyProvider = require('@smithy/property-provider');\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\nvar protocolHttp = require('@smithy/protocol-http');\nvar node_crypto = require('node:crypto');\nvar node_fs = require('node:fs');\nvar node_os = require('node:os');\nvar node_path = require('node:path');\n\nclass LoginCredentialsFetcher {\n profileData;\n init;\n callerClientConfig;\n static REFRESH_THRESHOLD = 5 * 60 * 1000;\n constructor(profileData, init, callerClientConfig) {\n this.profileData = profileData;\n this.init = init;\n this.callerClientConfig = callerClientConfig;\n }\n async loadCredentials() {\n const token = await this.loadToken();\n if (!token) {\n throw new propertyProvider.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`, { tryNextLink: false, logger: this.logger });\n }\n const accessToken = token.accessToken;\n const now = Date.now();\n const expiryTime = new Date(accessToken.expiresAt).getTime();\n const timeUntilExpiry = expiryTime - now;\n if (timeUntilExpiry <= LoginCredentialsFetcher.REFRESH_THRESHOLD) {\n return this.refresh(token);\n }\n return {\n accessKeyId: accessToken.accessKeyId,\n secretAccessKey: accessToken.secretAccessKey,\n sessionToken: accessToken.sessionToken,\n accountId: accessToken.accountId,\n expiration: new Date(accessToken.expiresAt),\n };\n }\n get logger() {\n return this.init?.logger;\n }\n get loginSession() {\n return this.profileData.login_session;\n }\n async refresh(token) {\n const { SigninClient, CreateOAuth2TokenCommand } = await import('@aws-sdk/nested-clients/signin');\n const { logger, userAgentAppId } = this.callerClientConfig ?? {};\n const isH2 = (requestHandler) => {\n return requestHandler?.metadata?.handlerProtocol === \"h2\";\n };\n const requestHandler = isH2(this.callerClientConfig?.requestHandler)\n ? undefined\n : this.callerClientConfig?.requestHandler;\n const region = this.profileData.region ?? (await this.callerClientConfig?.region?.()) ?? process.env.AWS_REGION;\n const client = new SigninClient({\n credentials: {\n accessKeyId: \"\",\n secretAccessKey: \"\",\n },\n region,\n requestHandler,\n logger,\n userAgentAppId,\n ...this.init?.clientConfig,\n });\n this.createDPoPInterceptor(client.middlewareStack);\n const commandInput = {\n tokenInput: {\n clientId: token.clientId,\n refreshToken: token.refreshToken,\n grantType: \"refresh_token\",\n },\n };\n try {\n const response = await client.send(new CreateOAuth2TokenCommand(commandInput));\n const { accessKeyId, secretAccessKey, sessionToken } = response.tokenOutput?.accessToken ?? {};\n const { refreshToken, expiresIn } = response.tokenOutput ?? {};\n if (!accessKeyId || !secretAccessKey || !sessionToken || !refreshToken) {\n throw new propertyProvider.CredentialsProviderError(\"Token refresh response missing required fields\", {\n logger: this.logger,\n tryNextLink: false,\n });\n }\n const expiresInMs = (expiresIn ?? 900) * 1000;\n const expiration = new Date(Date.now() + expiresInMs);\n const updatedToken = {\n ...token,\n accessToken: {\n ...token.accessToken,\n accessKeyId: accessKeyId,\n secretAccessKey: secretAccessKey,\n sessionToken: sessionToken,\n expiresAt: expiration.toISOString(),\n },\n refreshToken: refreshToken,\n };\n await this.saveToken(updatedToken);\n const newAccessToken = updatedToken.accessToken;\n return {\n accessKeyId: newAccessToken.accessKeyId,\n secretAccessKey: newAccessToken.secretAccessKey,\n sessionToken: newAccessToken.sessionToken,\n accountId: newAccessToken.accountId,\n expiration,\n };\n }\n catch (error) {\n if (error.name === \"AccessDeniedException\") {\n const errorType = error.error;\n let message;\n switch (errorType) {\n case \"TOKEN_EXPIRED\":\n message = \"Your session has expired. Please reauthenticate.\";\n break;\n case \"USER_CREDENTIALS_CHANGED\":\n message =\n \"Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.\";\n break;\n case \"INSUFFICIENT_PERMISSIONS\":\n message =\n \"Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.\";\n break;\n default:\n message = `Failed to refresh token: ${String(error)}. Please re-authenticate using \\`aws login\\``;\n }\n throw new propertyProvider.CredentialsProviderError(message, { logger: this.logger, tryNextLink: false });\n }\n throw new propertyProvider.CredentialsProviderError(`Failed to refresh token: ${String(error)}. Please re-authenticate using aws login`, { logger: this.logger });\n }\n }\n async loadToken() {\n const tokenFilePath = this.getTokenFilePath();\n try {\n let tokenData;\n try {\n tokenData = await sharedIniFileLoader.readFile(tokenFilePath, { ignoreCache: this.init?.ignoreCache });\n }\n catch {\n tokenData = await node_fs.promises.readFile(tokenFilePath, \"utf8\");\n }\n const token = JSON.parse(tokenData);\n const missingFields = [\"accessToken\", \"clientId\", \"refreshToken\", \"dpopKey\"].filter((k) => !token[k]);\n if (!token.accessToken?.accountId) {\n missingFields.push(\"accountId\");\n }\n if (missingFields.length > 0) {\n throw new propertyProvider.CredentialsProviderError(`Token validation failed, missing fields: ${missingFields.join(\", \")}`, {\n logger: this.logger,\n tryNextLink: false,\n });\n }\n return token;\n }\n catch (error) {\n throw new propertyProvider.CredentialsProviderError(`Failed to load token from ${tokenFilePath}: ${String(error)}`, {\n logger: this.logger,\n tryNextLink: false,\n });\n }\n }\n async saveToken(token) {\n const tokenFilePath = this.getTokenFilePath();\n const directory = node_path.dirname(tokenFilePath);\n try {\n await node_fs.promises.mkdir(directory, { recursive: true });\n }\n catch (error) {\n }\n await node_fs.promises.writeFile(tokenFilePath, JSON.stringify(token, null, 2), \"utf8\");\n }\n getTokenFilePath() {\n const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? node_path.join(node_os.homedir(), \".aws\", \"login\", \"cache\");\n const loginSessionBytes = Buffer.from(this.loginSession, \"utf8\");\n const loginSessionSha256 = node_crypto.createHash(\"sha256\").update(loginSessionBytes).digest(\"hex\");\n return node_path.join(directory, `${loginSessionSha256}.json`);\n }\n derToRawSignature(derSignature) {\n let offset = 2;\n if (derSignature[offset] !== 0x02) {\n throw new Error(\"Invalid DER signature\");\n }\n offset++;\n const rLength = derSignature[offset++];\n let r = derSignature.subarray(offset, offset + rLength);\n offset += rLength;\n if (derSignature[offset] !== 0x02) {\n throw new Error(\"Invalid DER signature\");\n }\n offset++;\n const sLength = derSignature[offset++];\n let s = derSignature.subarray(offset, offset + sLength);\n r = r[0] === 0x00 ? r.subarray(1) : r;\n s = s[0] === 0x00 ? s.subarray(1) : s;\n const rPadded = Buffer.concat([Buffer.alloc(32 - r.length), r]);\n const sPadded = Buffer.concat([Buffer.alloc(32 - s.length), s]);\n return Buffer.concat([rPadded, sPadded]);\n }\n createDPoPInterceptor(middlewareStack) {\n middlewareStack.add((next) => async (args) => {\n if (protocolHttp.HttpRequest.isInstance(args.request)) {\n const request = args.request;\n const actualEndpoint = `${request.protocol}//${request.hostname}${request.port ? `:${request.port}` : \"\"}${request.path}`;\n const dpop = await this.generateDpop(request.method, actualEndpoint);\n request.headers = {\n ...request.headers,\n DPoP: dpop,\n };\n }\n return next(args);\n }, {\n step: \"finalizeRequest\",\n name: \"dpopInterceptor\",\n override: true,\n });\n }\n async generateDpop(method = \"POST\", endpoint) {\n const token = await this.loadToken();\n try {\n const privateKey = node_crypto.createPrivateKey({\n key: token.dpopKey,\n format: \"pem\",\n type: \"sec1\",\n });\n const publicKey = node_crypto.createPublicKey(privateKey);\n const publicDer = publicKey.export({ format: \"der\", type: \"spki\" });\n let pointStart = -1;\n for (let i = 0; i < publicDer.length; i++) {\n if (publicDer[i] === 0x04) {\n pointStart = i;\n break;\n }\n }\n const x = publicDer.slice(pointStart + 1, pointStart + 33);\n const y = publicDer.slice(pointStart + 33, pointStart + 65);\n const header = {\n alg: \"ES256\",\n typ: \"dpop+jwt\",\n jwk: {\n kty: \"EC\",\n crv: \"P-256\",\n x: x.toString(\"base64url\"),\n y: y.toString(\"base64url\"),\n },\n };\n const payload = {\n jti: crypto.randomUUID(),\n htm: method,\n htu: endpoint,\n iat: Math.floor(Date.now() / 1000),\n };\n const headerB64 = Buffer.from(JSON.stringify(header)).toString(\"base64url\");\n const payloadB64 = Buffer.from(JSON.stringify(payload)).toString(\"base64url\");\n const message = `${headerB64}.${payloadB64}`;\n const asn1Signature = node_crypto.sign(\"sha256\", Buffer.from(message), privateKey);\n const rawSignature = this.derToRawSignature(asn1Signature);\n const signatureB64 = rawSignature.toString(\"base64url\");\n return `${message}.${signatureB64}`;\n }\n catch (error) {\n throw new propertyProvider.CredentialsProviderError(`Failed to generate Dpop proof: ${error instanceof Error ? error.message : String(error)}`, { logger: this.logger, tryNextLink: false });\n }\n }\n}\n\nconst fromLoginCredentials = (init) => async ({ callerClientConfig } = {}) => {\n init?.logger?.debug?.(\"@aws-sdk/credential-providers - fromLoginCredentials\");\n const profiles = await sharedIniFileLoader.parseKnownFiles(init || {});\n const profileName = sharedIniFileLoader.getProfileName({\n profile: init?.profile ?? callerClientConfig?.profile,\n });\n const profile = profiles[profileName];\n if (!profile?.login_session) {\n throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} does not contain login_session.`, {\n tryNextLink: true,\n logger: init?.logger,\n });\n }\n const fetcher = new LoginCredentialsFetcher(profile, init, callerClientConfig);\n const credentials = await fetcher.loadCredentials();\n return client.setCredentialFeature(credentials, \"CREDENTIALS_LOGIN\", \"AD\");\n};\n\nexports.fromLoginCredentials = fromLoginCredentials;\n","'use strict';\n\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\nvar propertyProvider = require('@smithy/property-provider');\nvar client = require('@aws-sdk/core/client');\nvar credentialProviderLogin = require('@aws-sdk/credential-provider-login');\n\nconst resolveCredentialSource = (credentialSource, profileName, logger) => {\n const sourceProvidersMap = {\n EcsContainer: async (options) => {\n const { fromHttp } = await import('@aws-sdk/credential-provider-http');\n const { fromContainerMetadata } = await import('@smithy/credential-provider-imds');\n logger?.debug(\"@aws-sdk/credential-provider-ini - credential_source is EcsContainer\");\n return async () => propertyProvider.chain(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider);\n },\n Ec2InstanceMetadata: async (options) => {\n logger?.debug(\"@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata\");\n const { fromInstanceMetadata } = await import('@smithy/credential-provider-imds');\n return async () => fromInstanceMetadata(options)().then(setNamedProvider);\n },\n Environment: async (options) => {\n logger?.debug(\"@aws-sdk/credential-provider-ini - credential_source is Environment\");\n const { fromEnv } = await import('@aws-sdk/credential-provider-env');\n return async () => fromEnv(options)().then(setNamedProvider);\n },\n };\n if (credentialSource in sourceProvidersMap) {\n return sourceProvidersMap[credentialSource];\n }\n else {\n throw new propertyProvider.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, ` +\n `expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger });\n }\n};\nconst setNamedProvider = (creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_NAMED_PROVIDER\", \"p\");\n\nconst isAssumeRoleProfile = (arg, { profile = \"default\", logger } = {}) => {\n return (Boolean(arg) &&\n typeof arg === \"object\" &&\n typeof arg.role_arn === \"string\" &&\n [\"undefined\", \"string\"].indexOf(typeof arg.role_session_name) > -1 &&\n [\"undefined\", \"string\"].indexOf(typeof arg.external_id) > -1 &&\n [\"undefined\", \"string\"].indexOf(typeof arg.mfa_serial) > -1 &&\n (isAssumeRoleWithSourceProfile(arg, { profile, logger }) || isCredentialSourceProfile(arg, { profile, logger })));\n};\nconst isAssumeRoleWithSourceProfile = (arg, { profile, logger }) => {\n const withSourceProfile = typeof arg.source_profile === \"string\" && typeof arg.credential_source === \"undefined\";\n if (withSourceProfile) {\n logger?.debug?.(` ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`);\n }\n return withSourceProfile;\n};\nconst isCredentialSourceProfile = (arg, { profile, logger }) => {\n const withProviderProfile = typeof arg.credential_source === \"string\" && typeof arg.source_profile === \"undefined\";\n if (withProviderProfile) {\n logger?.debug?.(` ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`);\n }\n return withProviderProfile;\n};\nconst resolveAssumeRoleCredentials = async (profileName, profiles, options, callerClientConfig, visitedProfiles = {}, resolveProfileData) => {\n options.logger?.debug(\"@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)\");\n const profileData = profiles[profileName];\n const { source_profile, region } = profileData;\n if (!options.roleAssumer) {\n const { getDefaultRoleAssumer } = await import('@aws-sdk/nested-clients/sts');\n options.roleAssumer = getDefaultRoleAssumer({\n ...options.clientConfig,\n credentialProviderLogger: options.logger,\n parentClientConfig: {\n ...callerClientConfig,\n ...options?.parentClientConfig,\n region: region ?? options?.parentClientConfig?.region ?? callerClientConfig?.region,\n },\n }, options.clientPlugins);\n }\n if (source_profile && source_profile in visitedProfiles) {\n throw new propertyProvider.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile` +\n ` ${sharedIniFileLoader.getProfileName(options)}. Profiles visited: ` +\n Object.keys(visitedProfiles).join(\", \"), { logger: options.logger });\n }\n options.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`);\n const sourceCredsProvider = source_profile\n ? resolveProfileData(source_profile, profiles, options, callerClientConfig, {\n ...visitedProfiles,\n [source_profile]: true,\n }, isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {}))\n : (await resolveCredentialSource(profileData.credential_source, profileName, options.logger)(options))();\n if (isCredentialSourceWithoutRoleArn(profileData)) {\n return sourceCredsProvider.then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_SOURCE_PROFILE\", \"o\"));\n }\n else {\n const params = {\n RoleArn: profileData.role_arn,\n RoleSessionName: profileData.role_session_name || `aws-sdk-js-${Date.now()}`,\n ExternalId: profileData.external_id,\n DurationSeconds: parseInt(profileData.duration_seconds || \"3600\", 10),\n };\n const { mfa_serial } = profileData;\n if (mfa_serial) {\n if (!options.mfaCodeProvider) {\n throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, { logger: options.logger, tryNextLink: false });\n }\n params.SerialNumber = mfa_serial;\n params.TokenCode = await options.mfaCodeProvider(mfa_serial);\n }\n const sourceCreds = await sourceCredsProvider;\n return options.roleAssumer(sourceCreds, params).then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_SOURCE_PROFILE\", \"o\"));\n }\n};\nconst isCredentialSourceWithoutRoleArn = (section) => {\n return !section.role_arn && !!section.credential_source;\n};\n\nconst isLoginProfile = (data) => {\n return Boolean(data && data.login_session);\n};\nconst resolveLoginCredentials = async (profileName, options, callerClientConfig) => {\n const credentials = await credentialProviderLogin.fromLoginCredentials({\n ...options,\n profile: profileName,\n })({ callerClientConfig });\n return client.setCredentialFeature(credentials, \"CREDENTIALS_PROFILE_LOGIN\", \"AC\");\n};\n\nconst isProcessProfile = (arg) => Boolean(arg) && typeof arg === \"object\" && typeof arg.credential_process === \"string\";\nconst resolveProcessCredentials = async (options, profile) => import('@aws-sdk/credential-provider-process').then(({ fromProcess }) => fromProcess({\n ...options,\n profile,\n})().then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_PROCESS\", \"v\")));\n\nconst resolveSsoCredentials = async (profile, profileData, options = {}, callerClientConfig) => {\n const { fromSSO } = await import('@aws-sdk/credential-provider-sso');\n return fromSSO({\n profile,\n logger: options.logger,\n parentClientConfig: options.parentClientConfig,\n clientConfig: options.clientConfig,\n })({\n callerClientConfig,\n }).then((creds) => {\n if (profileData.sso_session) {\n return client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_SSO\", \"r\");\n }\n else {\n return client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_SSO_LEGACY\", \"t\");\n }\n });\n};\nconst isSsoProfile = (arg) => arg &&\n (typeof arg.sso_start_url === \"string\" ||\n typeof arg.sso_account_id === \"string\" ||\n typeof arg.sso_session === \"string\" ||\n typeof arg.sso_region === \"string\" ||\n typeof arg.sso_role_name === \"string\");\n\nconst isStaticCredsProfile = (arg) => Boolean(arg) &&\n typeof arg === \"object\" &&\n typeof arg.aws_access_key_id === \"string\" &&\n typeof arg.aws_secret_access_key === \"string\" &&\n [\"undefined\", \"string\"].indexOf(typeof arg.aws_session_token) > -1 &&\n [\"undefined\", \"string\"].indexOf(typeof arg.aws_account_id) > -1;\nconst resolveStaticCredentials = async (profile, options) => {\n options?.logger?.debug(\"@aws-sdk/credential-provider-ini - resolveStaticCredentials\");\n const credentials = {\n accessKeyId: profile.aws_access_key_id,\n secretAccessKey: profile.aws_secret_access_key,\n sessionToken: profile.aws_session_token,\n ...(profile.aws_credential_scope && { credentialScope: profile.aws_credential_scope }),\n ...(profile.aws_account_id && { accountId: profile.aws_account_id }),\n };\n return client.setCredentialFeature(credentials, \"CREDENTIALS_PROFILE\", \"n\");\n};\n\nconst isWebIdentityProfile = (arg) => Boolean(arg) &&\n typeof arg === \"object\" &&\n typeof arg.web_identity_token_file === \"string\" &&\n typeof arg.role_arn === \"string\" &&\n [\"undefined\", \"string\"].indexOf(typeof arg.role_session_name) > -1;\nconst resolveWebIdentityCredentials = async (profile, options, callerClientConfig) => import('@aws-sdk/credential-provider-web-identity').then(({ fromTokenFile }) => fromTokenFile({\n webIdentityTokenFile: profile.web_identity_token_file,\n roleArn: profile.role_arn,\n roleSessionName: profile.role_session_name,\n roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,\n logger: options.logger,\n parentClientConfig: options.parentClientConfig,\n})({\n callerClientConfig,\n}).then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN\", \"q\")));\n\nconst resolveProfileData = async (profileName, profiles, options, callerClientConfig, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => {\n const data = profiles[profileName];\n if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) {\n return resolveStaticCredentials(data, options);\n }\n if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data, { profile: profileName, logger: options.logger })) {\n return resolveAssumeRoleCredentials(profileName, profiles, options, callerClientConfig, visitedProfiles, resolveProfileData);\n }\n if (isStaticCredsProfile(data)) {\n return resolveStaticCredentials(data, options);\n }\n if (isWebIdentityProfile(data)) {\n return resolveWebIdentityCredentials(data, options, callerClientConfig);\n }\n if (isProcessProfile(data)) {\n return resolveProcessCredentials(options, profileName);\n }\n if (isSsoProfile(data)) {\n return await resolveSsoCredentials(profileName, data, options, callerClientConfig);\n }\n if (isLoginProfile(data)) {\n return resolveLoginCredentials(profileName, options, callerClientConfig);\n }\n throw new propertyProvider.CredentialsProviderError(`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`, { logger: options.logger });\n};\n\nconst fromIni = (init = {}) => async ({ callerClientConfig } = {}) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-ini - fromIni\");\n const profiles = await sharedIniFileLoader.parseKnownFiles(init);\n return resolveProfileData(sharedIniFileLoader.getProfileName({\n profile: init.profile ?? callerClientConfig?.profile,\n }), profiles, init, callerClientConfig);\n};\n\nexports.fromIni = fromIni;\n"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;CAEA,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI,wBAAsB,cAAc;CACxC,IAAI,oBAAkB,UAAU;CAChC,IAAI,oBAAkB,UAAU;CAChC,IAAI,sBAAoB,YAAY;CAEpC,IAAM,0BAAN,MAAM,wBAAwB;EAC1B;EACA;EACA;EACA,OAAO,oBAAoB,MAAS;EACpC,YAAY,aAAa,MAAM,oBAAoB;AAC/C,QAAK,cAAc;AACnB,QAAK,OAAO;AACZ,QAAK,qBAAqB;;EAE9B,MAAM,kBAAkB;GACpB,MAAM,QAAQ,MAAM,KAAK,WAAW;AACpC,OAAI,CAAC,MACD,OAAM,IAAI,iBAAiB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