Skip to content

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

Collapse vault/status and auth/status into a single status endpoint (#2159)

Leendert de Borst407ce0f1eec2
diff --git a/apps/server/AliasVault.Api/Controllers/V2/AuthController.cs b/apps/server/AliasVault.Api/Controllers/V2/AuthController.cs
index a0fc2906d..23221f3c8 100644
--- a/apps/server/AliasVault.Api/Controllers/V2/AuthController.cs
+++ b/apps/server/AliasVault.Api/Controllers/V2/AuthController.cs
@@ -77,73 +77,6 @@ public class AuthController(IAliasServerDbContextFactory dbContextFactory, UserM
/// </summary>
private static readonly SemaphoreSlim Semaphore = new(1, 1);
- /// <summary>
- /// Status endpoint called by client to check if user is still authenticated and get sync status.
- /// </summary>
- /// <param name="clientHeader">Client header.</param>
- /// <returns>Returns status response if valid authentication is provided, otherwise it will return 401 unauthorized.</returns>
- [Authorize]
- [HttpGet("status")]
- public async Task<IActionResult> Status([FromHeader(Name = "X-AliasVault-Client")] string? clientHeader)
- {
- var user = await userManager.GetUserAsync(User);
- if (user == null)
- {
- return Unauthorized();
- }
-
- // Check if the user account is blocked
- if (user.Blocked)
- {
- return Unauthorized(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.ACCOUNT_BLOCKED, 401));
- }
-
- // Current revision per logical manifest (one row per manifest) so the client can compare each manifest
- // against its own last-known revision.
- var manifestRevisions = user.VaultManifests
- .Select(x => new AliasVault.Shared.Models.WebApi.V2.Vault.ManifestRevision { ManifestId = x.ManifestId, IsRoot = x.IsRoot, Revision = x.RevisionNumber })
- .ToList();
-
- // Include manifests shared with this user (owned by other users, granted via a `shared` VaultKey).
- var ownedManifestIds = user.VaultManifests.Select(m => m.ManifestId).ToHashSet();
- var grantedManifestIds = user.VaultKeys
- .Where(k => k.KeyType == AuthHelper.VaultKeyTypeShared && k.VaultManifestId != null && !ownedManifestIds.Contains(k.VaultManifestId.Value))
- .Select(k => k.VaultManifestId!.Value)
- .ToList();
- if (grantedManifestIds.Count > 0)
- {
- await using var context = await dbContextFactory.CreateDbContextAsync();
- manifestRevisions.AddRange(await context.VaultManifests
- .Where(m => grantedManifestIds.Contains(m.ManifestId) && m.StorageFormat == "manifest-v1")
- .Select(m => new AliasVault.Shared.Models.WebApi.V2.Vault.ManifestRevision { ManifestId = m.ManifestId, IsRoot = false, Revision = m.RevisionNumber })
- .ToListAsync());
- }
-
- // Current SRP salt: lives on the password VaultKey for v2 migrated users, on the root manifest for legacy users.
- var encryptionSettings = AuthHelper.GetUserLatestVaultEncryptionSettings(user);
- var hasVaultKey = user.VaultKeys.Any(x => x.KeyType == AuthHelper.VaultKeyTypePassword);
-
- // Check client version compatibility if header is provided
- var clientSupported = false;
- var clientInfo = ClientHeaderInfo.Parse(clientHeader);
- if (!string.IsNullOrEmpty(clientInfo.ClientVersion)
- && AppInfo.MinimumClientVersions.TryGetValue(clientInfo.ClientName, out var minimumVersion))
- {
- var meetsMinimum = VersionHelper.IsVersionEqualOrNewer(clientInfo.ClientVersion, minimumVersion);
- var isBlocked = VersionHelper.IsVersionBlocked(clientInfo.ClientName, clientInfo.ClientVersion, AppInfo.UnsupportedClientVersions);
- clientSupported = meetsMinimum && !isBlocked;
- }
-
- return Ok(new AliasVault.Shared.Models.WebApi.V2.Auth.StatusResponse
- {
- ClientVersionSupported = clientSupported,
- ServerVersion = AppInfo.GetFullVersion(),
- ManifestRevisions = manifestRevisions,
- SrpSalt = encryptionSettings.Salt,
- HasVaultKey = hasVaultKey,
- });
- }
-
/// <summary>
/// Login endpoint used to process login attempt using credentials.
/// </summary>
diff --git a/apps/server/AliasVault.Api/Controllers/V2/StatusController.cs b/apps/server/AliasVault.Api/Controllers/V2/StatusController.cs
new file mode 100644
index 000000000..42a1fa789
--- /dev/null
+++ b/apps/server/AliasVault.Api/Controllers/V2/StatusController.cs
@@ -0,0 +1,91 @@
+//-----------------------------------------------------------------------
+// <copyright file="StatusController.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.Api.Controllers.V2;
+
+using AliasServerDb;
+using AliasVault.Api.Controllers.Abstracts;
+using AliasVault.Api.Headers;
+using AliasVault.Api.Helpers;
+using AliasVault.Shared.Core;
+using AliasVault.Shared.Models.Enums;
+using AliasVault.Shared.Models.WebApi;
+using AliasVault.Shared.Models.WebApi.V2.Vault;
+using Asp.Versioning;
+using Microsoft.AspNetCore.Identity;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using StatusModels = AliasVault.Shared.Models.WebApi.V2.Status;
+
+/// <summary>
+/// Generic status controller. Serves the single <c>GET /v2/Status</c> endpoint that a client polls to get
+/// full sync status in one call including session validity, manifest and bucket revisions etc.
+/// </summary>
+/// <param name="dbContextFactory">DbContext factory.</param>
+/// <param name="userManager">UserManager.</param>
+[ApiVersion("2")]
+public class StatusController(IAliasServerDbContextFactory dbContextFactory, UserManager<AliasVaultUser> userManager) : AuthenticatedRequestController(userManager)
+{
+ /// <summary>
+ /// Status endpoint called by the client to get the full sync status in one call.
+ /// </summary>
+ /// <param name="clientHeader">Client header used for version-compatibility checks.</param>
+ /// <returns>The combined status response, or 401 when the caller is not authenticated.</returns>
+ [HttpGet]
+ public async Task<IActionResult> Status([FromHeader(Name = "X-AliasVault-Client")] string? clientHeader)
+ {
+ var user = await GetUserManager().GetUserAsync(User);
+ if (user == null)
+ {
+ return Unauthorized();
+ }
+
+ if (user.Blocked)
+ {
+ return Unauthorized(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.ACCOUNT_BLOCKED, 401));
+ }
+
+ await using var context = await dbContextFactory.CreateDbContextAsync();
+
+ // Manifest revisions and migration status are built via the shared helper.
+ var manifestRevisions = await VaultStatusHelper.GetManifestRevisionsAsync(context, user.Id);
+ var isMigrated = await VaultStatusHelper.IsUserMigratedAsync(context, user.Id);
+
+ // Latest revision per bucket kind.
+ var bucketRevisions = await context.VaultDataBuckets
+ .Where(x => x.OwnerUserId == user.Id)
+ .GroupBy(x => x.Category)
+ .Select(g => new BucketRevision { Category = g.Key, Revision = g.Max(b => b.RevisionNumber) })
+ .ToListAsync();
+
+ // Current SRP salt: lives on the password VaultKey for v2 migrated users, on the root manifest for legacy users.
+ var encryptionSettings = AuthHelper.GetUserLatestVaultEncryptionSettings(user);
+ var hasVaultKey = user.VaultKeys.Any(x => x.KeyType == AuthHelper.VaultKeyTypePassword);
+
+ // Check client version compatibility if the header is provided.
+ var clientSupported = false;
+ var clientInfo = ClientHeaderInfo.Parse(clientHeader);
+ if (!string.IsNullOrEmpty(clientInfo.ClientVersion)
+ && AppInfo.MinimumClientVersions.TryGetValue(clientInfo.ClientName, out var minimumVersion))
+ {
+ var meetsMinimum = VersionHelper.IsVersionEqualOrNewer(clientInfo.ClientVersion, minimumVersion);
+ var isBlocked = VersionHelper.IsVersionBlocked(clientInfo.ClientName, clientInfo.ClientVersion, AppInfo.UnsupportedClientVersions);
+ clientSupported = meetsMinimum && !isBlocked;
+ }
+
+ return Ok(new StatusModels.StatusResponse
+ {
+ ClientVersionSupported = clientSupported,
+ ServerVersion = AppInfo.GetFullVersion(),
+ SrpSalt = encryptionSettings.Salt,
+ HasVaultKey = hasVaultKey,
+ StorageFormat = isMigrated ? StorageFormat.Manifest : StorageFormat.SqliteBlob,
+ ManifestRevisions = manifestRevisions,
+ BucketRevisions = bucketRevisions,
+ });
+ }
+}
diff --git a/apps/server/AliasVault.Api/Controllers/V2/VaultController.cs b/apps/server/AliasVault.Api/Controllers/V2/VaultController.cs
index 69f841194..d6f8dae5f 100644
--- a/apps/server/AliasVault.Api/Controllers/V2/VaultController.cs
+++ b/apps/server/AliasVault.Api/Controllers/V2/VaultController.cs
@@ -58,55 +58,6 @@ public class VaultController(
],
};
- /// <summary>
- /// Status endpoint. Tells the client which storage format the server has for this user so the client can
- /// pick the v1 (legacy) or v2 (new) sync path.
- /// </summary>
- /// <returns>Status DTO.</returns>
- [HttpGet("status")]
- public async Task<IActionResult> Status()
- {
- await using var context = await dbContextFactory.CreateDbContextAsync();
- var user = await GetCurrentUserAsync();
- if (user == null)
- {
- return Unauthorized();
- }
-
- // Current revision per logical manifest: everything the user owns plus manifests shared with them,
- // so revision-based pull detection covers shared folders too.
- var ownedManifestRevisions = await context.VaultManifests
- .Where(x => x.OwnerUserId == user.Id && x.StorageFormat == ManifestFormat)
- .Select(x => new ManifestRevision { ManifestId = x.ManifestId, IsRoot = x.IsRoot, Revision = x.RevisionNumber })
- .ToListAsync();
-
- // Migration status is judged solely by the user's own root manifest. A shared-with-me manifest (always
- // IsRoot=false, owned by another user) must never make a not-yet-migrated user look migrated, or the client
- // would push without CreateVaultKey and the upload would fail with VAULT_KEY_NOT_FOUND.
- var isMigrated = ownedManifestRevisions.Any(x => x.IsRoot);
-
- var manifestRevisions = ownedManifestRevisions;
- var grantedManifestIds = await GetGrantedManifestIdsAsync(context, user.Id);
- manifestRevisions.AddRange(await context.VaultManifests
- .Where(x => grantedManifestIds.Contains(x.ManifestId) && x.StorageFormat == ManifestFormat)
- .Select(x => new ManifestRevision { ManifestId = x.ManifestId, IsRoot = false, Revision = x.RevisionNumber })
- .ToListAsync());
-
- // Latest revision per bucket kind.
- var bucketRevisions = await context.VaultDataBuckets
- .Where(x => x.OwnerUserId == user.Id)
- .GroupBy(x => x.Category)
- .Select(g => new BucketRevision { Category = g.Key, Revision = g.Max(b => b.RevisionNumber) })
- .ToListAsync();
-
- return Ok(new StatusResponse
- {
- StorageFormat = isMigrated ? StorageFormat.Manifest : StorageFormat.SqliteBlob,
- ManifestRevisions = manifestRevisions,
- BucketRevisions = bucketRevisions,
- });
- }
-
/// <summary>
/// Atomic snapshot. Returns the latest encrypted manifest + metadata + blob refs + email routing in one shot.
/// Convenient for fresh client init.
@@ -192,6 +143,8 @@ public class VaultController(
.Where(k => k.UserId == user.Id && k.KeyType == AuthHelper.VaultKeyTypeShared && k.VaultManifestId != null && ownedNonRootIds.Contains(k.VaultManifestId.Value))
.ToDictionaryAsync(k => k.VaultManifestId!.Value);
+ var selfWrapPublicKeys = await ResolveWrapPublicKeysAsync(context, selfGrantsByManifest.Values.Where(g => g.RecipientPublicKeyId != null).Select(g => g.RecipientPublicKeyId!.Value));
+
var manifests = latestManifests.Select(m => new Manifest
{
ManifestId = m.ManifestId,
@@ -203,6 +156,7 @@ public class VaultController(
BlobReferences = refsByManifest.TryGetValue(m.ManifestId, out var refs) ? refs : [],
WrappedVek = selfGrantsByManifest.TryGetValue(m.ManifestId, out var selfGrant) ? selfGrant.WrappedVek : null,
WrapScheme = selfGrantsByManifest.TryGetValue(m.ManifestId, out var selfGrant2) ? selfGrant2.WrapScheme : null,
+ WrapPublicKey = selfGrantsByManifest.TryGetValue(m.ManifestId, out var selfGrant3) && selfGrant3.RecipientPublicKeyId != null ? selfWrapPublicKeys.GetValueOrDefault(selfGrant3.RecipientPublicKeyId.Value) : null,
}).ToList();
// Append manifests shared with this user by other owners, each carrying the wrapped VEK the caller
@@ -274,6 +228,11 @@ public class VaultController(
var grant = await context.VaultKeys.FirstOrDefaultAsync(k => k.UserId == user.Id && k.KeyType == AuthHelper.VaultKeyTypeShared && k.VaultManifestId == latest.ManifestId);
manifest.WrappedVek = grant?.WrappedVek;
manifest.WrapScheme = grant?.WrapScheme;
+ if (grant?.RecipientPublicKeyId != null)
+ {
+ manifest.WrapPublicKey = await context.UserEncryptionKeys.Where(k => k.Id == grant.RecipientPublicKeyId).Select(k => k.PublicKey).FirstOrDefaultAsync();
+ }
+
if (latest.OwnerUserId != user.Id)
{
manifest.OwnerUsername = await context.AliasVaultUsers.Where(u => u.Id == latest.OwnerUserId).Select(u => u.UserName).FirstOrDefaultAsync();
@@ -724,16 +683,19 @@ public class VaultController(
}
/// <summary>
- /// The ids of manifests <b>other</b> users have granted to <paramref name="userId"/> via a <c>shared</c> VaultKey
- /// row. The user's own self-grants are excluded, those manifests are already covered as owned manifests.
+ /// Resolves the public key each grant's VEK was wrapped with.
/// </summary>
- private static async Task<List<Guid>> GetGrantedManifestIdsAsync(AliasServerDbContext context, string userId)
+ private static async Task<Dictionary<Guid, string>> ResolveWrapPublicKeysAsync(AliasServerDbContext context, IEnumerable<Guid> publicKeyIds)
{
- return await context.VaultKeys
- .Where(k => k.UserId == userId && k.KeyType == AuthHelper.VaultKeyTypeShared && k.VaultManifestId != null
- && context.VaultManifests.Any(m => m.ManifestId == k.VaultManifestId && m.OwnerUserId != userId))
- .Select(k => k.VaultManifestId!.Value)
- .ToListAsync();
+ var ids = publicKeyIds.Distinct().ToList();
+ if (ids.Count == 0)
+ {
+ return new Dictionary<Guid, string>();
+ }
+
+ return await context.UserEncryptionKeys
+ .Where(k => ids.Contains(k.Id))
+ .ToDictionaryAsync(k => k.Id, k => k.PublicKey);
}
/// <summary>
@@ -770,6 +732,8 @@ public class VaultController(
.Join(context.VaultBlobObjects, r => r.BlobHash, b => b.Hash, (r, b) => new { r.ManifestId, r.RevisionNumber, b.Hash, b.Category })
.ToListAsync();
+ var wrapPublicKeys = await ResolveWrapPublicKeysAsync(context, grants.Where(g => g.RecipientPublicKeyId != null).Select(g => g.RecipientPublicKeyId!.Value));
+
var result = new List<Manifest>();
foreach (var grant in grants)
{
@@ -796,6 +760,7 @@ public class VaultController(
OwnerUsername = ownerUsernamesById.GetValueOrDefault(manifestRow.OwnerUserId),
WrappedVek = grant.WrappedVek,
WrapScheme = grant.WrapScheme,
+ WrapPublicKey = grant.RecipientPublicKeyId != null ? wrapPublicKeys.GetValueOrDefault(grant.RecipientPublicKeyId.Value) : null,
});
}
diff --git a/apps/server/AliasVault.Api/Helpers/VaultStatusHelper.cs b/apps/server/AliasVault.Api/Helpers/VaultStatusHelper.cs
new file mode 100644
index 000000000..6355e38ef
--- /dev/null
+++ b/apps/server/AliasVault.Api/Helpers/VaultStatusHelper.cs
@@ -0,0 +1,94 @@
+//-----------------------------------------------------------------------
+// <copyright file="VaultStatusHelper.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.Api.Helpers;
+
+using AliasServerDb;
+using AliasVault.Shared.Models.WebApi.V2.Vault;
+using Microsoft.EntityFrameworkCore;
+
+/// <summary>
+/// Helpers for building the manifest-revision payload shared between the <c>Status</c> endpoints.
+/// </summary>
+public static class VaultStatusHelper
+{
+ private const string ManifestFormat = "manifest-v1";
+
+ /// <summary>
+ /// The full manifest-revision list a status endpoint reports: the user's own manifests (all storage formats)
+ /// plus every manifest shared with them.
+ /// </summary>
+ /// <param name="context">Database context.</param>
+ /// <param name="userId">The id of the user to build manifest revisions for.</param>
+ /// <returns>The combined owned + shared-with-me manifest revision list.</returns>
+ public static async Task<List<ManifestRevision>> GetManifestRevisionsAsync(AliasServerDbContext context, string userId)
+ {
+ var revisions = await GetOwnedManifestRevisionsAsync(context, userId);
+ revisions.AddRange(await GetGrantedManifestRevisionsAsync(context, userId));
+ return revisions;
+ }
+
+ /// <summary>
+ /// Whether the user has migrated to the manifest-v1 storage format.
+ /// </summary>
+ /// <param name="context">Database context.</param>
+ /// <param name="userId">The id of the user to check migration status for.</param>
+ /// <returns>True when the user's own root manifest is in the manifest-v1 format.</returns>
+ public static async Task<bool> IsUserMigratedAsync(AliasServerDbContext context, string userId)
+ {
+ return await context.VaultManifests.AnyAsync(x => x.OwnerUserId == userId && x.IsRoot && x.StorageFormat == ManifestFormat);
+ }
+
+ /// <summary>
+ /// The revision entries for every manifest owned by <paramref name="userId"/>, across all storage formats.
+ /// </summary>
+ /// <param name="context">Database context.</param>
+ /// <param name="userId">The id of the user to build owned manifest revisions for.</param>
+ /// <returns>The list of owned manifest revisions.</returns>
+ private static async Task<List<ManifestRevision>> GetOwnedManifestRevisionsAsync(AliasServerDbContext context, string userId)
+ {
+ return await context.VaultManifests
+ .Where(x => x.OwnerUserId == userId)
+ .Select(x => new ManifestRevision { ManifestId = x.ManifestId, IsRoot = x.IsRoot, Revision = x.RevisionNumber })
+ .ToListAsync();
+ }
+
+ /// <summary>
+ /// The revision entries for every manifest another user has shared with <paramref name="userId"/>.
+ /// </summary>
+ /// <param name="context">Database context.</param>
+ /// <param name="userId">The id of the user to build granted manifest revisions for.</param>
+ /// <returns>The list of shared-with-me manifest revisions (empty when the user has no grants).</returns>
+ private static async Task<List<ManifestRevision>> GetGrantedManifestRevisionsAsync(AliasServerDbContext context, string userId)
+ {
+ var grantedManifestIds = await GetGrantedManifestIdsAsync(context, userId);
+ if (grantedManifestIds.Count == 0)
+ {
+ return [];
+ }
+
+ return await context.VaultManifests
+ .Where(m => grantedManifestIds.Contains(m.ManifestId) && m.StorageFormat == ManifestFormat)
+ .Select(m => new ManifestRevision { ManifestId = m.ManifestId, IsRoot = false, Revision = m.RevisionNumber })
+ .ToListAsync();
+ }
+
+ /// <summary>
+ /// The ids of manifests <b>other</b> users have granted to <paramref name="userId"/>.
+ /// </summary>
+ /// <param name="context">Database context.</param>
+ /// <param name="userId">The id of the user to resolve granted manifest ids for.</param>
+ /// <returns>The list of granted manifest ids.</returns>
+ private static async Task<List<Guid>> GetGrantedManifestIdsAsync(AliasServerDbContext context, string userId)
+ {
+ return await context.VaultKeys
+ .Where(k => k.UserId == userId && k.KeyType == AuthHelper.VaultKeyTypeShared && k.VaultManifestId != null
+ && context.VaultManifests.Any(m => m.ManifestId == k.VaultManifestId && m.OwnerUserId != userId))
+ .Select(k => k.VaultManifestId!.Value)
+ .ToListAsync();
+ }
+}
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V1/Auth/StatusResponse.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V1/Auth/StatusResponse.cs
index b53233a96..c505eef5b 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V1/Auth/StatusResponse.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V1/Auth/StatusResponse.cs
@@ -8,8 +8,7 @@
namespace AliasVault.Shared.Models.WebApi.V1.Auth;
/// <summary>
-/// Response model for the v1 status endpoint. Carries the single global vault revision. v2 clients use
-/// <see cref="AliasVault.Shared.Models.WebApi.V2.Auth.StatusResponse"/> instead, which is manifest-revision based.
+/// Response model for the v1 status endpoint.
/// </summary>
public class StatusResponse
{
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Auth/StatusResponse.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Status/StatusResponse.cs
similarity index 75%
rename from apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Auth/StatusResponse.cs
rename to apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Status/StatusResponse.cs
index 0c42df9fa..1f72c0660 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Auth/StatusResponse.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Status/StatusResponse.cs
@@ -5,12 +5,13 @@
// </copyright>
//-----------------------------------------------------------------------
-namespace AliasVault.Shared.Models.WebApi.V2.Auth;
+namespace AliasVault.Shared.Models.WebApi.V2.Status;
using AliasVault.Shared.Models.WebApi.V2.Vault;
/// <summary>
-/// Response model for the v2 status endpoint.
+/// Response for GET /v2/Status: a single generic status endpoint that combines session/version checks
+/// with the vault storage-format and revision info.
/// </summary>
public class StatusResponse
{
@@ -26,14 +27,6 @@ public class StatusResponse
/// </summary>
public required string ServerVersion { get; set; }
- /// <summary>
- /// Gets or sets the latest revision for each logical manifest the user has, so the client can compare each
- /// manifest's server revision against its own last-known revision per manifest. For a not-yet-migrated user
- /// the server synthesizes a Main entry from their legacy vault, so the list always contains at least one entry
- /// for an existing user.
- /// </summary>
- public List<ManifestRevision> ManifestRevisions { get; set; } = [];
-
/// <summary>
/// Gets or sets the SRP salt. This is used by the client to validate that the local encryption key
/// still matches the latest vault revision. If it doesn't match, the client should trigger a logout
@@ -46,4 +39,15 @@ public class StatusResponse
/// TODO: remove once every user has migrated to the KEK/VEK model.
/// </summary>
public bool HasVaultKey { get; set; }
+
+ /// <summary>Gets or sets the storage format the server has recorded for the user's latest vault.</summary>
+ public required StorageFormat StorageFormat { get; set; }
+
+ /// <summary>
+ /// Gets or sets the latest revision for each logical manifest the user has access to.
+ /// </summary>
+ public List<ManifestRevision> ManifestRevisions { get; set; } = [];
+
+ /// <summary>Gets or sets the latest revision for each data-bucket kind the user has. Empty when none stored.</summary>
+ public List<BucketRevision> BucketRevisions { get; set; } = [];
}
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Vault/Manifest.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Vault/Manifest.cs
index b10a9d1a5..cf873c298 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Vault/Manifest.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Vault/Manifest.cs
@@ -9,7 +9,7 @@ namespace AliasVault.Shared.Models.WebApi.V2.Vault;
/// <summary>
/// A single vault manifest as carried in list-based payloads. A user's logical vault is assembled from one or more
-/// manifests: exactly one root manifest plus (from R2) any number of non-root manifests the user owns or has been
+/// manifests: exactly one root manifest plus, any number of non-root manifests the user owns or has been
/// granted access to. Each manifest is independently encrypted and revisioned, and carries its own blob references.
/// </summary>
public class Manifest
@@ -51,4 +51,9 @@ public class Manifest
/// <summary>Gets or sets the wrap scheme of <see cref="WrappedVek"/> (e.g. "rsa-oaep"). Null when <see cref="WrappedVek"/> is null.</summary>
public string? WrapScheme { get; set; }
+
+ /// <summary>
+ /// Gets or sets the public key <see cref="WrappedVek"/> was wrapped with.
+ /// </summary>
+ public string? WrapPublicKey { get; set; }
}
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Vault/StatusResponse.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Vault/StatusResponse.cs
deleted file mode 100644
index 7d5ca4e7b..000000000
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Vault/StatusResponse.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//-----------------------------------------------------------------------
-// <copyright file="StatusResponse.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.Vault;
-
-/// <summary>
-/// Response for GET /v2/Vault/status. Tells the client whether to migrate or run the v2 flow.
-/// </summary>
-public class StatusResponse
-{
- /// <summary>Gets or sets the storage format the server has recorded for the user's latest vault.</summary>
- public required StorageFormat StorageFormat { get; set; }
-
- /// <summary>Gets or sets the latest revision for each logical manifest the user has. Empty for legacy users.</summary>
- public List<ManifestRevision> ManifestRevisions { get; set; } = [];
-
- /// <summary>Gets or sets the latest revision for each data-bucket kind the user has. Empty when none stored.</summary>
- public List<BucketRevision> BucketRevisions { get; set; } = [];
-}
diff --git a/core/models/src/webapi/StatusResponseV2.ts b/core/models/src/webapi/StatusResponseV2.ts
index e16bbf1d6..a2547351b 100644
--- a/core/models/src/webapi/StatusResponseV2.ts
+++ b/core/models/src/webapi/StatusResponseV2.ts
@@ -8,7 +8,7 @@ export type ManifestRevision = {
}
/**
- * Status response type (v2). Returned by GET /v2/Auth/status.
+ * Status response type (v2).
*/
export type StatusResponseV2 = {
clientVersionSupported: boolean;