WIP add API Key authentication
This commit is contained in:
parent
005eea35e2
commit
3f1ab3eb12
5 changed files with 104 additions and 2 deletions
|
@ -1,10 +1,19 @@
|
|||
using Robware.Auth.API;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Robware.Data {
|
||||
public class ApiKeyRepository : IApiKeys {
|
||||
public Task<ApiKey> Get(string key) {
|
||||
throw new System.NotImplementedException();
|
||||
public async Task<ApiKey> Get(string key) {
|
||||
if (key=="denied")
|
||||
throw new ApiKeyNotFoundException(key);
|
||||
|
||||
return new ApiKey {
|
||||
Name = "Hardcoded key",
|
||||
Key = key,
|
||||
Enabled = true,
|
||||
IssueTimestamp = DateTime.Now
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue