Loading CHANGES.md +17 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,23 @@ Version 0.13.0 To be released. - Removed the singular actor key pair dispatcher APIs which were deprecated in version 0.10.0. - Removed the last parameter of the `ActorDispatcher` callback type. Use `Context.getActorKeyPairs()` method instead. - Removed `ActorKeyPairDispatcher` type. Use `ActorKeyPairsDispatcher` type instead. - Removed `ActorCallbackSetters.setKeyPairDispatcher()` method. Use `ActorCallbackSetters.setKeyPairsDispatcher()` method instead. - Removed `Context.getActorKey()` method. Use `Context.getActorKeyPairs()` method instead. - Added more log messages using the [LogTape] library. Currently the below logger categories are used: - `["fedify", "webfinger", "server"]` Version 0.12.0 -------------- Loading docs/manual/log.md +9 −0 Original line number Diff line number Diff line Loading @@ -201,6 +201,15 @@ related to looking up ActivityPub objects. When you are curious about the lookup process, you can check the log messages in this category with the `"debug"` level. ### `["fedify", "webfinger", "server"]` *This category is available since Fedify 0.13.0.* The `["fedify", "webfinger", "server"]` category is used for logging messages related to the WebFinger server. When you are curious about the WebFinger server, you can check the log messages in this category with the `"debug"` level. ### `["fedify", "webfinger", "lookup"]` *This category is available since Fedify 0.10.0.* Loading src/federation/callback.ts +0 −15 Original line number Diff line number Diff line Loading @@ -21,14 +21,10 @@ export type NodeInfoDispatcher<TContextData> = ( * @typeParam TContextData The context data to pass to the {@link Context}. * @param context The request context. * @param handle The actor's handle. * @param key The public key of the actor. **Deprecated: Do not rely on this * parameter. Instead, use the {@link Context.getActorKeyPairs} * method.** */ export type ActorDispatcher<TContextData> = ( context: RequestContext<TContextData>, handle: string, key: CryptographicKey | null, ) => Actor | null | Promise<Actor | null>; /** Loading @@ -45,17 +41,6 @@ export type ActorKeyPairsDispatcher<TContextData> = ( handle: string, ) => CryptoKeyPair[] | Promise<CryptoKeyPair[]>; /** * A callback that dispatches a key pair for an actor. * * @typeParam TContextData The context data to pass to the {@link Context}. * @deprecated */ export type ActorKeyPairDispatcher<TContextData> = ( contextData: TContextData, handle: string, ) => CryptoKeyPair | null | Promise<CryptoKeyPair | null>; /** * A callback that dispatches an object. * Loading src/federation/context.ts +0 −9 Original line number Diff line number Diff line Loading @@ -162,15 +162,6 @@ export interface Context<TContextData> { */ getActorKeyPairs(handle: string): Promise<ActorKeyPair[]>; /** * Gets a public RSA-PKCS#1-v1.5 {@link CryptographicKey} for an actor, * if any exists. * @param handle The actor's handle. * @returns The actor's public key, or `null` if the actor has no key. * @deprecated Use {@link Context.getActorKeyPairs} instead. */ getActorKey(handle: string): Promise<CryptographicKey | null>; /** * Gets an authenticated {@link DocumentLoader} for the given identity. * Note that an authenticated document loader intentionally does not cache Loading src/federation/handler.test.ts +2 −2 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ test("handleActor()", async () => { return new URL(`https://example.com/users/${handle}`); }, }); const actorDispatcher: ActorDispatcher<void> = (ctx, handle, _key) => { const actorDispatcher: ActorDispatcher<void> = (ctx, handle) => { if (handle !== "someone") return null; return new Person({ id: ctx.getActorUri(handle), Loading Loading @@ -105,7 +105,7 @@ test("handleActor()", async () => { context = createRequestContext<void>({ ...context, getActor(handle) { return Promise.resolve(actorDispatcher(context, handle, null)); return Promise.resolve(actorDispatcher(context, handle)); }, }); response = await handleActor( Loading Loading
CHANGES.md +17 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,23 @@ Version 0.13.0 To be released. - Removed the singular actor key pair dispatcher APIs which were deprecated in version 0.10.0. - Removed the last parameter of the `ActorDispatcher` callback type. Use `Context.getActorKeyPairs()` method instead. - Removed `ActorKeyPairDispatcher` type. Use `ActorKeyPairsDispatcher` type instead. - Removed `ActorCallbackSetters.setKeyPairDispatcher()` method. Use `ActorCallbackSetters.setKeyPairsDispatcher()` method instead. - Removed `Context.getActorKey()` method. Use `Context.getActorKeyPairs()` method instead. - Added more log messages using the [LogTape] library. Currently the below logger categories are used: - `["fedify", "webfinger", "server"]` Version 0.12.0 -------------- Loading
docs/manual/log.md +9 −0 Original line number Diff line number Diff line Loading @@ -201,6 +201,15 @@ related to looking up ActivityPub objects. When you are curious about the lookup process, you can check the log messages in this category with the `"debug"` level. ### `["fedify", "webfinger", "server"]` *This category is available since Fedify 0.13.0.* The `["fedify", "webfinger", "server"]` category is used for logging messages related to the WebFinger server. When you are curious about the WebFinger server, you can check the log messages in this category with the `"debug"` level. ### `["fedify", "webfinger", "lookup"]` *This category is available since Fedify 0.10.0.* Loading
src/federation/callback.ts +0 −15 Original line number Diff line number Diff line Loading @@ -21,14 +21,10 @@ export type NodeInfoDispatcher<TContextData> = ( * @typeParam TContextData The context data to pass to the {@link Context}. * @param context The request context. * @param handle The actor's handle. * @param key The public key of the actor. **Deprecated: Do not rely on this * parameter. Instead, use the {@link Context.getActorKeyPairs} * method.** */ export type ActorDispatcher<TContextData> = ( context: RequestContext<TContextData>, handle: string, key: CryptographicKey | null, ) => Actor | null | Promise<Actor | null>; /** Loading @@ -45,17 +41,6 @@ export type ActorKeyPairsDispatcher<TContextData> = ( handle: string, ) => CryptoKeyPair[] | Promise<CryptoKeyPair[]>; /** * A callback that dispatches a key pair for an actor. * * @typeParam TContextData The context data to pass to the {@link Context}. * @deprecated */ export type ActorKeyPairDispatcher<TContextData> = ( contextData: TContextData, handle: string, ) => CryptoKeyPair | null | Promise<CryptoKeyPair | null>; /** * A callback that dispatches an object. * Loading
src/federation/context.ts +0 −9 Original line number Diff line number Diff line Loading @@ -162,15 +162,6 @@ export interface Context<TContextData> { */ getActorKeyPairs(handle: string): Promise<ActorKeyPair[]>; /** * Gets a public RSA-PKCS#1-v1.5 {@link CryptographicKey} for an actor, * if any exists. * @param handle The actor's handle. * @returns The actor's public key, or `null` if the actor has no key. * @deprecated Use {@link Context.getActorKeyPairs} instead. */ getActorKey(handle: string): Promise<CryptographicKey | null>; /** * Gets an authenticated {@link DocumentLoader} for the given identity. * Note that an authenticated document loader intentionally does not cache Loading
src/federation/handler.test.ts +2 −2 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ test("handleActor()", async () => { return new URL(`https://example.com/users/${handle}`); }, }); const actorDispatcher: ActorDispatcher<void> = (ctx, handle, _key) => { const actorDispatcher: ActorDispatcher<void> = (ctx, handle) => { if (handle !== "someone") return null; return new Person({ id: ctx.getActorUri(handle), Loading Loading @@ -105,7 +105,7 @@ test("handleActor()", async () => { context = createRequestContext<void>({ ...context, getActor(handle) { return Promise.resolve(actorDispatcher(context, handle, null)); return Promise.resolve(actorDispatcher(context, handle)); }, }); response = await handleActor( Loading