Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Update translations (#773)
Leendert de Borsta3427fb19597
diff --git a/apps/server/AliasVault.Client/Auth/Models/RegisterFormModel.cs b/apps/server/AliasVault.Client/Auth/Models/RegisterFormModel.csindex 78f84c000..51e1afed1 100644--- a/apps/server/AliasVault.Client/Auth/Models/RegisterFormModel.cs+++ b/apps/server/AliasVault.Client/Auth/Models/RegisterFormModel.cs@@ -8,6 +8,7 @@namespace AliasVault.Client.Auth.Models;using System.ComponentModel.DataAnnotations;+using AliasVault.Client.Main.Constants;using AliasVault.Client.Resources;using AliasVault.Shared.Models.Validation;@@ -26,7 +27,7 @@ public class RegisterFormModel/// Gets or sets the password./// </summary>[Required(ErrorMessageResourceType = typeof(ValidationMessages), ErrorMessageResourceName = nameof(ValidationMessages.PasswordRequired))]- [MinLength(8, ErrorMessageResourceType = typeof(ValidationMessages), ErrorMessageResourceName = nameof(ValidationMessages.PasswordMinLengthGeneric))]+ [MinimumPasswordLength(PasswordStrengthConstants.MinimumGoodPasswordLength, ErrorMessageResourceType = typeof(ValidationMessages), ErrorMessageResourceName = nameof(ValidationMessages.PasswordMinLengthGeneric))]public string Password { get; set; } = null!;/// <summary>diff --git a/apps/server/AliasVault.Client/Auth/Pages/Setup/Components/PasswordStep.razor b/apps/server/AliasVault.Client/Auth/Pages/Setup/Components/PasswordStep.razorindex 88e4902a2..3d63081e7 100644--- a/apps/server/AliasVault.Client/Auth/Pages/Setup/Components/PasswordStep.razor+++ b/apps/server/AliasVault.Client/Auth/Pages/Setup/Components/PasswordStep.razor@@ -161,7 +161,7 @@{if (Password.Length < PasswordStrengthConstants.MinimumGoodPasswordLength){- _errorMessage = Localizer["PasswordTooShortError"];+ _errorMessage = Localizer["PasswordTooShortError", PasswordStrengthConstants.MinimumGoodPasswordLength];await OnPasswordChange.InvokeAsync(string.Empty);StateHasChanged();return;diff --git a/apps/server/AliasVault.Client/Main/Models/Validation/PasswordChangeFormModel.cs b/apps/server/AliasVault.Client/Main/Models/Validation/PasswordChangeFormModel.csindex 7df3f8e92..2d3f8d5f3 100644--- a/apps/server/AliasVault.Client/Main/Models/Validation/PasswordChangeFormModel.cs+++ b/apps/server/AliasVault.Client/Main/Models/Validation/PasswordChangeFormModel.cs@@ -10,6 +10,7 @@ namespace AliasVault.Client.Main.Models.Validation;using System.ComponentModel.DataAnnotations;using AliasVault.Client.Main.Constants;using AliasVault.Client.Resources;+using AliasVault.Shared.Models.Validation;using AliasVault.Shared.Models.WebApi.PasswordChange;/// <summary>@@ -27,7 +28,7 @@ public class PasswordChangeFormModel : PasswordChangeModel/// Gets or sets the new password./// </summary>[Required(ErrorMessageResourceType = typeof(ValidationMessages), ErrorMessageResourceName = nameof(ValidationMessages.PasswordRequired))]- [MinLength(PasswordStrengthConstants.MinimumGoodPasswordLength, ErrorMessageResourceType = typeof(ValidationMessages), ErrorMessageResourceName = nameof(ValidationMessages.PasswordMinLength))]+ [MinimumPasswordLength(PasswordStrengthConstants.MinimumGoodPasswordLength, ErrorMessageResourceType = typeof(ValidationMessages), ErrorMessageResourceName = nameof(ValidationMessages.PasswordMinLength))]public new string NewPassword { get; set; } = null!;/// <summary>diff --git a/apps/server/AliasVault.Client/Main/Pages/Settings/Security/ChangePassword.razor b/apps/server/AliasVault.Client/Main/Pages/Settings/Security/ChangePassword.razorindex a9eb1657d..636b7f37b 100644--- a/apps/server/AliasVault.Client/Main/Pages/Settings/Security/ChangePassword.razor+++ b/apps/server/AliasVault.Client/Main/Pages/Settings/Security/ChangePassword.razor@@ -214,7 +214,7 @@ else// Validate password strength before proceedingif (PasswordStrengthIndicatorRef == null || !PasswordStrengthIndicatorRef.MeetsMinimumRequirement()){- PasswordStrengthError = Localizer["PasswordStrengthTooWeakError"];+ PasswordStrengthError = Localizer["PasswordStrengthTooWeakError", PasswordStrengthConstants.MinimumGoodPasswordLength];StateHasChanged();return;}diff --git a/apps/server/AliasVault.Client/Resources/Components/Auth/Setup/PasswordStep.en.resx b/apps/server/AliasVault.Client/Resources/Components/Auth/Setup/PasswordStep.en.resxindex f3e073403..6e90bef89 100644--- a/apps/server/AliasVault.Client/Resources/Components/Auth/Setup/PasswordStep.en.resx+++ b/apps/server/AliasVault.Client/Resources/Components/Auth/Setup/PasswordStep.en.resx@@ -65,8 +65,8 @@<comment>Success message for valid password</comment></data><data name="PasswordTooShortError">- <value>Master password must be at least 12 characters long.</value>- <comment>Error message for password too short</comment>+ <value>Master password must be at least {0} characters long.</value>+ <comment>Error message for password too short. {0} is the minimum password length.</comment></data><data name="ConfirmPasswordPrompt"><value>Confirm your password by entering it again.</value>diff --git a/apps/server/AliasVault.Client/Resources/Components/Main/Pages/Settings/Security/ChangePassword.en.resx b/apps/server/AliasVault.Client/Resources/Components/Main/Pages/Settings/Security/ChangePassword.en.resxindex fc1816a95..316f94e55 100644--- a/apps/server/AliasVault.Client/Resources/Components/Main/Pages/Settings/Security/ChangePassword.en.resx+++ b/apps/server/AliasVault.Client/Resources/Components/Main/Pages/Settings/Security/ChangePassword.en.resx@@ -117,7 +117,7 @@<comment>Error message when password change fails</comment></data><data name="PasswordStrengthTooWeakError" xml:space="preserve">- <value>Your new password must be at least 12 characters long.</value>- <comment>Error message when password strength is too weak</comment>+ <value>Your new password must be at least {0} characters long.</value>+ <comment>Error message when password strength is too weak. {0} is the minimum password length.</comment></data></root>\ No newline at end of filediff --git a/apps/server/AliasVault.Client/Resources/Components/Main/Settings/ImportExport/ImportServices.en.resx b/apps/server/AliasVault.Client/Resources/Components/Main/Settings/ImportExport/ImportServices.en.resxindex 157ab48d7..b6888e512 100644--- a/apps/server/AliasVault.Client/Resources/Components/Main/Settings/ImportExport/ImportServices.en.resx+++ b/apps/server/AliasVault.Client/Resources/Components/Main/Settings/ImportExport/ImportServices.en.resx@@ -230,19 +230,6 @@<value>Once you have exported the file, you can upload it below.</value><comment>Strongbox export instructions part 2</comment></data>- <!-- AliasVault .avux -->- <data name="AvuxDescription" xml:space="preserve">- <value>Import complete AliasVault backup (.avux format)</value>- <comment>Description for AliasVault .avux import service</comment>- </data>- <data name="AvuxInstructions" xml:space="preserve">- <value>Use this option to restore a complete vault backup including all items, folders, tags, passkeys, TOTP codes, and attachments from an .avux export file.</value>- <comment>AliasVault .avux import instructions</comment>- </data>- <data name="AvuxFormatTitle" xml:space="preserve">- <value>Complete Vault Backup:</value>- <comment>Title for .avux format explanation</comment>- </data><!-- AliasVault CSV/AVUX/AVEX --><data name="AliasVaultDescription" xml:space="preserve"><value>Import from AliasVault backup (.csv, .avux, or .avex)</value>@@ -256,14 +243,6 @@<value>Supports .avex (encrypted), .avux (unencrypted) and CSV (basic) formats.</value><comment>Supported formats information for AliasVault imports</comment></data>- <data name="DecryptImportTitle" xml:space="preserve">- <value>Enter Decryption Password</value>- <comment>Title for import password modal</comment>- </data>- <data name="IncorrectPasswordError" xml:space="preserve">- <value>Incorrect password. Please try again.</value>- <comment>Error message for incorrect decryption password</comment>- </data><!-- Dropbox --><data name="DropboxDescription" xml:space="preserve"><value>Import passwords from Dropbox Passwords</value>diff --git a/apps/server/AliasVault.Client/Resources/ValidationMessages.en.resx b/apps/server/AliasVault.Client/Resources/ValidationMessages.en.resxindex cc7efbe0a..86a55214a 100644--- a/apps/server/AliasVault.Client/Resources/ValidationMessages.en.resx+++ b/apps/server/AliasVault.Client/Resources/ValidationMessages.en.resx@@ -61,16 +61,16 @@<!-- Password validation messages --><data name="PasswordMinLength" xml:space="preserve">- <value>The new password must be at least 12 characters long.</value>- <comment>Error message for password minimum length validation</comment>+ <value>The new password must be at least {0} characters long.</value>+ <comment>Error message for password minimum length validation. {0} is the minimum password length.</comment></data><data name="PasswordsDoNotMatch" xml:space="preserve"><value>The new passwords do not match.</value><comment>Error message when password confirmation doesn't match</comment></data><data name="PasswordMinLengthGeneric" xml:space="preserve">- <value>Password must be at least 12 characters long.</value>- <comment>Generic error message for password minimum length validation</comment>+ <value>Password must be at least {0} characters long.</value>+ <comment>Generic error message for password minimum length validation. {0} is the minimum password length.</comment></data><data name="PasswordsDoNotMatchGeneric" xml:space="preserve"><value>Passwords do not match.</value>diff --git a/apps/server/Shared/AliasVault.Shared/Models/Validation/MinimumPasswordLengthAttribute.cs b/apps/server/Shared/AliasVault.Shared/Models/Validation/MinimumPasswordLengthAttribute.csnew file mode 100644index 000000000..f2e9d5ec7--- /dev/null+++ b/apps/server/Shared/AliasVault.Shared/Models/Validation/MinimumPasswordLengthAttribute.cs@@ -0,0 +1,58 @@+//-----------------------------------------------------------------------+// <copyright file="MinimumPasswordLengthAttribute.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.Validation;++using System.ComponentModel.DataAnnotations;++/// <summary>+/// Validation attribute to ensure that a password meets the minimum length requirement.+/// </summary>+[AttributeUsage(AttributeTargets.Property)]+public class MinimumPasswordLengthAttribute : ValidationAttribute+{+ /// <summary>+ /// Initializes a new instance of the <see cref="MinimumPasswordLengthAttribute"/> class.+ /// </summary>+ /// <param name="minimumLength">The minimum required password length.</param>+ public MinimumPasswordLengthAttribute(int minimumLength)+ {+ MinimumLength = minimumLength;+ }++ /// <summary>+ /// Gets the minimum required password length.+ /// </summary>+ public int MinimumLength { get; }++ /// <inheritdoc />+ public override bool IsValid(object? value)+ {+ if (value is not string password)+ {+ return false;+ }++ return password.Length >= MinimumLength;+ }++ /// <inheritdoc />+ protected override ValidationResult? IsValid(object? value, ValidationContext validationContext)+ {+ if (IsValid(value))+ {+ return ValidationResult.Success;+ }++ // Format the error message with the minimum password length+ var errorMessage = string.Format(+ ErrorMessage ?? "Password must be at least {0} characters long.",+ MinimumLength);++ return new ValidationResult(errorMessage);+ }+}