@oxy.so/federation 2.3.0 → 2.4.0
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 +31 -0
- package/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/node/actorRouter.js +4 -2
- package/dist/cjs/node/delivery.js +28 -6
- package/dist/cjs/node/httpCacheControl.js +11 -0
- package/dist/cjs/node/index.js +2 -1
- package/dist/cjs/node/webfingerRouter.js +6 -4
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/node/actorRouter.js +4 -2
- package/dist/esm/node/delivery.js +26 -6
- package/dist/esm/node/httpCacheControl.js +8 -0
- package/dist/esm/node/index.js +1 -1
- package/dist/esm/node/webfingerRouter.js +6 -4
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/node/actorRouter.d.ts +2 -0
- package/dist/types/node/delivery.d.ts +21 -1
- package/dist/types/node/httpCacheControl.d.ts +2 -0
- package/dist/types/node/index.d.ts +1 -1
- package/dist/types/node/webfingerRouter.d.ts +2 -0
- package/package.json +1 -1
- package/src/__tests__/delivery.test.ts +109 -1
- package/src/__tests__/routers.test.ts +70 -0
- package/src/node/actorRouter.ts +6 -2
- package/src/node/delivery.ts +57 -9
- package/src/node/httpCacheControl.ts +8 -0
- package/src/node/index.ts +2 -0
- package/src/node/webfingerRouter.ts +8 -4
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Oxy federation
|
|
2
|
+
|
|
3
|
+
## Authorizing outbound delivery
|
|
4
|
+
|
|
5
|
+
`createDeliveryService({ authorizeDelivery })` optionally checks live application
|
|
6
|
+
policy before signing or queueing an activity. It receives `activity` and the
|
|
7
|
+
trusted `senderAccountId` supplied by the app or persisted delivery job. Never
|
|
8
|
+
infer that identity from an activity URL or a key ID. Follower fanout checks once
|
|
9
|
+
for the batch; each later worker delivery checks again.
|
|
10
|
+
|
|
11
|
+
Return `true` to allow or `false` for a definitive refusal. A refusal throws
|
|
12
|
+
`DeliveryAuthorizationDeniedError`: a durable worker should mark the job
|
|
13
|
+
suppressed (or permanently failed), without marking it delivered or retrying it.
|
|
14
|
+
Other thrown errors are transient authority failures and should follow the
|
|
15
|
+
worker's normal bounded retry policy. Neither path signs or sends the activity.
|
|
16
|
+
Do not catch an authority failure and retry through an unguarded transport.
|
|
17
|
+
|
|
18
|
+
Without the optional hook, delivery behavior is unchanged. `sendUndoFollow`'s
|
|
19
|
+
boolean reports local relationship removal; it does not confirm remote delivery.
|
|
20
|
+
|
|
21
|
+
## Discovery response caching
|
|
22
|
+
|
|
23
|
+
`createWebfingerRouter({ httpCacheTtlSeconds })` controls HTTP caching of fresh,
|
|
24
|
+
cached and instance WebFinger responses. The default remains 3600 seconds.
|
|
25
|
+
`createActorRouter` accepts the same option for human and instance actor
|
|
26
|
+
responses, retaining its existing 1800-second default.
|
|
27
|
+
Use `0` for `Cache-Control: no-store` when live privacy decisions must govern
|
|
28
|
+
each request. Only whole seconds from 0 through 86400 are accepted. This does
|
|
29
|
+
not change the injected JRD cache: applications must also authorize its reads
|
|
30
|
+
and their user resolver against current policy. It cannot retract documents
|
|
31
|
+
already cached by remote consumers before this setting changes.
|