@vizamodo/aws-sts-core 0.4.1 → 0.4.2
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 +35 -1
- package/package.json +1 -1
package/dist/sts/issue.js
CHANGED
|
@@ -135,6 +135,35 @@ async function fetchCredentials(input) {
|
|
|
135
135
|
});
|
|
136
136
|
const signatureHex = await signStringToSign(stringToSign, signingKey);
|
|
137
137
|
const certSerialDec = getCertSerialDec(normalizedCert);
|
|
138
|
+
// 🔍 Deep debug helper (compare with working version)
|
|
139
|
+
function debugAwsSigning() {
|
|
140
|
+
try {
|
|
141
|
+
console.debug("[aws-debug][input]", {
|
|
142
|
+
roleArn,
|
|
143
|
+
profileArn,
|
|
144
|
+
trustAnchorArn,
|
|
145
|
+
region,
|
|
146
|
+
sessionTtl,
|
|
147
|
+
});
|
|
148
|
+
console.debug("[aws-debug][cert]", {
|
|
149
|
+
length: normalizedCert.length,
|
|
150
|
+
preview: normalizedCert.slice(0, 30),
|
|
151
|
+
});
|
|
152
|
+
console.debug("[aws-debug][serial]", {
|
|
153
|
+
serialDec: certSerialDec,
|
|
154
|
+
serialHex: BigInt(certSerialDec).toString(16),
|
|
155
|
+
});
|
|
156
|
+
console.debug("[aws-debug][headers]", baseHeaders);
|
|
157
|
+
console.debug("[aws-debug][signedHeaders]", signedHeaders);
|
|
158
|
+
console.debug("[aws-debug][canonicalRequest]", canonicalRequest);
|
|
159
|
+
console.debug("[aws-debug][stringToSign]", stringToSign);
|
|
160
|
+
console.debug("[aws-debug][signatureHex]", signatureHex);
|
|
161
|
+
}
|
|
162
|
+
catch (e) {
|
|
163
|
+
console.warn("[aws-debug][error]", e);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
debugAwsSigning();
|
|
138
167
|
const finalHeaders = new Headers({
|
|
139
168
|
"Content-Type": "application/json",
|
|
140
169
|
"X-Amz-Date": amzDate,
|
|
@@ -154,7 +183,12 @@ async function fetchCredentials(input) {
|
|
|
154
183
|
throw new InternalError("aws_unreachable");
|
|
155
184
|
}
|
|
156
185
|
if (!res.ok) {
|
|
157
|
-
|
|
186
|
+
const text = await res.text().catch(() => "<no-body>");
|
|
187
|
+
console.error("[aws-rejected]", {
|
|
188
|
+
status: res.status,
|
|
189
|
+
body: text,
|
|
190
|
+
region,
|
|
191
|
+
});
|
|
158
192
|
throw new InternalError("aws_rejected");
|
|
159
193
|
}
|
|
160
194
|
const json = await res.json();
|