Skip to content

Commit

Permalink
Remove deprecated APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed Jul 9, 2024
1 parent 410cc77 commit 1711224
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 545 deletions.
10 changes: 10 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ To be released.
- The last parameter of `Federation.sendActivity()` method is no longer
optional. Also, it now takes the required `contextData` option.

- Removed `Context.getHandleFromActorUri()` method which was deprecated in
version 0.9.0. Use `Context.parseUri()` method instead.

- Removed `@fedify/fedify/httpsig` module which was deprecated in version
0.9.0. Use `@fedify/fedify/sig` module instead.

- Removed `sign()` function.
- Removed `verify()` function.
- Removed `VerifyOptions` interface.

- Fixed a SSRF vulnerability in the built-in document loader.
[[CVE-2024-39687]]

Expand Down
1 change: 0 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"exports": {
".": "./mod.ts",
"./federation": "./federation/mod.ts",
"./httpsig": "./httpsig/mod.ts",
"./nodeinfo": "./nodeinfo/mod.ts",
"./runtime": "./runtime/mod.ts",
"./sig": "./sig/mod.ts",
Expand Down
9 changes: 0 additions & 9 deletions docs/manual/log.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,6 @@ The `["fedify", "federation", "queue"]` category is used for logging messages
related to the task queue. When you are curious about the task queue, you can
check the log messages in this category with the `"debug"` level.

### `["fedify", "httpsig", "verify"]`

*This category is available since Fedify 0.8.0.*

The `["fedify", "httpsig", "verify"]` category is used for logging messages
related to the verification of HTTP Signatures. When you are curious about
the verification process, you can check the log messages in this category with
the `"debug"` level.

### `["fedify", "runtime", "docloader"]`

*This category is available since Fedify 0.8.0.*
Expand Down
8 changes: 0 additions & 8 deletions federation/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,6 @@ export interface Context<TContextData> {
*/
parseUri(uri: URL): ParseUriResult | null;

/**
* Extracts the actor's handle from an actor URI, if it is a valid actor URI.
* @param actorUri The actor's URI.
* @returns The actor's handle, or `null` if the URI is not a valid actor URI.
* @deprecated Use {@link Context.parseUri} instead.
*/
getHandleFromActorUri(actorUri: URL): string | null;

/**
* Gets the key pairs for an actor.
* @param handle The actor's handle.
Expand Down
12 changes: 0 additions & 12 deletions federation/middleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ test("Federation.createContext()", async (t) => {
assertThrows(() => ctx.getFeaturedUri("handle"), RouterError);
assertThrows(() => ctx.getFeaturedTagsUri("handle"), RouterError);
assertEquals(ctx.parseUri(new URL("https://example.com/")), null);
assertEquals(
ctx.getHandleFromActorUri(new URL("https://example.com/")),
null,
);
assertEquals(await ctx.getActorKeyPairs("handle"), []);
assertEquals(await ctx.getActorKey("handle"), null);
assertRejects(
Expand Down Expand Up @@ -140,14 +136,6 @@ test("Federation.createContext()", async (t) => {
ctx.parseUri(new URL("https://example.com/users/handle")),
{ type: "actor", handle: "handle" },
);
assertEquals(
ctx.getHandleFromActorUri(new URL("https://example.com/")),
null,
);
assertEquals(
ctx.getHandleFromActorUri(new URL("https://example.com/users/handle")),
"handle",
);
assertEquals(
await ctx.getActorKeyPairs("handle"),
[
Expand Down
10 changes: 0 additions & 10 deletions federation/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2145,16 +2145,6 @@ class ContextImpl<TContextData> implements Context<TContextData> {
return null;
}

getHandleFromActorUri(actorUri: URL): string | null {
getLogger(["fedify", "federation"]).warn(
"Context.getHandleFromActorUri() is deprecated; " +
"use Context.parseUri() instead.",
);
const result = this.parseUri(actorUri);
if (result?.type === "actor") return result.handle;
return null;
}

async getActorKeyPairs(handle: string): Promise<ActorKeyPair[]> {
const logger = getLogger(["fedify", "federation", "actor"]);
if (this.#invokedFromActorKeyPairsDispatcher != null) {
Expand Down
Loading

0 comments on commit 1711224

Please sign in to comment.