Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Add vault manifest share details table (#2159)
Leendert de Borst64fb510dac10
diff --git a/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs b/apps/server/Databases/AliasServerDb/AliasServerDbContext.csindex 0e61847fd..d45686d32 100644--- a/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs+++ b/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs@@ -131,6 +131,11 @@ public class AliasServerDbContext : WorkerStatusDbContext, IDataProtectionKeyCon/// </summary>public DbSet<ClientAction> ClientActions { get; set; }+ /// <summary>+ /// Gets or sets the VaultManifestShareDetails DbSet.+ /// </summary>+ public DbSet<VaultManifestShareDetails> VaultManifestShareDetails { get; set; }+/// <summary>/// Gets or sets the VaultManifestDeliveryKeys DbSet./// </summary>@@ -541,6 +546,15 @@ public class AliasServerDbContext : WorkerStatusDbContext, IDataProtectionKeyConbuilder.HasIndex(d => new { d.VaultManifestDeliveryKeyId, d.EmailId });});+ modelBuilder.Entity<VaultManifestShareDetails>(builder =>+ {+ // The details are removed with the shared manifest they describe.+ builder.HasOne(d => d.VaultManifest)+ .WithOne()+ .HasForeignKey<VaultManifestShareDetails>(d => d.ManifestId)+ .OnDelete(DeleteBehavior.Cascade);+ });+modelBuilder.Entity<VaultManifestDeliveryKey>(builder =>{// A key is removed with its manifest: for a folder that is the folder's delivery keys, for adiff --git a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.csindex 3287151d4..fcf860fea 100644--- a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.cs+++ b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.cs@@ -1502,6 +1502,26 @@ namespace AliasServerDb.Migrationsb.ToTable("VaultManifestDeliveryKeys");});+ modelBuilder.Entity("AliasServerDb.VaultManifestShareDetails", b =>+ {+ b.Property<Guid>("ManifestId")+ .HasColumnType("uuid");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("EncryptedName")+ .HasMaxLength(2000)+ .HasColumnType("character varying(2000)");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.HasKey("ManifestId");++ b.ToTable("VaultManifestShareDetails");+ });+modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>{b.Property<Guid>("ManifestId")@@ -1963,6 +1983,17 @@ namespace AliasServerDb.Migrationsb.Navigation("VaultManifest");});+ modelBuilder.Entity("AliasServerDb.VaultManifestShareDetails", b =>+ {+ b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")+ .WithOne()+ .HasForeignKey("AliasServerDb.VaultManifestShareDetails", "ManifestId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("VaultManifest");+ });+modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>{b.HasOne("AliasServerDb.VaultManifest", "Manifest")diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.cs b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.csindex 9f1b5e857..8c2c17db5 100644--- a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.cs+++ b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.cs@@ -188,11 +188,34 @@ namespace AliasServerDb.Migrationsname: "IX_CapabilityRules_UserId",table: "CapabilityRules",column: "UserId");++ migrationBuilder.CreateTable(+ name: "VaultManifestShareDetails",+ columns: table => new+ {+ ManifestId = table.Column<Guid>(type: "uuid", nullable: false),+ EncryptedName = table.Column<string>(type: "character varying(2000)", maxLength: 2000, nullable: true),+ CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),+ UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)+ },+ constraints: table =>+ {+ table.PrimaryKey("PK_VaultManifestShareDetails", x => x.ManifestId);+ table.ForeignKey(+ name: "FK_VaultManifestShareDetails_VaultManifests_ManifestId",+ column: x => x.ManifestId,+ principalTable: "VaultManifests",+ principalColumn: "ManifestId",+ onDelete: ReferentialAction.Cascade);+ });}/// <inheritdoc />protected override void Down(MigrationBuilder migrationBuilder){+ migrationBuilder.DropTable(+ name: "VaultManifestShareDetails");+migrationBuilder.DropTable(name: "CapabilityRules");diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260917154825_MobileLoginRequestVerification.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260917154825_MobileLoginRequestVerification.Designer.csindex 92a70ccce..e541cb521 100644--- a/apps/server/Databases/AliasServerDb/Migrations/20260917154825_MobileLoginRequestVerification.Designer.cs+++ b/apps/server/Databases/AliasServerDb/Migrations/20260917154825_MobileLoginRequestVerification.Designer.cs@@ -1522,6 +1522,26 @@ namespace AliasServerDb.Migrationsb.ToTable("VaultManifestDeliveryKeys");});+ modelBuilder.Entity("AliasServerDb.VaultManifestShareDetails", b =>+ {+ b.Property<Guid>("ManifestId")+ .HasColumnType("uuid");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("EncryptedName")+ .HasMaxLength(2000)+ .HasColumnType("character varying(2000)");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.HasKey("ManifestId");++ b.ToTable("VaultManifestShareDetails");+ });+modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>{b.Property<Guid>("ManifestId")@@ -1983,6 +2003,17 @@ namespace AliasServerDb.Migrationsb.Navigation("VaultManifest");});+ modelBuilder.Entity("AliasServerDb.VaultManifestShareDetails", b =>+ {+ b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")+ .WithOne()+ .HasForeignKey("AliasServerDb.VaultManifestShareDetails", "ManifestId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("VaultManifest");+ });+modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>{b.HasOne("AliasServerDb.VaultManifest", "Manifest")diff --git a/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs b/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.csindex 2f5f901d5..0a53a0109 100644--- a/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs+++ b/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs@@ -1519,6 +1519,26 @@ namespace AliasServerDb.Migrationsb.ToTable("VaultManifestDeliveryKeys");});+ modelBuilder.Entity("AliasServerDb.VaultManifestShareDetails", b =>+ {+ b.Property<Guid>("ManifestId")+ .HasColumnType("uuid");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("EncryptedName")+ .HasMaxLength(2000)+ .HasColumnType("character varying(2000)");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.HasKey("ManifestId");++ b.ToTable("VaultManifestShareDetails");+ });+modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>{b.Property<Guid>("ManifestId")@@ -1980,6 +2000,17 @@ namespace AliasServerDb.Migrationsb.Navigation("VaultManifest");});+ modelBuilder.Entity("AliasServerDb.VaultManifestShareDetails", b =>+ {+ b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")+ .WithOne()+ .HasForeignKey("AliasServerDb.VaultManifestShareDetails", "ManifestId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("VaultManifest");+ });+modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>{b.HasOne("AliasServerDb.VaultManifest", "Manifest")diff --git a/apps/server/Databases/AliasServerDb/VaultManifestShareDetails.cs b/apps/server/Databases/AliasServerDb/VaultManifestShareDetails.csnew file mode 100644index 000000000..887f79559--- /dev/null+++ b/apps/server/Databases/AliasServerDb/VaultManifestShareDetails.cs@@ -0,0 +1,45 @@+//-----------------------------------------------------------------------+// <copyright file="VaultManifestShareDetails.cs" company="aliasvault">+// Copyright (c) aliasvault. All rights reserved.+// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.+// </copyright>+//-----------------------------------------------------------------------+namespace AliasServerDb;++using System.ComponentModel.DataAnnotations;+using System.ComponentModel.DataAnnotations.Schema;++/// <summary>+/// What a group's administrators manage about one of its shared manifests. Only a manifest owned by a shared group+/// has a row, nothing here applies to a personal manifest.+/// </summary>+public class VaultManifestShareDetails+{+ /// <summary>+ /// Gets or sets the shared manifest these details belong to.+ /// </summary>+ [Key]+ public Guid ManifestId { get; set; }++ /// <summary>+ /// Gets or sets the navigation property to the shared manifest.+ /// </summary>+ [ForeignKey("ManifestId")]+ public virtual VaultManifest VaultManifest { get; set; } = null!;++ /// <summary>+ /// Gets or sets the name of the shared manifest, encrypted with the manifest's own key (base64).+ /// </summary>+ [StringLength(2000)]+ public string? EncryptedName { get; set; }++ /// <summary>+ /// Gets or sets created timestamp.+ /// </summary>+ public DateTime CreatedAt { get; set; }++ /// <summary>+ /// Gets or sets updated timestamp.+ /// </summary>+ public DateTime UpdatedAt { get; set; }+}diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/CreateSharedManifestRequest.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/CreateSharedManifestRequest.csindex 2050d2962..a60693e07 100644--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/CreateSharedManifestRequest.cs+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/CreateSharedManifestRequest.cs@@ -7,6 +7,8 @@namespace AliasVault.Shared.Models.WebApi.V2.Groups;+using System.ComponentModel.DataAnnotations;+/// <summary>/// Request for POST /v2/Groups/{groupId}/manifests: create another shared manifest for the group./// </summary>@@ -25,4 +27,8 @@ public class CreateSharedManifestRequest/// <summary>Gets or sets the asymmetric algorithm the caller's own grant was encrypted with.</summary>public required string Algorithm { get; set; }++ /// <summary>Gets or sets the name of the manifest, encrypted with the manifest's own key (base64).</summary>+ [StringLength(2000)]+ public string? EncryptedName { get; set; }}diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/UpdateSharedManifestRequest.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/UpdateSharedManifestRequest.csnew file mode 100644index 000000000..9e4551397--- /dev/null+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/UpdateSharedManifestRequest.cs@@ -0,0 +1,21 @@+//-----------------------------------------------------------------------+// <copyright file="UpdateSharedManifestRequest.cs" company="aliasvault">+// Copyright (c) aliasvault. All rights reserved.+// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.+// </copyright>+//-----------------------------------------------------------------------++namespace AliasVault.Shared.Models.WebApi.V2.Groups;++using System.ComponentModel.DataAnnotations;++/// <summary>+/// Request for POST /v2/Groups/{groupId}/manifests/{manifestId}: change the details of one of the group's shared+/// manifests. A detail that is left out stays as it is.+/// </summary>+public class UpdateSharedManifestRequest+{+ /// <summary>Gets or sets the new name of the manifest, encrypted with the manifest's own key (base64).</summary>+ [StringLength(2000, MinimumLength = 1)]+ public string? EncryptedName { get; set; }+}diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Vault/ManifestRevision.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Vault/ManifestRevision.csindex ff733930d..8c7d0eb5a 100644--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Vault/ManifestRevision.cs+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Vault/ManifestRevision.cs@@ -18,4 +18,7 @@ public class ManifestRevision/// <summary>Gets or sets the current (latest) revision number for this manifest.</summary>public required long Revision { get; set; }++ /// <summary>Gets or sets the name of a shared manifest, encrypted with the manifest's own key (base64).</summary>+ public string? EncryptedName { get; set; }}