mirror of
https://github.com/bitwarden/server.git
synced 2025-07-07 10:55:43 -05:00
upgrade identity server 4 to v4 (#842)
* upgrade identity server 4 to v4 * remove script ref
This commit is contained in:
@ -8,10 +8,9 @@ namespace Bit.Core.Repositories
|
||||
public interface IGrantRepository
|
||||
{
|
||||
Task<Grant> GetByKeyAsync(string key);
|
||||
Task<ICollection<Grant>> GetManyAsync(string subjectId);
|
||||
Task<ICollection<Grant>> GetManyAsync(string subjectId, string sessionId, string clientId, string type);
|
||||
Task SaveAsync(Grant obj);
|
||||
Task DeleteAsync(string key);
|
||||
Task DeleteAsync(string subjectId, string clientId);
|
||||
Task DeleteAsync(string subjectId, string clientId, string type);
|
||||
Task DeleteByKeyAsync(string key);
|
||||
Task DeleteManyAsync(string subjectId, string sessionId, string clientId, string type);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
@ -32,13 +31,14 @@ namespace Bit.Core.Repositories.SqlServer
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ICollection<Grant>> GetManyAsync(string subjectId)
|
||||
public async Task<ICollection<Grant>> GetManyAsync(string subjectId, string sessionId,
|
||||
string clientId, string type)
|
||||
{
|
||||
using (var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
var results = await connection.QueryAsync<Grant>(
|
||||
"[dbo].[Grant_ReadBySubjectId]",
|
||||
new { SubjectId = subjectId },
|
||||
"[dbo].[Grant_Read]",
|
||||
new { SubjectId = subjectId, SessionId = sessionId, ClientId = clientId, Type = type },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
|
||||
return results.ToList();
|
||||
@ -56,7 +56,7 @@ namespace Bit.Core.Repositories.SqlServer
|
||||
}
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(string key)
|
||||
public async Task DeleteByKeyAsync(string key)
|
||||
{
|
||||
using (var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
@ -67,24 +67,13 @@ namespace Bit.Core.Repositories.SqlServer
|
||||
}
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(string subjectId, string clientId)
|
||||
public async Task DeleteManyAsync(string subjectId, string sessionId, string clientId, string type)
|
||||
{
|
||||
using (var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
await connection.ExecuteAsync(
|
||||
"[dbo].[Grant_DeleteBySubjectIdClientId]",
|
||||
new { SubjectId = subjectId, ClientId = clientId },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(string subjectId, string clientId, string type)
|
||||
{
|
||||
using (var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
await connection.ExecuteAsync(
|
||||
"[dbo].[Grant_DeleteBySubjectIdClientIdType]",
|
||||
new { SubjectId = subjectId, ClientId = clientId, Type = type },
|
||||
"[dbo].[Grant_Delete]",
|
||||
new { SubjectId = subjectId, SessionId = sessionId, ClientId = clientId, Type = type },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user