Files
server/util/Migrator/DbScripts/2026-03-16_01_AlterReadManyAccountRecoveryDetailsByOrganizationUserIds.sql
Ike 1bc5f4ec1e [PM-21926] [PM-30350] [PM-32389] Read salt from database (#7230)
feat: add MasterPasswordSalt to database responses and DTOs

- Add Dapper migration scripts and update SQL project
- Include MasterPasswordSalt in database response models and DTOs
- Add null coalescing to User entity for MasterPasswordSalt
- Update EF queries to return MasterPasswordSalt
- Rename migrations for consistency
- Add test coverage for affected repositories
- Update EmergencyAccessTakeOverResponseModel tests
2026-03-18 16:18:16 -04:00

29 lines
812 B
Transact-SQL

CREATE OR ALTER PROCEDURE [dbo].[OrganizationUser_ReadManyAccountRecoveryDetailsByOrganizationUserIds]
@OrganizationId UNIQUEIDENTIFIER,
@OrganizationUserIds AS [dbo].[GuidIdArray] READONLY
AS
BEGIN
SET NOCOUNT ON
SELECT
OU.[Id] AS OrganizationUserId,
U.[Kdf],
U.[KdfIterations],
U.[KdfMemory],
U.[KdfParallelism],
U.[MasterPasswordSalt],
OU.[ResetPasswordKey],
O.[PrivateKey] AS EncryptedPrivateKey
FROM
@OrganizationUserIds AS OUIDs
INNER JOIN
[dbo].[OrganizationUser] AS OU ON OUIDs.[Id] = OU.[Id]
INNER JOIN
[dbo].[Organization] AS O ON OU.[OrganizationId] = O.[Id]
INNER JOIN
[dbo].[User] U ON U.[Id] = OU.[UserId]
WHERE
OU.[OrganizationId] = @OrganizationId
END
GO