add basic suppport for client_credentials oauth grant

This commit is contained in:
sam 2024-05-20 17:00:21 +02:00
parent 049f4a56de
commit 8995213d26
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
20 changed files with 627 additions and 58 deletions

View file

@ -0,0 +1,71 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Foxchat.Identity.Migrations
{
/// <inheritdoc />
public partial class AddRedirectUris : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "fk_tokens_accounts_account_id",
table: "tokens");
migrationBuilder.AlterColumn<Guid>(
name: "account_id",
table: "tokens",
type: "uuid",
nullable: true,
oldClrType: typeof(Guid),
oldType: "uuid");
migrationBuilder.AddColumn<string[]>(
name: "redirect_uris",
table: "applications",
type: "text[]",
nullable: false,
defaultValue: new string[0]);
migrationBuilder.AddForeignKey(
name: "fk_tokens_accounts_account_id",
table: "tokens",
column: "account_id",
principalTable: "accounts",
principalColumn: "id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "fk_tokens_accounts_account_id",
table: "tokens");
migrationBuilder.DropColumn(
name: "redirect_uris",
table: "applications");
migrationBuilder.AlterColumn<Guid>(
name: "account_id",
table: "tokens",
type: "uuid",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
oldClrType: typeof(Guid),
oldType: "uuid",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "fk_tokens_accounts_account_id",
table: "tokens",
column: "account_id",
principalTable: "accounts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
}
}
}