fix busted types
This commit is contained in:
parent
7de6cb4677
commit
3f5478d94b
|
@ -11,7 +11,12 @@ declare module "activitypub-http-signatures" {
|
|||
sign: (options: { url: string, method: string, headers: any[] }) => string;
|
||||
};
|
||||
|
||||
export const parse: (params: { url: string, method: string, headers: Record<string, string> }) => {
|
||||
type parse = (params: { url: string, method: string, headers: Record<string, string> }) => {
|
||||
verify: (publicKey: string) => boolean;
|
||||
};
|
||||
|
||||
export default {
|
||||
Sha256Signer,
|
||||
parse
|
||||
};
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import { fillRoute } from "./router.js";
|
|||
import { streamToString, hashDigest } from "./util.js";
|
||||
import { signedFetch, SignedInit, getActor} from "./net.js";
|
||||
import { getById as getUserById, getKeyId } from "./user.js";
|
||||
import { parse as parseSignedRequest } from "activitypub-http-signatures";
|
||||
import parser from "activitypub-http-signatures";
|
||||
import type { Request, Response } from "express";
|
||||
import { addFollower } from "./follower.js";
|
||||
|
||||
|
@ -59,7 +59,7 @@ export const handleInboxPost = async (req: Request, res: Response) => {
|
|||
}
|
||||
|
||||
// OK validate request signature
|
||||
const signature = parseSignedRequest({
|
||||
const signature = parser.parse({
|
||||
url: req.originalUrl,
|
||||
method: "POST",
|
||||
headers: req.headers as Record<string, string>
|
||||
|
|
Loading…
Reference in New Issue