api.auth/src/Robware.Data/ApiKeyRepository.cs

19 lines
No EOL
389 B
C#

using Robware.Auth.API;
using System;
using System.Threading.Tasks;
namespace Robware.Data {
public class ApiKeyRepository : IApiKeys {
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
};
}
}
}