1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -05:00

Merge branch 'master' into feature/flexible-collections

This commit is contained in:
Vincent Salucci
2023-08-30 15:16:01 -05:00
70 changed files with 1252 additions and 466 deletions

View File

@ -0,0 +1,27 @@
CREATE OR ALTER PROCEDURE [dbo].[Organization_ReadAbilities]
AS
BEGIN
SET NOCOUNT ON
SELECT
[Id],
[UseEvents],
[Use2fa],
CASE
WHEN [Use2fa] = 1 AND [TwoFactorProviders] IS NOT NULL AND [TwoFactorProviders] != '{}' THEN
1
ELSE
0
END AS [Using2fa],
[UsersGetPremium],
[UseCustomPermissions],
[UseSso],
[UseKeyConnector],
[UseScim],
[UseResetPassword],
[UsePolicies],
[Enabled]
FROM
[dbo].[Organization]
END
GO

View File

@ -1,7 +1,7 @@
/*
This is the data migration script for the client secret hash updates.
The initial migration util/Migrator/DbScripts/2023-05-16_00_ClientSecretHash.sql should be run prior.
The final migration is in util/Migrator/DbScripts_future/2023-06-FutureMigration.sql.
The final migration is in util/Migrator/DbScripts/2023-08-10_01_RemoveClientSecret
*/
IF COL_LENGTH('[dbo].[ApiKey]', 'ClientSecretHash') IS NOT NULL AND COL_LENGTH('[dbo].[ApiKey]', 'ClientSecret') IS NOT NULL
BEGIN
@ -9,7 +9,7 @@ BEGIN
-- Add index
IF NOT EXISTS(SELECT name FROM sys.indexes WHERE name = 'IX_ApiKey_ClientSecretHash')
BEGIN
CREATE NONCLUSTERED INDEX [IX_ApiKey_ClientSecretHash]
CREATE NONCLUSTERED INDEX [IX_ApiKey_ClientSecretHash]
ON [dbo].[ApiKey]([ClientSecretHash] ASC)
WITH (ONLINE = ON)
END
@ -30,7 +30,7 @@ BEGIN
WHERE [ClientSecretHash] IS NULL
SET @BatchSize = @@ROWCOUNT
COMMIT TRANSACTION Migrate_ClientSecretHash
END

View File

@ -36,7 +36,7 @@ AS
BEGIN
SET NOCOUNT ON
INSERT INTO [dbo].[ApiKey]
INSERT INTO [dbo].[ApiKey]
(
[Id],
[ServiceAccountId],
@ -49,7 +49,7 @@ BEGIN
[CreationDate],
[RevisionDate]
)
VALUES
VALUES
(
@Id,
@ServiceAccountId,