@delmaredigital/payload-puck 0.9.0 → 0.9.1

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/README.md CHANGED
@@ -10,6 +10,13 @@ A PayloadCMS plugin for integrating [Puck](https://puckeditor.com) visual page b
10
10
  <a href="https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fdelmaredigital%2Fdd-starter&project-name=my-payload-site&build-command=pnpm%20run%20ci&env=PAYLOAD_SECRET,BETTER_AUTH_SECRET&stores=%5B%7B%22type%22%3A%22integration%22%2C%22protocol%22%3A%22storage%22%2C%22productSlug%22%3A%22neon%22%2C%22integrationSlug%22%3A%22neon%22%7D%2C%7B%22type%22%3A%22blob%22%7D%5D"><img src="https://vercel.com/button" alt="Deploy with Vercel" height="32"></a>
11
11
  </p>
12
12
 
13
+ > 🔒 **Upgrading to 0.9.1? Security release — the generated pages collection no longer defaults to allow-all writes.**
14
+ >
15
+ > - If you called `createPuckPlugin()` without an `access` option, your `pages` collection let **anonymous** callers create, update and delete through Payload's REST/GraphQL API. `create`, `update` and `delete` now default to any authenticated user; `read` stays public. Anything you pass explicitly still wins.
16
+ > - **Action:** none if you already pass `access`. Otherwise decide who may write pages and say so, e.g. `access: { update: ({ req }) => req.user?.role === 'admin' }`. See the [CHANGELOG](./CHANGELOG.md#091---2026-09-09).
17
+
18
+ ---
19
+
13
20
  > 🔒 **Upgrading to 0.9? Security release — action required if you use the standalone route factories.**
14
21
  >
15
22
  > - **`createPuckApiRoutes`, `createPuckApiRoutesWithId`, `createPuckApiRoutesVersions` and `createPromptApiRoutes` now enforce Payload collection access control** ([GHSA-957g-hmmp-rchg](https://github.com/delmaredigital/payload-puck/security/advisories/GHSA-957g-hmmp-rchg)). They previously called Payload's Local API with the default `overrideAccess: true`, so collection and field `access` rules were **never evaluated** — any caller your `authenticate` hook accepted could read drafts and version history, restore versions over live content, publish, create and delete.
@@ -2,8 +2,13 @@ import { DEFAULT_LAYOUTS } from '../../layouts/defaults.js';
2
2
  import { puckDataField, createEditorVersionField, createPageLayoutField, isHomepageField, seoFieldGroup, conversionFieldGroup } from '../fields/index.js';
3
3
  import { createIsHomepageUniqueHook } from '../hooks/isHomepageUnique.js';
4
4
  /**
5
- * Default access function - allows all
6
- */ const defaultAccess = ()=>true;
5
+ * Default access: anyone may read, only authenticated Payload users may write.
6
+ *
7
+ * Before 0.9.1 every operation defaulted to allow-all, so a plugin consumer who
8
+ * passed no `access` shipped a pages collection that anonymous REST callers
9
+ * could create, update and delete.
10
+ */ const defaultReadAccess = ()=>true;
11
+ const defaultWriteAccess = ({ req })=>Boolean(req.user);
7
12
  /**
8
13
  * Generates a Pages collection configuration for Puck
9
14
  */ export function generatePagesCollection(slug, options) {
@@ -91,10 +96,10 @@ import { createIsHomepageUniqueHook } from '../hooks/isHomepageUnique.js';
91
96
  ...collectionOverrides.admin ?? {}
92
97
  },
93
98
  access: {
94
- read: access.read ?? defaultAccess,
95
- create: access.create ?? defaultAccess,
96
- update: access.update ?? defaultAccess,
97
- delete: access.delete ?? defaultAccess,
99
+ read: access.read ?? defaultReadAccess,
100
+ create: access.create ?? defaultWriteAccess,
101
+ update: access.update ?? defaultWriteAccess,
102
+ delete: access.delete ?? defaultWriteAccess,
98
103
  ...collectionOverrides.access ?? {}
99
104
  },
100
105
  hooks: {
@@ -51,8 +51,12 @@ export interface PuckPluginOptions {
51
51
  */
52
52
  collectionOverrides?: Partial<CollectionConfig>;
53
53
  /**
54
- * Access control for Puck operations
55
- * Uses Payload's Access type for full compatibility
54
+ * Access control for the generated pages collection.
55
+ * Uses Payload's Access type for full compatibility.
56
+ *
57
+ * Defaults: `read` allows everyone; `create`, `update` and `delete` require
58
+ * an authenticated Payload user (`({ req }) => Boolean(req.user)`). Pass your
59
+ * own functions to tighten this, e.g. `update: ({ req }) => req.user?.role === 'admin'`.
56
60
  */
57
61
  access?: {
58
62
  read?: Access;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.9.0";
1
+ export declare const VERSION = "0.9.1";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Auto-generated by scripts/generate-version.js - do not edit manually
2
- export const VERSION = '0.9.0';
2
+ export const VERSION = '0.9.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delmaredigital/payload-puck",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Puck visual page builder plugin for Payload CMS",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -144,24 +144,24 @@
144
144
  "@puckeditor/cloud-client": "^0.8.2",
145
145
  "@puckeditor/plugin-ai": "^0.8.2",
146
146
  "@puckeditor/plugin-heading-analyzer": "^0.23.0",
147
- "@radix-ui/react-popover": "^1.1.15",
148
- "@tiptap/core": "^3.29.2",
149
- "@tiptap/extension-color": "^3.29.2",
150
- "@tiptap/extension-highlight": "^3.29.2",
151
- "@tiptap/extension-link": "^3.29.2",
152
- "@tiptap/extension-subscript": "^3.29.2",
153
- "@tiptap/extension-superscript": "^3.29.2",
154
- "@tiptap/extension-text-align": "^3.29.2",
155
- "@tiptap/extension-text-style": "^3.29.2",
156
- "@tiptap/extension-underline": "^3.29.2",
157
- "@tiptap/react": "^3.29.2",
158
- "@tiptap/starter-kit": "^3.29.2",
147
+ "@radix-ui/react-popover": "^1.1.23",
148
+ "@tiptap/core": "^3.31.0",
149
+ "@tiptap/extension-color": "^3.31.0",
150
+ "@tiptap/extension-highlight": "^3.31.0",
151
+ "@tiptap/extension-link": "^3.31.0",
152
+ "@tiptap/extension-subscript": "^3.31.0",
153
+ "@tiptap/extension-superscript": "^3.31.0",
154
+ "@tiptap/extension-text-align": "^3.31.0",
155
+ "@tiptap/extension-text-style": "^3.31.0",
156
+ "@tiptap/extension-underline": "^3.31.0",
157
+ "@tiptap/react": "^3.31.0",
158
+ "@tiptap/starter-kit": "^3.31.0",
159
159
  "html-react-parser": "^6.1.5",
160
- "lucide-react": "^1.30.0"
160
+ "lucide-react": "^1.39.0"
161
161
  },
162
162
  "devDependencies": {
163
- "@payloadcms/next": "^3.87.1",
164
- "@payloadcms/ui": "^3.87.1",
163
+ "@payloadcms/next": "^3.88.0",
164
+ "@payloadcms/ui": "^3.88.0",
165
165
  "@puckeditor/core": "^0.23.0",
166
166
  "@swc/cli": "^0.8.1",
167
167
  "@swc/core": "^1.15.47",
@@ -171,7 +171,7 @@
171
171
  "@vitest/coverage-v8": "^4.1.10",
172
172
  "copyfiles": "^2.4.1",
173
173
  "next": "^16.3.0",
174
- "payload": "^3.87.1",
174
+ "payload": "^3.88.0",
175
175
  "react": "^19.2.8",
176
176
  "react-dom": "^19.2.8",
177
177
  "typescript": "^5.9.3",
@@ -197,5 +197,22 @@
197
197
  "bugs": {
198
198
  "url": "https://github.com/delmaredigital/payload-puck/issues"
199
199
  },
200
- "homepage": "https://delmaredigital.com/developers"
200
+ "homepage": "https://delmaredigital.com/developers",
201
+ "pnpm": {
202
+ "overrides": {
203
+ "brace-expansion@1": "^1.1.16",
204
+ "brace-expansion@2": "^2.1.2",
205
+ "dompurify": "^3.4.13",
206
+ "fast-uri": "^3.1.5",
207
+ "happy-dom": "^20.8.9",
208
+ "immutable": "^4.3.9",
209
+ "js-yaml@4": "^4.3.1",
210
+ "linkify-it": "^5.0.2",
211
+ "markdown-it": "^14.2.0",
212
+ "nanoid@3": "^3.3.18",
213
+ "piscina": "^4.9.3",
214
+ "postcss": "^8.5.23",
215
+ "ws": "^8.21.0"
216
+ }
217
+ }
201
218
  }