canopycms-next 0.0.64 → 0.0.66-int.81

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.
Files changed (2) hide show
  1. package/dist/adapter.js +7 -2
  2. package/package.json +3 -3
package/dist/adapter.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { NextResponse } from 'next/server';
2
2
  import { createCanopyRequestHandler, isCanopyBinaryResponse, } from 'canopycms/http';
3
- import { getErrorMessage, sanitizeErrorMessage } from 'canopycms/utils/error';
3
+ import { getErrorMessage, redactCredentials, sanitizeErrorMessage } from 'canopycms/utils/error';
4
4
  /**
5
5
  * Wrap a standard Request (or NextRequest) to implement the CanopyRequest interface.
6
6
  * Only uses standard Request methods, so any Request subclass works.
@@ -122,7 +122,12 @@ export const createCanopyCatchAllHandler = (options) => {
122
122
  // can never escape as Next's generic unhandled-error 500, which would
123
123
  // break the uniform { ok, status, error } envelope the editor expects.
124
124
  const message = getErrorMessage(err);
125
- console.error('CanopyCMS: Unhandled error in Next.js catch-all handler:', message);
125
+ // Redacted before logging, not just before responding. The HTTP body was
126
+ // already sanitized, but this line went to the server log verbatim -- and
127
+ // a git failure message can embed a token-bearing clone URL, which is the
128
+ // one thing that must not reach a log aggregator. Every failure surface
129
+ // in the worker already redacts; this was the outlier.
130
+ console.error('CanopyCMS: Unhandled error in Next.js catch-all handler:', redactCredentials(message));
126
131
  return toNextResponse({
127
132
  status: 500,
128
133
  body: { ok: false, status: 500, error: sanitizeErrorMessage(message) },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canopycms-next",
3
- "version": "0.0.64",
3
+ "version": "0.0.66-int.81",
4
4
  "description": "Next.js adapter for CanopyCMS",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -36,7 +36,7 @@
36
36
  "peerDependencies": {
37
37
  "next": "^13.5.7 || ^14.2.25 || ^15.5.21 || >=16.0.0 <16.2.0 || >=16.3.0 <17.0.0",
38
38
  "react": "^18.0.0 || ^19.0.0",
39
- "canopycms": "0.0.64"
39
+ "canopycms": "0.0.66-int.81"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/node": "^22.9.0",
@@ -46,7 +46,7 @@
46
46
  "react": "^18.3.1",
47
47
  "typescript": "^5.6.3",
48
48
  "vitest": "^4.1.0",
49
- "canopycms": "0.0.64"
49
+ "canopycms": "0.0.66-int.81"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "rm -rf dist && tsc -p tsconfig.build.json && node ../../scripts/add-js-extensions.mjs dist && esbuild src/config.ts --bundle --platform=node --packages=external --external:next --format=cjs --outfile=dist/config.cjs && esbuild src/config.ts --bundle --platform=node --packages=external --external:next --format=esm --outfile=dist/config.mjs",