Basic ghost plugin

This commit is contained in:
Zef Hemel
2022-04-09 14:28:41 +02:00
parent 6ebf8e7f15
commit 8fafd1cd4a
19 changed files with 594 additions and 53 deletions
+22
View File
@@ -0,0 +1,22 @@
import jwt, { Algorithm } from "jsonwebtoken";
import { SysCallMapping } from "../system";
export function jwtSyscalls(): SysCallMapping {
return {
"jwt.jwt": (
ctx,
hexSecret: string,
id: string,
algorithm: Algorithm,
expiry: string,
audience: string
): string => {
return jwt.sign({}, Buffer.from(hexSecret, "hex"), {
keyid: id,
algorithm: algorithm,
expiresIn: expiry,
audience: audience,
});
},
};
}