refactor(Verbraucher): Getrennte ID und Name hinzugefügt.
This commit is contained in:
parent
8b5c477b2b
commit
79e3dbd5d8
@ -1,4 +1,4 @@
|
||||
namespace DigitalData.Auth.API.Dto
|
||||
{
|
||||
public record ConsumerLogin(string Id, string Password);
|
||||
public record ConsumerLogin(string Name, string Password);
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
namespace DigitalData.Auth.API.Entities
|
||||
{
|
||||
public record Consumer(string Id, string Password, string Audience);
|
||||
public record Consumer(int Id, string Name, string Password, string Audience);
|
||||
}
|
||||
@ -17,8 +17,10 @@ namespace DigitalData.Auth.API.Services
|
||||
_authApiParams = authApiParamOptions.Value;
|
||||
}
|
||||
|
||||
public Task<Consumer?> ReadByIdAsync(string id) => Task.Run(() => _consumers.FirstOrDefault(api => api.Id == id));
|
||||
public Task<Consumer?> ReadByIdAsync(int id) => Task.Run(() => _consumers.FirstOrDefault(api => api.Id == id));
|
||||
|
||||
public async Task<bool> VerifyAsync(string id, string password) => (await ReadByIdAsync(id))?.Password == password;
|
||||
public Task<Consumer?> ReadByNameAsync(string name) => Task.Run(() => _consumers.FirstOrDefault(api => api.Name == name));
|
||||
|
||||
public async Task<bool> VerifyAsync(string name, string password) => (await ReadByNameAsync(name))?.Password == password;
|
||||
}
|
||||
}
|
||||
@ -4,8 +4,10 @@ namespace DigitalData.Auth.API.Services.Contracts
|
||||
{
|
||||
public interface IConsumerService
|
||||
{
|
||||
public Task<Consumer?> ReadByIdAsync(string id);
|
||||
public Task<Consumer?> ReadByIdAsync(int id);
|
||||
|
||||
public Task<bool> VerifyAsync(string id, string password);
|
||||
public Task<Consumer?> ReadByNameAsync(string name);
|
||||
|
||||
public Task<bool> VerifyAsync(string name, string password);
|
||||
}
|
||||
}
|
||||
@ -1,17 +1,20 @@
|
||||
{
|
||||
"Consumers": [
|
||||
{
|
||||
"Id": "auth",
|
||||
"Id": 0,
|
||||
"Name": "auth-flow",
|
||||
"Audience": "auth.digitaldata.works",
|
||||
"Password": "aQ9z!2@TgY7b#fHcD3pLmV1$wX"
|
||||
},
|
||||
{
|
||||
"Id": "work-flow",
|
||||
"Id": 1,
|
||||
"Name": "work-flow",
|
||||
"Audience": "work-flow.digitaldata.works",
|
||||
"Password": "t3B|aiJ'i-snLzNRj3B{9=&:lM5P@'iL"
|
||||
},
|
||||
{
|
||||
"Id": "user-manager",
|
||||
"Id": 2,
|
||||
"Name": "user-manager",
|
||||
"Audience": "user-manager.digitaldata.works",
|
||||
"Password": "a098Hvu1-y29ep{KPQO]#>8TK+fk{O`_d"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user