@vizamodo/aws-sts-core 0.4.26 → 0.4.28
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/sts/issue.js +12 -5
- package/package.json +1 -1
package/dist/sts/issue.js
CHANGED
|
@@ -139,11 +139,18 @@ export async function issueAwsCredentials(input) {
|
|
|
139
139
|
"Authorization": `${ALGORITHM} Credential=${certSerialDec}/${credentialScope}, SignedHeaders=${signedHeaders}, Signature=${signatureHex}`,
|
|
140
140
|
});
|
|
141
141
|
const issuedAt = Date.now();
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
let res;
|
|
143
|
+
try {
|
|
144
|
+
res = await fetch(`https://${host}${PATH}`, {
|
|
145
|
+
method: "POST",
|
|
146
|
+
headers: finalHeaders,
|
|
147
|
+
body,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
catch (err) {
|
|
151
|
+
console.warn("[aws-unreachable]", { region, error: err?.message });
|
|
152
|
+
throw new InternalError("aws_unreachable");
|
|
153
|
+
}
|
|
147
154
|
if (!res.ok) {
|
|
148
155
|
console.warn("[aws-rejected]", { status: res.status, region, profile });
|
|
149
156
|
throw new InternalError("aws_rejected");
|