zerobucket 0.8.1 → 0.8.2
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 +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -123,6 +123,12 @@ await images.get(id, { context: { userId } }); // throws AccessDeniedError if th
|
|
|
123
123
|
**A hook that throws fails closed**: the original exception propagates; it is never treated as
|
|
124
124
|
"allow". Denied calls never reach the database. `exists()` is deliberately not gated.
|
|
125
125
|
|
|
126
|
+
**Your hook receives the id exactly as the caller supplied it**, before ZeroBucket validates it, so it can be a
|
|
127
|
+
malformed string such as one taken straight from a URL. Check the format before using it in SQL (for example against a
|
|
128
|
+
UUID pattern, returning `true` for a malformed id so ZeroBucket answers "not found"); otherwise a request for
|
|
129
|
+
`/images/garbage` becomes a database error and a `500`. The [example app](https://github.com/KedarGhadyalji/ZeroBucket/tree/main/examples/node-integration)
|
|
130
|
+
shows a working hook, plus transactional uploads and serving.
|
|
131
|
+
|
|
126
132
|
## Streaming and ranges
|
|
127
133
|
|
|
128
134
|
```ts
|