Tests voor client api and service
This commit is contained in:
parent
cd2ec646fd
commit
3d73a9914c
12 changed files with 267 additions and 30 deletions
|
|
@ -34,14 +34,20 @@ public class ClientService(
|
|||
return client;
|
||||
}
|
||||
|
||||
public async Task<Client?> GetByClientId(string clientId, CancellationToken ct = default)
|
||||
public async Task<Client?> GetByClientId(
|
||||
Guid realmId,
|
||||
string clientId,
|
||||
CancellationToken ct = default)
|
||||
{
|
||||
return await db.Clients.FirstOrDefaultAsync(c => c.ClientId == clientId, ct);
|
||||
return await db.Clients.FirstOrDefaultAsync(c => c.ClientId == clientId && c.RealmId == realmId, ct);
|
||||
}
|
||||
|
||||
public async Task<Client?> FindById(int id, CancellationToken ct = default)
|
||||
public async Task<Client?> FindById(
|
||||
Guid realmId,
|
||||
int id,
|
||||
CancellationToken ct = default)
|
||||
{
|
||||
return await db.Clients.FirstOrDefaultAsync(c => c.Id == id, ct);
|
||||
return await db.Clients.FirstOrDefaultAsync(c => c.Id == id && c.RealmId == realmId, ct);
|
||||
}
|
||||
|
||||
private ClientSecret CreateSecret()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue