Skip to content

Commit edabf4b

Browse files
committed
chore: add note to createVolumeAPI usage
1 parent 4467372 commit edabf4b

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

docs/docs/api/appkit/Variable.policy.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const policy: {
88
denyAll: FilePolicy;
99
not: FilePolicy;
1010
publicRead: FilePolicy;
11-
publicReadAndList: FilePolicy;
1211
};
1312
```
1413

@@ -105,15 +104,3 @@ Allow all read actions (list, read, download, raw, exists, metadata, preview).
105104
#### Returns
106105

107106
`FilePolicy`
108-
109-
### publicReadAndList()
110-
111-
```ts
112-
readonly publicReadAndList(): FilePolicy;
113-
```
114-
115-
Alias for `publicRead()` — included for discoverability.
116-
117-
#### Returns
118-
119-
`FilePolicy`

packages/appkit/src/plugins/files/plugin.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,16 @@ export class FilesPlugin extends Plugin {
245245

246246
/**
247247
* Creates a VolumeAPI for a specific volume key.
248-
* All operations execute as the service principal.
248+
* All operations execute as the service principal without policy checks.
249+
*
250+
* Not used internally — `_createPolicyWrappedAPI` handles all current
251+
* call sites. Kept as a `protected` extension point so subclasses can
252+
* override `exports()` or build custom APIs with raw connector access,
253+
* e.g. background jobs or migrations that should bypass user-facing policies.
254+
*
255+
* @security This method skips all policy enforcement. Do not expose its
256+
* return value to HTTP routes or end-user-facing code paths — use
257+
* `_createPolicyWrappedAPI` for anything that serves user requests.
249258
*/
250259
protected createVolumeAPI(volumeKey: string): VolumeAPI {
251260
const connector = this.volumeConnectors[volumeKey];

0 commit comments

Comments
 (0)