Commit Graph

26 Commits

Author SHA1 Message Date
Anthony Accioly
3c802caff5 feat(blossom)!: add file extension parameter to Blossom hooks
This enhancement allows hooks to make extension-aware decisions for storage,
loading, and access control operations. The extension is intelligently derived
from MIME type detection, file magic bytes, or URL parsing.

Additionally improves MIME type handling by providing fallback to
"application/octet-stream" when extension-based detection fails as per
BUD-01.

BREAKING CHANGE: All Blossom hook functions now require an additional `ext` parameter:
- StoreBlob hooks now accept (ctx, sha256, ext, body) instead of (ctx, sha256, body)
- LoadBlob hooks now accept (ctx, sha256, ext) instead of (ctx, sha256)
- DeleteBlob hooks now accept (ctx, sha256, ext) instead of (ctx, sha256)
- RejectGet hooks now accept (ctx, auth, sha256, ext) instead of (ctx, auth, sha256)
- RejectDelete hooks now accept (ctx, auth, sha256, ext) instead of (ctx, auth, sha256)
2025-09-08 16:06:24 -03:00
Kay
214371f8bd refactor(adding): check kind range with proper function. 2025-04-13 09:05:23 -03:00
fiatjaf
fbb40f3b74 use .Find() instead of .GetFirst() everywhere. 2025-04-04 23:07:18 -03:00
fiatjaf
51632dcc9f update blossom example to use a different database.
closes https://github.com/fiatjaf/khatru/issues/36
2025-03-17 13:36:41 -03:00
fiatjaf
433cceea86 include the ReplaceEvent setup on all examples. 2025-01-13 16:47:21 -03:00
Anthony Accioly
7bfdbb557c fix(blossom): use io.ReadSeeker in Blossom example
This should fix the failing pipeline test
2024-11-22 07:54:57 -03:00
Anthony Accioly
a004f59187 fix(blossom): Example returns io.Reader 2024-11-04 13:56:13 +00:00
fiatjaf
a893dc2d2c blossom: store as a standalone interface (and an eventstore wrapper). 2024-10-29 09:01:04 -03:00
fiatjaf
91e7737ec1 basic modular blossom support. 2024-10-27 17:20:10 -03:00
fiatjaf
1dc12e5d2e support negentropy. 2024-10-26 23:41:39 -03:00
fiatjaf
8f62b2fbbe policies.PreventLargeTags() example was too strict for "a" tags. 2024-10-21 08:53:37 -03:00
fiatjaf
a63dc829df routing. 2024-07-30 12:53:27 -03:00
fiatjaf
c5c17029ba basic kind validation policy. 2024-03-13 12:40:54 -03:00
fiatjaf
9b43da0b17 use stdlib "slices". 2024-02-08 16:35:35 -03:00
fiatjaf
e876415677 remove unused .OnAuth() and update README example. 2023-12-28 09:17:06 -03:00
fiatjaf
22da06b629 new flow for auth based on "auth-required: " rejection messages. 2023-12-06 12:14:58 -03:00
fiatjaf
7bfde76ab1 example fix. 2023-12-06 12:14:27 -03:00
fiatjaf
e1fd6aaa56 update examples plugins->policies 2023-11-29 12:22:37 -03:00
fiatjaf
0a62169e14 update examples. 2023-11-18 10:37:07 -03:00
fiatjaf
270096debb meta things and get rid of old relayer tests that don\'t work here. 2023-11-07 22:43:30 -03:00
fiatjaf
e6078b1a68 a readme with a sample. 2023-11-06 17:45:27 -03:00
fiatjaf
6acf1b4366 update eventstore and badger/lmdb examples. 2023-11-02 20:16:17 -03:00
fiatjaf
b6e7fabeb6 move storage plugins to eventstore module. 2023-10-31 16:38:32 -03:00
fiatjaf
8968982b9a relayer, second attempt, now much better. 2023-08-10 14:32:11 -03:00
Yasuhiro Matsumoto
7023220941 fix docker-compose.yml
expose 7447
fix command path
2023-06-05 23:42:53 +09:00
fiatjaf
47b8ee106f move example relay implementations to examples/ folder. 2023-05-23 10:43:20 -03:00