Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Simplify Vault.Version usage (#2159)

Leendert de Borstb29a5339015a
diff --git a/apps/server/AliasVault.Api/Controllers/V2/SharingController.cs b/apps/server/AliasVault.Api/Controllers/V2/SharingController.cs
index 5c8fe3f8b..22f79229d 100644
--- a/apps/server/AliasVault.Api/Controllers/V2/SharingController.cs
+++ b/apps/server/AliasVault.Api/Controllers/V2/SharingController.cs
@@ -107,7 +107,9 @@ public class SharingController(
StorageFormat = ManifestFormat,
ManifestBlob = model.ManifestBlob,
ManifestCiphertextHash = model.ManifestCiphertextHash,
- Version = model.Version,
+
+ // Deprecated column: manifest-v1 revisions no longer carry a data-model version (see VaultManifestBase.Version).
+ Version = string.Empty,
RevisionNumber = 1,
Salt = string.Empty,
Verifier = string.Empty,
diff --git a/apps/server/AliasVault.Api/Controllers/V2/VaultController.cs b/apps/server/AliasVault.Api/Controllers/V2/VaultController.cs
index d6f8dae5f..745a08a28 100644
--- a/apps/server/AliasVault.Api/Controllers/V2/VaultController.cs
+++ b/apps/server/AliasVault.Api/Controllers/V2/VaultController.cs
@@ -413,7 +413,9 @@ public class VaultController(
row.StorageFormat = ManifestFormat;
row.ManifestBlob = mw.ManifestBlob;
row.ManifestCiphertextHash = mw.ManifestCiphertextHash;
- row.Version = mw.Version;
+
+ // Deprecated column: manifest-v1 revisions no longer carry a data-model version (see VaultManifestBase.Version).
+ row.Version = string.Empty;
row.RevisionNumber = mw.CurrentRevision + 1;
row.FileSize = FileHelper.Base64StringToKilobytes(mw.ManifestBlob);
row.CredentialsCount = mw.CredentialsCount;
diff --git a/apps/server/Databases/AliasServerDb/VaultManifestBase.cs b/apps/server/Databases/AliasServerDb/VaultManifestBase.cs
index 56ad56d7f..c8cfd5b35 100644
--- a/apps/server/Databases/AliasServerDb/VaultManifestBase.cs
+++ b/apps/server/Databases/AliasServerDb/VaultManifestBase.cs
@@ -38,7 +38,10 @@ public abstract class VaultManifestBase
public string? ManifestCiphertextHash { get; set; }
/// <summary>
- /// Gets or sets the vault data model version.
+ /// Gets or sets the vault data model version. Only the legacy sqlite-blob format populates this; manifest-v1
+ /// revisions leave it empty as the version is carried inside the manifest naming scheme instead. Kept so
+ /// not-yet-migrated users' manifests retain their historic value. TODO: remove this column once the legacy
+ /// model is fully deprecated.
/// </summary>
[StringLength(255)]
public required string Version { get; set; }
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Sharing/CreateSharedFolderRequest.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Sharing/CreateSharedFolderRequest.cs
index 46707f30d..b70739e51 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Sharing/CreateSharedFolderRequest.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Sharing/CreateSharedFolderRequest.cs
@@ -23,9 +23,6 @@ public class CreateSharedFolderRequest
/// <summary>Gets or sets the SHA-256 (hex) of the manifest ciphertext, for storage-layer integrity verification.</summary>
public string? ManifestCiphertextHash { get; set; }
- /// <summary>Gets or sets the vault data model version string.</summary>
- public required string Version { get; set; }
-
/// <summary>Gets or sets the folder VEK wrapped with the caller's own public key (base64), decryptable only by the caller.</summary>
public required string SelfWrappedVek { get; set; }
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Vault/ManifestWrite.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Vault/ManifestWrite.cs
index bbb54bc47..da4e9d138 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Vault/ManifestWrite.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Vault/ManifestWrite.cs
@@ -24,9 +24,6 @@ public class ManifestWrite
/// <summary>Gets or sets the SHA-256 (hex) of the manifest ciphertext.</summary>
public required string ManifestCiphertextHash { get; set; }
- /// <summary>Gets or sets the data-model version string (e.g. "2.0.0").</summary>
- public required string Version { get; set; }
-
/// <summary>Gets or sets the revision the client last synced for this manifest; the new revision must be exactly one above it.</summary>
public required long CurrentRevision { get; set; }