diff --git a/Moonlight.ApiServer/Database/Migrations/20250205073340_RemovedUnusedFieldsInUserModel.Designer.cs b/Moonlight.ApiServer/Database/Migrations/20250205073340_RemovedUnusedFieldsInUserModel.Designer.cs new file mode 100644 index 00000000..64246be9 --- /dev/null +++ b/Moonlight.ApiServer/Database/Migrations/20250205073340_RemovedUnusedFieldsInUserModel.Designer.cs @@ -0,0 +1,91 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Moonlight.ApiServer.Database; + +#nullable disable + +namespace Moonlight.ApiServer.Database.Migrations +{ + [DbContext(typeof(CoreDataContext))] + [Migration("20250205073340_RemovedUnusedFieldsInUserModel")] + partial class RemovedUnusedFieldsInUserModel + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasDefaultSchema("Core") + .HasAnnotation("ProductVersion", "8.0.8") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("Moonlight.ApiServer.Database.Entities.ApiKey", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ExpiresAt") + .HasColumnType("datetime(6)"); + + b.Property("PermissionsJson") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Secret") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("ApiKeys", "Core"); + }); + + modelBuilder.Entity("Moonlight.ApiServer.Database.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Email") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Password") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("PermissionsJson") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TokenValidTimestamp") + .HasColumnType("datetime(6)"); + + b.Property("Username") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("Users", "Core"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Moonlight.ApiServer/Database/Migrations/20250205073340_RemovedUnusedFieldsInUserModel.cs b/Moonlight.ApiServer/Database/Migrations/20250205073340_RemovedUnusedFieldsInUserModel.cs new file mode 100644 index 00000000..03e69cff --- /dev/null +++ b/Moonlight.ApiServer/Database/Migrations/20250205073340_RemovedUnusedFieldsInUserModel.cs @@ -0,0 +1,58 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Moonlight.ApiServer.Database.Migrations +{ + /// + public partial class RemovedUnusedFieldsInUserModel : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "AccessToken", + schema: "Core", + table: "Users"); + + migrationBuilder.DropColumn( + name: "RefreshTimestamp", + schema: "Core", + table: "Users"); + + migrationBuilder.DropColumn( + name: "RefreshToken", + schema: "Core", + table: "Users"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "AccessToken", + schema: "Core", + table: "Users", + type: "longtext", + nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "RefreshTimestamp", + schema: "Core", + table: "Users", + type: "datetime(6)", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AddColumn( + name: "RefreshToken", + schema: "Core", + table: "Users", + type: "longtext", + nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"); + } + } +} diff --git a/Moonlight.ApiServer/Database/Migrations/CoreDataContextModelSnapshot.cs b/Moonlight.ApiServer/Database/Migrations/CoreDataContextModelSnapshot.cs index a6a8a462..84d645e9 100644 --- a/Moonlight.ApiServer/Database/Migrations/CoreDataContextModelSnapshot.cs +++ b/Moonlight.ApiServer/Database/Migrations/CoreDataContextModelSnapshot.cs @@ -59,10 +59,6 @@ namespace Moonlight.ApiServer.Database.Migrations MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("AccessToken") - .IsRequired() - .HasColumnType("longtext"); - b.Property("Email") .IsRequired() .HasColumnType("longtext"); @@ -75,13 +71,6 @@ namespace Moonlight.ApiServer.Database.Migrations .IsRequired() .HasColumnType("longtext"); - b.Property("RefreshTimestamp") - .HasColumnType("datetime(6)"); - - b.Property("RefreshToken") - .IsRequired() - .HasColumnType("longtext"); - b.Property("TokenValidTimestamp") .HasColumnType("datetime(6)"); diff --git a/Moonlight.ApiServer/Http/Controllers/Admin/Users/UsersController.cs b/Moonlight.ApiServer/Http/Controllers/Admin/Users/UsersController.cs index f24165d1..c7b72399 100644 --- a/Moonlight.ApiServer/Http/Controllers/Admin/Users/UsersController.cs +++ b/Moonlight.ApiServer/Http/Controllers/Admin/Users/UsersController.cs @@ -1,8 +1,8 @@ using Microsoft.AspNetCore.Mvc; -using MoonCore.Attributes; using MoonCore.Exceptions; using MoonCore.Extended.Abstractions; using MoonCore.Extended.Helpers; +using MoonCore.Extended.PermFilter; using MoonCore.Models; using Moonlight.ApiServer.Database.Entities; using Moonlight.Shared.Http.Requests.Admin.Users; diff --git a/Moonlight.ApiServer/Properties/launchSettings.json b/Moonlight.ApiServer/Properties/launchSettings.json index ebab08ea..8c3160eb 100644 --- a/Moonlight.ApiServer/Properties/launchSettings.json +++ b/Moonlight.ApiServer/Properties/launchSettings.json @@ -6,7 +6,9 @@ "launchBrowser": false, "applicationUrl": "http://localhost:5165", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "ASPNETCORE_ENVIRONMENT": "Development", + "HTTP_PROXY": "", + "HTTPS_PROXY": "" }, "hotReloadEnabled": true }, @@ -16,7 +18,9 @@ "launchBrowser": false, "applicationUrl": "http://localhost:5165", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "ASPNETCORE_ENVIRONMENT": "Development", + "HTTP_PROXY": "", + "HTTPS_PROXY": "" }, "hotReloadEnabled": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}" diff --git a/Moonlight.Client/Moonlight.Client.csproj b/Moonlight.Client/Moonlight.Client.csproj index aa5e9a4c..e75ba64e 100644 --- a/Moonlight.Client/Moonlight.Client.csproj +++ b/Moonlight.Client/Moonlight.Client.csproj @@ -27,7 +27,7 @@ - +