@vercel/oidc 3.0.3 → 3.0.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @vercel/oidc
2
2
 
3
+ ## 3.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix OIDC token expiry check ([#14306](https://github.com/vercel/vercel/pull/14306))
8
+
9
+ ## 3.0.4
10
+
11
+ ### Patch Changes
12
+
13
+ - Fix directory permissions so that files can be created under the OIDC data directory in linux ([#14214](https://github.com/vercel/vercel/pull/14214))
14
+
3
15
  ## 3.0.3
4
16
 
5
17
  ### Patch Changes
@@ -26,8 +26,8 @@ var DefaultImports = __toESM(require("./index"));
26
26
  var BrowserImports = __toESM(require("./index-browser"));
27
27
  (0, import_vitest.describe)("browser export", () => {
28
28
  (0, import_vitest.test)("should match the default export", async () => {
29
- (0, import_vitest.expect)(Object.keys(BrowserImports)).toStrictEqual(
30
- Object.keys(DefaultImports)
29
+ (0, import_vitest.expect)(Object.keys(BrowserImports).sort()).toStrictEqual(
30
+ Object.keys(DefaultImports).sort()
31
31
  );
32
32
  });
33
33
  });
@@ -122,7 +122,7 @@ function saveToken(token, projectId) {
122
122
  }
123
123
  const tokenPath = path.join(dir, "com.vercel.token", `${projectId}.json`);
124
124
  const tokenJson = JSON.stringify(token);
125
- fs.mkdirSync(path.dirname(tokenPath), { mode: 432, recursive: true });
125
+ fs.mkdirSync(path.dirname(tokenPath), { mode: 504, recursive: true });
126
126
  fs.writeFileSync(tokenPath, tokenJson);
127
127
  fs.chmodSync(tokenPath, 432);
128
128
  return;
@@ -159,9 +159,8 @@ function getTokenPayload(token) {
159
159
  );
160
160
  return JSON.parse(Buffer.from(padded, "base64").toString("utf8"));
161
161
  }
162
- const TIME_15_MINUTES_IN_MS = 15 * 60 * 1e3;
163
162
  function isExpired(token) {
164
- return token.exp * 1e3 < Date.now() + TIME_15_MINUTES_IN_MS;
163
+ return token.exp * 1e3 < Date.now();
165
164
  }
166
165
  // Annotate the CommonJS export names for ESM import in node:
167
166
  0 && (module.exports = {
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "require": "./dist/index.js"
18
18
  }
19
19
  },
20
- "version": "3.0.3",
20
+ "version": "3.0.5",
21
21
  "repository": {
22
22
  "directory": "packages/oidc",
23
23
  "type": "git",