Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #119: Fetch and archive google json web keys set pair #137

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@mui/material": "^5.15.19",
"@prisma/client": "5.11.0",
"@prisma/client": "5.17.0",
"@witnessco/client": "^0.4.2",
"axios": "^1.7.2",
"googleapis": "^137.1.0",
"lodash": "^4.17.21",
"moment": "^2.30.1",
"next": "14.2.3",
"next-auth": "^4.24.7",
"node-cron": "^3.0.3",
"rate-limiter-flexible": "^5.0.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand All @@ -38,6 +39,7 @@
},
"//": "prisma 5.11.0 needed for Prisma Client Python",
"devDependencies": {
"@types/cron": "^2.4.3",
"@types/lodash": "^4.17.10",
"@types/node": "^20.12.12",
"@types/react": "^18.3.3",
Expand All @@ -46,7 +48,7 @@
"autoprefixer": "^10.4.19",
"dkim": "^0.8.0",
"postcss": "^8.4.38",
"prisma": "5.11.0",
"prisma": "5.17.0",
"swagger-ui-react": "^5.17.14",
"tsx": "^4.11.0",
"typescript": "^5.4.5",
Expand Down
123 changes: 82 additions & 41 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- CreateTable
CREATE TABLE "JsonWebKeySets" (
"id" SERIAL NOT NULL,
"x509Certificate" TEXT NOT NULL,
"jwks" TEXT NOT NULL,
"lastUpdated" TIMESTAMP(3) NOT NULL,
"provenanceVerified" BOOLEAN,

CONSTRAINT "JsonWebKeySets_pkey" PRIMARY KEY ("id")
);
8 changes: 8 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,11 @@ model EmailPairGcdResult {

@@id([emailSignatureA_id, emailSignatureB_id])
}

model JsonWebKeySets {
id Int @id @default(autoincrement())
x509Certificate String
jwks String
lastUpdated DateTime @updatedAt
provenanceVerified Boolean?
}
8 changes: 8 additions & 0 deletions prisma/seed.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PrismaClient } from '@prisma/client'
import { fetchJsonWebKeySet, fetchx509Cert } from '@/lib/utils'

const prisma = new PrismaClient()

Expand Down Expand Up @@ -30,6 +31,13 @@ async function main() {
});
}
}
await prisma.jsonWebKeySets.create({
data: {
jwks: await fetchJsonWebKeySet(),
x509Certificate: await fetchx509Cert(),
provenanceVerified: false
}
});
}

main()
Expand Down
Loading