mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
feat(api): ✨ Make Lysand a full OAuth2/OpenID Connect provider as well as still Mastodon compatible
This commit is contained in:
parent
f9f4a99cb9
commit
5cb48b2f3b
29 changed files with 8466 additions and 279 deletions
3
drizzle/0016_keen_mindworm.sql
Normal file
3
drizzle/0016_keen_mindworm.sql
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE "Applications" RENAME COLUMN "redirect_uris" TO "redirect_uri";--> statement-breakpoint
|
||||
ALTER TABLE "Tokens" ADD COLUMN "client_id" text NOT NULL DEFAULT '';--> statement-breakpoint
|
||||
ALTER TABLE "Tokens" ADD COLUMN "redirect_uri" text NOT NULL DEFAULT '';
|
||||
2
drizzle/0017_dusty_black_knight.sql
Normal file
2
drizzle/0017_dusty_black_knight.sql
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE "Tokens" ALTER COLUMN "code" DROP NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "Tokens" ADD COLUMN "expires_at" timestamp(3);
|
||||
2
drizzle/0018_rapid_hairball.sql
Normal file
2
drizzle/0018_rapid_hairball.sql
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE "Tokens" ALTER COLUMN "client_id" SET DEFAULT '';
|
||||
ALTER TABLE "Tokens" ALTER COLUMN "redirect_uri" SET DEFAULT '';
|
||||
1
drizzle/0019_mushy_lorna_dane.sql
Normal file
1
drizzle/0019_mushy_lorna_dane.sql
Normal file
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE "Tokens" ADD COLUMN "id_token" text;
|
||||
1781
drizzle/meta/0016_snapshot.json
Normal file
1781
drizzle/meta/0016_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
1983
drizzle/meta/0017_snapshot.json
Normal file
1983
drizzle/meta/0017_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
1787
drizzle/meta/0018_snapshot.json
Normal file
1787
drizzle/meta/0018_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
1991
drizzle/meta/0019_snapshot.json
Normal file
1991
drizzle/meta/0019_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -113,6 +113,34 @@
|
|||
"when": 1713399438164,
|
||||
"tag": "0015_easy_mojo",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 16,
|
||||
"version": "5",
|
||||
"when": 1713413369623,
|
||||
"tag": "0016_keen_mindworm",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 17,
|
||||
"version": "5",
|
||||
"when": 1713417089150,
|
||||
"tag": "0017_dusty_black_knight",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 18,
|
||||
"version": "5",
|
||||
"when": 1713418575392,
|
||||
"tag": "0018_rapid_hairball",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 19,
|
||||
"version": "5",
|
||||
"when": 1713421706451,
|
||||
"tag": "0019_mushy_lorna_dane",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -187,7 +187,7 @@ export const Applications = pgTable(
|
|||
clientId: text("client_id").notNull(),
|
||||
secret: text("secret").notNull(),
|
||||
scopes: text("scopes").notNull(),
|
||||
redirectUris: text("redirect_uris").notNull(),
|
||||
redirectUri: text("redirect_uri").notNull(),
|
||||
},
|
||||
(table) => {
|
||||
return {
|
||||
|
|
@ -206,10 +206,14 @@ export const Tokens = pgTable("Tokens", {
|
|||
tokenType: text("token_type").notNull(),
|
||||
scope: text("scope").notNull(),
|
||||
accessToken: text("access_token").notNull(),
|
||||
code: text("code").notNull(),
|
||||
code: text("code"),
|
||||
expiresAt: timestamp("expires_at", { precision: 3, mode: "string" }),
|
||||
createdAt: timestamp("created_at", { precision: 3, mode: "string" })
|
||||
.defaultNow()
|
||||
.notNull(),
|
||||
clientId: text("client_id").notNull().default(""),
|
||||
redirectUri: text("redirect_uri").notNull().default(""),
|
||||
idToken: text("id_token"),
|
||||
userId: uuid("userId")
|
||||
.references(() => Users.id, {
|
||||
onDelete: "cascade",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue