mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
Improve OpenID login flow security
This commit is contained in:
parent
d47a11cfc2
commit
22ebf72b6b
5 changed files with 77 additions and 28 deletions
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- Added the required column `issuerId` to the `OpenIdLoginFlow` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "OpenIdLoginFlow" ADD COLUMN "applicationId" UUID,
|
||||
ADD COLUMN "issuerId" TEXT NOT NULL;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "OpenIdLoginFlow" ADD CONSTRAINT "OpenIdLoginFlow_applicationId_fkey" FOREIGN KEY ("applicationId") REFERENCES "Application"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- A unique constraint covering the columns `[client_id]` on the table `Application` will be added. If there are existing duplicate values, this will fail.
|
||||
|
||||
*/
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Application_client_id_key" ON "Application"("client_id");
|
||||
|
|
@ -10,16 +10,17 @@ datasource db {
|
|||
}
|
||||
|
||||
model Application {
|
||||
id String @id @default(dbgenerated("uuid_generate_v7()")) @db.Uuid
|
||||
name String
|
||||
website String?
|
||||
vapid_key String?
|
||||
client_id String
|
||||
secret String
|
||||
scopes String
|
||||
redirect_uris String
|
||||
statuses Status[] // One to many relation with Status
|
||||
tokens Token[] // One to many relation with Token
|
||||
id String @id @default(dbgenerated("uuid_generate_v7()")) @db.Uuid
|
||||
name String
|
||||
website String?
|
||||
vapid_key String?
|
||||
client_id String @unique
|
||||
secret String
|
||||
scopes String
|
||||
redirect_uris String
|
||||
statuses Status[] // One to many relation with Status
|
||||
tokens Token[] // One to many relation with Token
|
||||
openIdLoginFlows OpenIdLoginFlow[]
|
||||
}
|
||||
|
||||
model Emoji {
|
||||
|
|
@ -140,8 +141,11 @@ model Token {
|
|||
}
|
||||
|
||||
model OpenIdLoginFlow {
|
||||
id String @id @default(dbgenerated("uuid_generate_v7()")) @db.Uuid
|
||||
codeVerifier String
|
||||
id String @id @default(dbgenerated("uuid_generate_v7()")) @db.Uuid
|
||||
codeVerifier String
|
||||
issuerId String
|
||||
application Application? @relation(fields: [applicationId], references: [id], onDelete: Cascade)
|
||||
applicationId String? @db.Uuid
|
||||
}
|
||||
|
||||
model Attachment {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue