Browse Source
* [PM-131] Remove fingerprint (#2759) * [PM-107][PM-131] Remove fingerprint property from auth request * [PM-107][PM-131] Remove fingerprint property from comparer * [PM-132] Drop fingerprint phrase (#2803) * [PM-132] Added migrations to remove fingerprint phrase from db * [PM-132] Remove fp from stored procedurespull/2829/head
14 changed files with 4781 additions and 225 deletions
@ -0,0 +1,140 @@
@@ -0,0 +1,140 @@
|
||||
-- Description: Remove RequestFingerprint column from AuthRequest table and recreate view and stored procedures without it. |
||||
IF COL_LENGTH('[dbo].[AuthRequest]', 'RequestFingerprint') IS NOT NULL |
||||
BEGIN |
||||
ALTER TABLE |
||||
[dbo].[AuthRequest] |
||||
DROP COLUMN |
||||
[RequestFingerprint] |
||||
END |
||||
GO |
||||
|
||||
-- Drop and recreate view |
||||
IF EXISTS(SELECT * FROM sys.views WHERE [Name] = 'AuthRequestView') |
||||
BEGIN |
||||
DROP VIEW [dbo].[AuthRequestView] |
||||
END |
||||
GO |
||||
|
||||
CREATE VIEW [dbo].[AuthRequestView] |
||||
AS |
||||
SELECT |
||||
* |
||||
FROM |
||||
[dbo].[AuthRequest] |
||||
GO |
||||
|
||||
--Drop existing SPROC |
||||
IF OBJECT_ID('[dbo].[AuthRequest_Update]') IS NOT NULL |
||||
BEGIN |
||||
DROP PROCEDURE [dbo].[AuthRequest_Update] |
||||
END |
||||
GO |
||||
|
||||
--Create SPROC without RequestFingerprint column |
||||
CREATE PROCEDURE [dbo].[AuthRequest_Update] |
||||
@Id UNIQUEIDENTIFIER OUTPUT, |
||||
@UserId UNIQUEIDENTIFIER, |
||||
@Type SMALLINT, |
||||
@RequestDeviceIdentifier NVARCHAR(50), |
||||
@RequestDeviceType SMALLINT, |
||||
@RequestIpAddress VARCHAR(50), |
||||
@ResponseDeviceId UNIQUEIDENTIFIER, |
||||
@AccessCode VARCHAR(25), |
||||
@PublicKey VARCHAR(MAX), |
||||
@Key VARCHAR(MAX), |
||||
@MasterPasswordHash VARCHAR(MAX), |
||||
@Approved BIT, |
||||
@CreationDate DATETIME2 (7), |
||||
@ResponseDate DATETIME2 (7), |
||||
@AuthenticationDate DATETIME2 (7) |
||||
AS |
||||
BEGIN |
||||
SET NOCOUNT ON |
||||
|
||||
UPDATE |
||||
[dbo].[AuthRequest] |
||||
SET |
||||
[UserId] = @UserId, |
||||
[Type] = @Type, |
||||
[RequestDeviceIdentifier] = @RequestDeviceIdentifier, |
||||
[RequestDeviceType] = @RequestDeviceType, |
||||
[RequestIpAddress] = @RequestIpAddress, |
||||
[ResponseDeviceId] = @ResponseDeviceId, |
||||
[AccessCode] = @AccessCode, |
||||
[PublicKey] = @PublicKey, |
||||
[Key] = @Key, |
||||
[MasterPasswordHash] = @MasterPasswordHash, |
||||
[Approved] = @Approved, |
||||
[CreationDate] = @CreationDate, |
||||
[ResponseDate] = @ResponseDate, |
||||
[AuthenticationDate] = @AuthenticationDate |
||||
WHERE |
||||
[Id] = @Id |
||||
END |
||||
GO |
||||
|
||||
--Drop existing SPROC |
||||
IF OBJECT_ID('[dbo].[AuthRequest_Create]') IS NOT NULL |
||||
BEGIN |
||||
DROP PROCEDURE [dbo].[AuthRequest_Create] |
||||
END |
||||
GO |
||||
|
||||
--Create SPROC without RequestFingerprint column |
||||
CREATE PROCEDURE [dbo].[AuthRequest_Create] |
||||
@Id UNIQUEIDENTIFIER OUTPUT, |
||||
@UserId UNIQUEIDENTIFIER, |
||||
@Type TINYINT, |
||||
@RequestDeviceIdentifier NVARCHAR(50), |
||||
@RequestDeviceType TINYINT, |
||||
@RequestIpAddress VARCHAR(50), |
||||
@ResponseDeviceId UNIQUEIDENTIFIER, |
||||
@AccessCode VARCHAR(25), |
||||
@PublicKey VARCHAR(MAX), |
||||
@Key VARCHAR(MAX), |
||||
@MasterPasswordHash VARCHAR(MAX), |
||||
@Approved BIT, |
||||
@CreationDate DATETIME2(7), |
||||
@ResponseDate DATETIME2(7), |
||||
@AuthenticationDate DATETIME2(7) |
||||
AS |
||||
BEGIN |
||||
SET NOCOUNT ON |
||||
|
||||
INSERT INTO [dbo].[AuthRequest] |
||||
( |
||||
[Id], |
||||
[UserId], |
||||
[Type], |
||||
[RequestDeviceIdentifier], |
||||
[RequestDeviceType], |
||||
[RequestIpAddress], |
||||
[ResponseDeviceId], |
||||
[AccessCode], |
||||
[PublicKey], |
||||
[Key], |
||||
[MasterPasswordHash], |
||||
[Approved], |
||||
[CreationDate], |
||||
[ResponseDate], |
||||
[AuthenticationDate] |
||||
) |
||||
VALUES |
||||
( |
||||
@Id, |
||||
@UserId, |
||||
@Type, |
||||
@RequestDeviceIdentifier, |
||||
@RequestDeviceType, |
||||
@RequestIpAddress, |
||||
@ResponseDeviceId, |
||||
@AccessCode, |
||||
@PublicKey, |
||||
@Key, |
||||
@MasterPasswordHash, |
||||
@Approved, |
||||
@CreationDate, |
||||
@ResponseDate, |
||||
@AuthenticationDate |
||||
) |
||||
END |
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,24 @@
@@ -0,0 +1,24 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
#nullable disable |
||||
|
||||
namespace Bit.PostgresMigrations.Migrations; |
||||
|
||||
public partial class AuthRequestRemoveFingerprintPhrase : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropColumn( |
||||
name: "RequestFingerprint", |
||||
table: "AuthRequest"); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<string>( |
||||
name: "RequestFingerprint", |
||||
table: "AuthRequest", |
||||
type: "text", |
||||
nullable: true); |
||||
} |
||||
} |
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,24 @@
@@ -0,0 +1,24 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
#nullable disable |
||||
|
||||
namespace Bit.SqliteMigrations.Migrations; |
||||
|
||||
public partial class AuthRequestRemoveFingerprintPhrase : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropColumn( |
||||
name: "RequestFingerprint", |
||||
table: "AuthRequest"); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<string>( |
||||
name: "RequestFingerprint", |
||||
table: "AuthRequest", |
||||
type: "TEXT", |
||||
nullable: true); |
||||
} |
||||
} |
||||
Loading…
Reference in new issue