@vizamodo/aws-sts-core 0.3.48 → 0.3.49
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 +7 -14
- package/package.json +1 -1
package/dist/sts/issue.js
CHANGED
|
@@ -58,28 +58,21 @@ async function getSigningMaterial(certBase64, privateKeyPkcs8Base64) {
|
|
|
58
58
|
cachedPrivateKeyBase64 === privateKeyPkcs8Base64) {
|
|
59
59
|
return cachedSigningKey;
|
|
60
60
|
}
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
cachedSigningKey = null;
|
|
65
|
-
signingKeyPromise = null;
|
|
66
|
-
}
|
|
67
|
-
// Deduplicate concurrent imports
|
|
61
|
+
// Material rotated — discard stale state and re-import.
|
|
62
|
+
signingKeyPromise = null;
|
|
63
|
+
cachedSigningKey = null;
|
|
68
64
|
if (!signingKeyPromise) {
|
|
69
65
|
signingKeyPromise = crypto.subtle
|
|
70
66
|
.importKey("pkcs8", base64ToBytes(privateKeyPkcs8Base64), { name: "ECDSA", namedCurve: "P-256" }, false, ["sign"])
|
|
71
|
-
.then((key) => {
|
|
72
|
-
cachedSigningKey = key;
|
|
73
|
-
cachedCertBase64 = certBase64;
|
|
74
|
-
cachedPrivateKeyBase64 = privateKeyPkcs8Base64;
|
|
75
|
-
return key;
|
|
76
|
-
})
|
|
77
67
|
.catch(() => {
|
|
78
68
|
signingKeyPromise = null; // allow retry
|
|
79
69
|
throw new InternalError("invalid_signing_material");
|
|
80
70
|
});
|
|
81
71
|
}
|
|
82
|
-
|
|
72
|
+
cachedSigningKey = await signingKeyPromise;
|
|
73
|
+
cachedCertBase64 = certBase64;
|
|
74
|
+
cachedPrivateKeyBase64 = privateKeyPkcs8Base64;
|
|
75
|
+
return cachedSigningKey;
|
|
83
76
|
}
|
|
84
77
|
// ── Session TTL ────────────────────────────────────────────────────────────
|
|
85
78
|
function resolveSessionTtl(profile) {
|