From ce86d103039b22695b04714ee85e9ef3e1e032b5 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Sun, 23 Jan 2022 11:41:42 +0100 Subject: feat(auth): Implements first draft of basic auth gen/validation --- src/server/Migrations/AppDbContextModelSnapshot.cs | 64 ++++++++++++++++++++-- 1 file changed, 59 insertions(+), 5 deletions(-) (limited to 'src/server/Migrations/AppDbContextModelSnapshot.cs') diff --git a/src/server/Migrations/AppDbContextModelSnapshot.cs b/src/server/Migrations/AppDbContextModelSnapshot.cs index 5476b90..c48f478 100644 --- a/src/server/Migrations/AppDbContextModelSnapshot.cs +++ b/src/server/Migrations/AppDbContextModelSnapshot.cs @@ -17,12 +17,56 @@ namespace IOL.BookmarkThing.Server.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "5.0.7") + .HasAnnotation("ProductVersion", "6.0.1") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - modelBuilder.Entity("IOL.BookmarkThing.Server.Data.Database.Entry", b => + modelBuilder.Entity("IOL.BookmarkThing.Server.Models.Database.AccessToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("AllowCreate") + .HasColumnType("boolean") + .HasColumnName("allow_create"); + + b.Property("AllowDelete") + .HasColumnType("boolean") + .HasColumnName("allow_delete"); + + b.Property("AllowRead") + .HasColumnType("boolean") + .HasColumnName("allow_read"); + + b.Property("AllowUpdate") + .HasColumnType("boolean") + .HasColumnName("allow_update"); + + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("created"); + + b.Property("ExpiryDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("expiry_date"); + + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("user_id"); + + b.HasKey("Id") + .HasName("pk_access_tokens"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_access_tokens_user_id"); + + b.ToTable("access_tokens", (string)null); + }); + + modelBuilder.Entity("IOL.BookmarkThing.Server.Models.Database.Entry", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -30,7 +74,7 @@ namespace IOL.BookmarkThing.Server.Migrations .HasColumnName("id"); b.Property("Created") - .HasColumnType("timestamp without time zone") + .HasColumnType("timestamp with time zone") .HasColumnName("created"); b.Property("Description") @@ -55,7 +99,7 @@ namespace IOL.BookmarkThing.Server.Migrations b.ToTable("entries", (string)null); }); - modelBuilder.Entity("IOL.BookmarkThing.Server.Data.Database.User", b => + modelBuilder.Entity("IOL.BookmarkThing.Server.Models.Database.User", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -63,7 +107,7 @@ namespace IOL.BookmarkThing.Server.Migrations .HasColumnName("id"); b.Property("Created") - .HasColumnType("timestamp without time zone") + .HasColumnType("timestamp with time zone") .HasColumnName("created"); b.Property("Password") @@ -79,6 +123,16 @@ namespace IOL.BookmarkThing.Server.Migrations b.ToTable("users", (string)null); }); + + modelBuilder.Entity("IOL.BookmarkThing.Server.Models.Database.AccessToken", b => + { + b.HasOne("IOL.BookmarkThing.Server.Models.Database.User", "User") + .WithMany() + .HasForeignKey("UserId") + .HasConstraintName("fk_access_tokens_users_user_id"); + + b.Navigation("User"); + }); #pragma warning restore 612, 618 } } -- cgit v1.3