@vizamodo/aws-sts-core 0.4.13 → 0.4.15

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 CHANGED
@@ -152,14 +152,13 @@ async function fetchCredentials(input) {
152
152
  sessionToken: creds.sessionToken,
153
153
  expiration: creds.expiration,
154
154
  };
155
- // FIX 3: no unsafe cast — fetcher typed correctly.
156
- const receivedAt = Date.now();
155
+ const issuedAt = Date.now();
157
156
  const expiresAtMs = Date.parse(creds.expiration);
158
- const credLifetimeSec = Math.floor((expiresAtMs - receivedAt) / 1000);
157
+ const credLifetimeSec = Math.floor((expiresAtMs - issuedAt) / 1000);
159
158
  if (Number.isFinite(expiresAtMs) && credLifetimeSec > 0) {
160
- const cacheTtlSec = Math.floor(credLifetimeSec / 3);
161
- const cacheExpiry = new Date(receivedAt + cacheTtlSec * 1000).toISOString();
162
- return wrapResult(value, cacheExpiry);
159
+ const edgeCacheTtlSec = Math.floor(credLifetimeSec / 3);
160
+ const edgeCacheExpiry = new Date(issuedAt + edgeCacheTtlSec * 1000).toISOString();
161
+ return wrapResult(value, edgeCacheExpiry);
163
162
  }
164
163
  return value;
165
164
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizamodo/aws-sts-core",
3
- "version": "0.4.13",
3
+ "version": "0.4.15",
4
4
  "description": "Pure AWS STS + SigV4 (X509 Roles Anywhere) core logic",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",