mirror of
https://github.com/kind-0/nsecbunkerd.git
synced 2025-03-17 21:32:53 +01:00
Check if existing signing conditions belong to a revoked user
This commit is contained in:
parent
88811fbcd2
commit
c7f546add1
@ -5,6 +5,7 @@ COPY package.json package-lock.json .
|
||||
RUN npm i
|
||||
|
||||
COPY src/ src/
|
||||
COPY scripts scripts/
|
||||
COPY prisma/schema.prisma prisma/
|
||||
COPY tsconfig.json .
|
||||
|
||||
@ -17,5 +18,5 @@ RUN npm run build
|
||||
RUN npm i
|
||||
RUN npx prisma migrate deploy
|
||||
|
||||
ENTRYPOINT [ "node", "dist/index.js" ]
|
||||
ENTRYPOINT [ "node", "scripts/start.js" ]
|
||||
CMD ["start"]
|
||||
|
@ -46,6 +46,20 @@ export async function checkIfPubkeyAllowed(
|
||||
|
||||
const allowed = signingCondition.allowed;
|
||||
|
||||
// Check if the key user has been revoked
|
||||
if (allowed) {
|
||||
const revoked = await prisma.keyUser.findFirst({
|
||||
where: {
|
||||
id: keyUser.id,
|
||||
revokedAt: { not: null },
|
||||
}
|
||||
});
|
||||
|
||||
if (revoked) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (allowed === true || allowed === false) {
|
||||
console.log(`found signing condition`, signingCondition);
|
||||
return allowed;
|
||||
|
Loading…
x
Reference in New Issue
Block a user