1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-08 12:10:30 -05:00

Rename UserSigningKeys table to UserSigningKey

This commit is contained in:
Bernd Schoolmann 2025-06-02 14:54:15 +02:00
parent 20999391b3
commit cd0e94b6d2
No known key found for this signature in database
6 changed files with 17 additions and 17 deletions

View File

@ -28,7 +28,7 @@ public class UserSigningKeysRepository : Repository<UserSigningKeys, Guid>, IUse
using (var connection = new SqlConnection(ConnectionString)) using (var connection = new SqlConnection(ConnectionString))
{ {
return await connection.QuerySingleOrDefaultAsync<SigningKeyData>( return await connection.QuerySingleOrDefaultAsync<SigningKeyData>(
"[dbo].[UserSigningKeys_ReadByUserId]", "[dbo].[UserSigningKey_ReadByUserId]",
new new
{ {
UserId = userId UserId = userId
@ -42,7 +42,7 @@ public class UserSigningKeysRepository : Repository<UserSigningKeys, Guid>, IUse
return async (SqlConnection connection, SqlTransaction transaction) => return async (SqlConnection connection, SqlTransaction transaction) =>
{ {
await connection.QueryAsync( await connection.QueryAsync(
"[dbo].[UserSigningKeys_SetForRotation]", "[dbo].[UserSigningKey_SetForRotation]",
new new
{ {
Id = Guid.NewGuid(), Id = Guid.NewGuid(),
@ -63,7 +63,7 @@ public class UserSigningKeysRepository : Repository<UserSigningKeys, Guid>, IUse
return async (SqlConnection connection, SqlTransaction transaction) => return async (SqlConnection connection, SqlTransaction transaction) =>
{ {
await connection.QueryAsync( await connection.QueryAsync(
"[dbo].[UserSigningKeys_UpdateForRotation]", "[dbo].[UserSigningKey_UpdateForRotation]",
new new
{ {
UserId = grantorId, UserId = grantorId,

View File

@ -1,8 +1,8 @@
CREATE PROCEDURE [dbo].[UserSigningKeys_ReadByUserId] CREATE PROCEDURE [dbo].[UserSigningKey_ReadByUserId]
@UserId UNIQUEIDENTIFIER @UserId UNIQUEIDENTIFIER
AS AS
BEGIN BEGIN
SELECT * SELECT *
FROM [dbo].[UserSigningKeys] FROM [dbo].[UserSigningKey]
WHERE [UserId] = @UserId; WHERE [UserId] = @UserId;
END END

View File

@ -1,4 +1,4 @@
CREATE PROCEDURE [dbo].[UserSigningKeys_UpdateForRotation] CREATE PROCEDURE [dbo].[UserSigningKey_UpdateForRotation]
@UserId UNIQUEIDENTIFIER, @UserId UNIQUEIDENTIFIER,
@KeyType TINYINT, @KeyType TINYINT,
@VerifyingKey VARCHAR(MAX), @VerifyingKey VARCHAR(MAX),
@ -6,7 +6,7 @@ CREATE PROCEDURE [dbo].[UserSigningKeys_UpdateForRotation]
@RevisionDate DATETIME2(7) @RevisionDate DATETIME2(7)
AS AS
BEGIN BEGIN
UPDATE [dbo].[UserSigningKeys] UPDATE [dbo].[UserSigningKey]
SET [KeyType] = @KeyType, SET [KeyType] = @KeyType,
[VerifyingKey] = @VerifyingKey, [VerifyingKey] = @VerifyingKey,
[SigningKey] = @SigningKey, [SigningKey] = @SigningKey,

View File

@ -1,4 +1,4 @@
CREATE PROCEDURE [dbo].[UserSigningKeys_SetForRotation] CREATE PROCEDURE [dbo].[UserSigningKey_SetForRotation]
@Id UNIQUEIDENTIFIER, @Id UNIQUEIDENTIFIER,
@UserId UNIQUEIDENTIFIER, @UserId UNIQUEIDENTIFIER,
@KeyType TINYINT, @KeyType TINYINT,
@ -8,6 +8,6 @@ CREATE PROCEDURE [dbo].[UserSigningKeys_SetForRotation]
@RevisionDate DATETIME2(7) @RevisionDate DATETIME2(7)
AS AS
BEGIN BEGIN
INSERT INTO [dbo].[UserSigningKeys] ([Id], [UserId], [KeyType], [VerifyingKey], [SigningKey], [CreationDate], [RevisionDate]) INSERT INTO [dbo].[UserSigningKey] ([Id], [UserId], [KeyType], [VerifyingKey], [SigningKey], [CreationDate], [RevisionDate])
VALUES (@Id, @UserId, @KeyType, @VerifyingKey, @SigningKey, @CreationDate, @RevisionDate) VALUES (@Id, @UserId, @KeyType, @VerifyingKey, @SigningKey, @CreationDate, @RevisionDate)
END END

View File

@ -1,4 +1,4 @@
CREATE TABLE [dbo].[UserSigningKeys] ( CREATE TABLE [dbo].[UserSigningKey] (
[Id] UNIQUEIDENTIFIER NOT NULL, [Id] UNIQUEIDENTIFIER NOT NULL,
[UserId] UNIQUEIDENTIFIER, [UserId] UNIQUEIDENTIFIER,
[KeyType] TINYINT NOT NULL, [KeyType] TINYINT NOT NULL,

View File

@ -1,4 +1,4 @@
CREATE TABLE [dbo].[UserSigningKeys] ( CREATE TABLE [dbo].[UserSigningKey] (
[Id] UNIQUEIDENTIFIER NOT NULL, [Id] UNIQUEIDENTIFIER NOT NULL,
[UserId] UNIQUEIDENTIFIER, [UserId] UNIQUEIDENTIFIER,
[KeyType] TINYINT NOT NULL, [KeyType] TINYINT NOT NULL,
@ -11,17 +11,17 @@ CREATE TABLE [dbo].[UserSigningKeys] (
); );
GO GO
CREATE PROCEDURE [dbo].[UserSigningKeys_ReadByUserId] CREATE PROCEDURE [dbo].[UserSigningKey_ReadByUserId]
@UserId UNIQUEIDENTIFIER @UserId UNIQUEIDENTIFIER
AS AS
BEGIN BEGIN
SELECT * SELECT *
FROM [dbo].[UserSigningKeys] FROM [dbo].[UserSigningKey]
WHERE [UserId] = @UserId; WHERE [UserId] = @UserId;
END END
GO GO
CREATE PROCEDURE [dbo].[UserSigningKeys_UpdateForRotation] CREATE PROCEDURE [dbo].[UserSigningKey_UpdateForRotation]
@UserId UNIQUEIDENTIFIER, @UserId UNIQUEIDENTIFIER,
@KeyType TINYINT, @KeyType TINYINT,
@VerifyingKey VARCHAR(MAX), @VerifyingKey VARCHAR(MAX),
@ -29,7 +29,7 @@ CREATE PROCEDURE [dbo].[UserSigningKeys_UpdateForRotation]
@RevisionDate DATETIME2(7) @RevisionDate DATETIME2(7)
AS AS
BEGIN BEGIN
UPDATE [dbo].[UserSigningKeys] UPDATE [dbo].[UserSigningKey]
SET [KeyType] = @KeyType, SET [KeyType] = @KeyType,
[VerifyingKey] = @VerifyingKey, [VerifyingKey] = @VerifyingKey,
[SigningKey] = @SigningKey, [SigningKey] = @SigningKey,
@ -38,7 +38,7 @@ BEGIN
END END
GO GO
CREATE PROCEDURE [dbo].[UserSigningKeys_SetForRotation] CREATE PROCEDURE [dbo].[UserSigningKey_SetForRotation]
@Id UNIQUEIDENTIFIER, @Id UNIQUEIDENTIFIER,
@UserId UNIQUEIDENTIFIER, @UserId UNIQUEIDENTIFIER,
@KeyType TINYINT, @KeyType TINYINT,
@ -48,7 +48,7 @@ CREATE PROCEDURE [dbo].[UserSigningKeys_SetForRotation]
@RevisionDate DATETIME2(7) @RevisionDate DATETIME2(7)
AS AS
BEGIN BEGIN
INSERT INTO [dbo].[UserSigningKeys] ([Id], [UserId], [KeyType], [VerifyingKey], [SigningKey], [CreationDate], [RevisionDate]) INSERT INTO [dbo].[UserSigningKey] ([Id], [UserId], [KeyType], [VerifyingKey], [SigningKey], [CreationDate], [RevisionDate])
VALUES (@Id, @UserId, @KeyType, @VerifyingKey, @SigningKey, @CreationDate, @RevisionDate) VALUES (@Id, @UserId, @KeyType, @VerifyingKey, @SigningKey, @CreationDate, @RevisionDate)
END END
GO GO