From 8151747b669486d6caa4753ea13b58036dc0a080 Mon Sep 17 00:00:00 2001 From: "DESKTOP-T0O5CDB\\DESK-555BD" Date: Fri, 23 Jan 2026 22:13:06 -0700 Subject: [PATCH] apiKey stuff --- External/Interfaces/IApiKeyRecordDataAccess.cs | 13 +++++++++++++ Models/API/APIKey.cs | 11 +++++++++++ 2 files changed, 24 insertions(+) create mode 100644 External/Interfaces/IApiKeyRecordDataAccess.cs create mode 100644 Models/API/APIKey.cs diff --git a/External/Interfaces/IApiKeyRecordDataAccess.cs b/External/Interfaces/IApiKeyRecordDataAccess.cs new file mode 100644 index 0000000..6ae8b88 --- /dev/null +++ b/External/Interfaces/IApiKeyRecordDataAccess.cs @@ -0,0 +1,13 @@ +using CarCareTracker.Models; + +namespace CarCareTracker.External.Interfaces +{ + public interface IApiKeyRecordDataAccess + { + public List GetAPIKeyRecordsByUserId(int userId); + public APIKey GetAPIKeyById(int apiKeyId); + public APIKey GetAPIKeyByKey(string hashedKey); + public bool CreateNewAPIKey(APIKey apiKey); + public bool DeleteAPIKey(int apiKeyId); + } +} \ No newline at end of file diff --git a/Models/API/APIKey.cs b/Models/API/APIKey.cs new file mode 100644 index 0000000..a269f30 --- /dev/null +++ b/Models/API/APIKey.cs @@ -0,0 +1,11 @@ +namespace CarCareTracker.Models +{ + public class APIKey + { + public int Id { get; set; } + public int UserId { get; set; } + public string Name { get; set; } + public string Key { get; set; } + public List Permissions { get; set; } = new List(); + } +} \ No newline at end of file