mirror of
https://github.com/bitwarden/server.git
synced 2026-04-12 11:43:51 -05:00
feat: add MasterPasswordSalt column to User table - Add MasterPasswordSalt column to User table in both Dapper and EF implementations - Update User stored procedures (Create, Update, UpdateMasterPassword) to handle salt column - Add EF migrations and update UserView with dependent views - Set MaxLength constraint on MasterPasswordSalt column - Update UserRepository implementations to manage salt field - Add comprehensive test coverage for salt handling and normalization
34 lines
946 B
Transact-SQL
34 lines
946 B
Transact-SQL
CREATE OR ALTER PROCEDURE [dbo].[User_UpdateMasterPassword]
|
|
@Id UNIQUEIDENTIFIER,
|
|
@MasterPassword NVARCHAR(300),
|
|
@MasterPasswordHint NVARCHAR(50) = NULL,
|
|
@Key VARCHAR(MAX),
|
|
@Kdf TINYINT,
|
|
@KdfIterations INT,
|
|
@KdfMemory INT = NULL,
|
|
@KdfParallelism INT = NULL,
|
|
@RevisionDate DATETIME2(7),
|
|
@AccountRevisionDate DATETIME2(7),
|
|
@MasterPasswordSalt NVARCHAR(256) = NULL -- NULL for backwards compat.
|
|
AS
|
|
BEGIN
|
|
SET NOCOUNT ON
|
|
|
|
UPDATE
|
|
[dbo].[User]
|
|
SET
|
|
[MasterPassword] = @MasterPassword,
|
|
[MasterPasswordHint] = @MasterPasswordHint,
|
|
[Key] = @Key,
|
|
[Kdf] = @Kdf,
|
|
[KdfIterations] = @KdfIterations,
|
|
[KdfMemory] = @KdfMemory,
|
|
[KdfParallelism] = @KdfParallelism,
|
|
[RevisionDate] = @RevisionDate,
|
|
[AccountRevisionDate] = @AccountRevisionDate,
|
|
[MasterPasswordSalt] = @MasterPasswordSalt
|
|
WHERE
|
|
[Id] = @Id
|
|
END
|
|
GO
|