@wraps.dev/cli 2.17.16 → 2.17.18

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/cli.js CHANGED
@@ -28156,6 +28156,7 @@ import pc36 from "picocolors";
28156
28156
  init_events();
28157
28157
  init_aws();
28158
28158
  init_config();
28159
+ init_errors();
28159
28160
  init_fs();
28160
28161
  init_json_output();
28161
28162
  init_metadata();
@@ -28681,7 +28682,7 @@ You can try the manual flow: ${pc36.cyan("wraps auth logout")} then ${pc36.cyan(
28681
28682
  const duration = Date.now() - startTime;
28682
28683
  const errorCode = error instanceof Error ? error.name : "UNKNOWN_ERROR";
28683
28684
  trackError(errorCode, "platform:connect", {
28684
- message: error instanceof Error ? error.message : String(error)
28685
+ message: sanitizeErrorMessage(error)
28685
28686
  });
28686
28687
  trackCommand("platform:connect", {
28687
28688
  success: false,
@@ -28959,7 +28960,7 @@ ${pc36.bold("Next Steps:")}`);
28959
28960
  const duration = Date.now() - startTime;
28960
28961
  const errorCode = error instanceof Error ? error.name : "UNKNOWN_ERROR";
28961
28962
  trackError(errorCode, "platform:connect", {
28962
- message: error instanceof Error ? error.message : String(error)
28963
+ message: sanitizeErrorMessage(error)
28963
28964
  });
28964
28965
  trackCommand("platform:connect", {
28965
28966
  success: false,
@@ -29431,10 +29432,16 @@ import { createHttpTerminator } from "http-terminator";
29431
29432
 
29432
29433
  // src/console/middleware/auth.ts
29433
29434
  init_esm_shims();
29435
+ import { timingSafeEqual } from "crypto";
29434
29436
  function authenticateToken(expectedToken) {
29435
29437
  return (req, res, next) => {
29436
29438
  const token = req.query.token || req.headers["x-auth-token"];
29437
- if (!token || token !== expectedToken) {
29439
+ if (!token) {
29440
+ return res.status(401).json({ error: "Unauthorized" });
29441
+ }
29442
+ const expectedBuf = Buffer.from(expectedToken);
29443
+ const tokenBuf = Buffer.from(token);
29444
+ if (expectedBuf.length !== tokenBuf.length || !timingSafeEqual(expectedBuf, tokenBuf)) {
29438
29445
  return res.status(401).json({ error: "Unauthorized" });
29439
29446
  }
29440
29447
  next();
@@ -31992,7 +31999,8 @@ async function startConsoleServer(config2) {
31992
31999
  next();
31993
32000
  });
31994
32001
  app.use((req, _res, next) => {
31995
- console.log(`[${(/* @__PURE__ */ new Date()).toISOString()}] ${req.method} ${req.url}`);
32002
+ const logUrl = req.url.replace(/([?&])token=[^&]+/g, "$1token=***");
32003
+ console.log(`[${(/* @__PURE__ */ new Date()).toISOString()}] ${req.method} ${logUrl}`);
31996
32004
  next();
31997
32005
  });
31998
32006
  app.use(