@fedify/fedify 0.10.0-dev.187 → 0.10.0-dev.194
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGES.md +24 -0
- package/esm/federation/handler.js +2 -4
- package/esm/federation/middleware.js +431 -270
- package/esm/runtime/key.js +23 -3
- package/esm/sig/key.js +44 -16
- package/esm/testing/fixtures/example.com/key4 +7 -0
- package/esm/testing/fixtures/example.com/person2 +6 -0
- package/package.json +2 -1
- package/types/federation/callback.d.ts +16 -0
- package/types/federation/callback.d.ts.map +1 -1
- package/types/federation/context.d.ts +24 -2
- package/types/federation/context.d.ts.map +1 -1
- package/types/federation/handler.d.ts.map +1 -1
- package/types/federation/middleware.d.ts +14 -4
- package/types/federation/middleware.d.ts.map +1 -1
- package/types/runtime/key.d.ts +2 -0
- package/types/runtime/key.d.ts.map +1 -1
- package/types/sig/key.d.ts +5 -2
- package/types/sig/key.d.ts.map +1 -1
- package/types/testing/context.d.ts.map +1 -1
- package/types/testing/keys.d.ts.map +1 -1
package/CHANGES.md
CHANGED
@@ -8,6 +8,29 @@ Version 0.10.0
|
|
8
8
|
|
9
9
|
To be released.
|
10
10
|
|
11
|
+
- Besides RSA-PKCS#1-v1.5, Fedify now supports Ed25519 for signing and
|
12
|
+
verifying the activities. [[#55]]
|
13
|
+
|
14
|
+
- Added an optional parameter to `generateCryptoKeyPair()` function,
|
15
|
+
`algorithm`, which can be either `"RSASSA-PKCS1-v1_5"` or `"Ed25519"`.
|
16
|
+
- The `importJwk()` function now accepts Ed25519 keys.
|
17
|
+
- The `exportJwk()` function now exports Ed25519 keys.
|
18
|
+
- The `importSpki()` function now accepts Ed25519 keys.
|
19
|
+
- The `exportJwk()` function now exports Ed25519 keys.
|
20
|
+
|
21
|
+
- Now multiple key pairs can be registered for an actor.
|
22
|
+
|
23
|
+
- Added `Context.getActorKeyPairs()` method.
|
24
|
+
- Deprecated `Context.getActorKey()` method.
|
25
|
+
Use `Context.getActorKeyPairs()` method instead.
|
26
|
+
- Added `ActorKeyPair` interface.
|
27
|
+
- Added `ActorCallbackSetters.setKeyPairsDispatcher()` method.
|
28
|
+
- Added `ActorKeyPairsDispatcher` type.
|
29
|
+
- Deprecated `ActorCallbackSetters.setKeyPairDispatcher()` method.
|
30
|
+
- Deprecated `ActorKeyPairDispatcher` type.
|
31
|
+
- Deprecated the third parameter of the `ActorDispatcher` callback type.
|
32
|
+
Use `Context.getActorKeyPairs()` method instead.
|
33
|
+
|
11
34
|
- Deprecated `treatHttps` option in `FederationParameters` interface.
|
12
35
|
Instead, use the [x-forwarded-fetch] library to recognize the
|
13
36
|
`X-Forwarded-Host` and `X-Forwarded-Proto` headers.
|
@@ -19,6 +42,7 @@ To be released.
|
|
19
42
|
`following`, `followers`, `outbox`, `manuallyApprovesFollowers`, and
|
20
43
|
`url`.
|
21
44
|
|
45
|
+
[#55]: https://github.com/dahlia/fedify/issues/55
|
22
46
|
[x-forwarded-fetch]: https://github.com/dahlia/x-forwarded-fetch
|
23
47
|
|
24
48
|
|
@@ -18,8 +18,7 @@ export function acceptsJsonLd(request) {
|
|
18
18
|
export async function handleActor(request, { handle, context, actorDispatcher, authorizePredicate, onNotFound, onNotAcceptable, onUnauthorized, }) {
|
19
19
|
if (actorDispatcher == null)
|
20
20
|
return await onNotFound(request);
|
21
|
-
const
|
22
|
-
const actor = await actorDispatcher(context, handle, key);
|
21
|
+
const actor = await context.getActor(handle);
|
23
22
|
if (actor == null)
|
24
23
|
return await onNotFound(request);
|
25
24
|
if (!acceptsJsonLd(request))
|
@@ -170,8 +169,7 @@ export async function handleInbox(request, { handle, context, kv, kvPrefix, acto
|
|
170
169
|
return await onNotFound(request);
|
171
170
|
}
|
172
171
|
else if (handle != null) {
|
173
|
-
const
|
174
|
-
const actor = await actorDispatcher(context, handle, key);
|
172
|
+
const actor = await context.getActor(handle);
|
175
173
|
if (actor == null) {
|
176
174
|
logger.error("Actor {handle} not found.", { handle });
|
177
175
|
return await onNotFound(request);
|