feat: add ability to review and revoke clients
This commit is contained in:
@@ -2,6 +2,7 @@ import { v4 as uuidv4 } from "uuid";
|
||||
import { CertificateBundle } from "./ca";
|
||||
import prisma from "../db/database";
|
||||
import { Platform } from "@prisma/client";
|
||||
import { useCertificateAuthority } from "~/server/plugins/ca";
|
||||
|
||||
export interface ClientMetadata {
|
||||
name: string;
|
||||
@@ -82,6 +83,17 @@ export class ClientHandler {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async removeClient(id: string) {
|
||||
const ca = useCertificateAuthority();
|
||||
await ca.blacklistClient(id);
|
||||
|
||||
await prisma.client.delete({
|
||||
where: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const clientHandler = new ClientHandler();
|
||||
|
||||
Reference in New Issue
Block a user