summaryrefslogtreecommitdiff
path: root/src/marlin.web/Models
diff options
context:
space:
mode:
Diffstat (limited to 'src/marlin.web/Models')
-rw-r--r--src/marlin.web/Models/DatabaseSourceSecretStore.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/marlin.web/Models/DatabaseSourceSecretStore.cs b/src/marlin.web/Models/DatabaseSourceSecretStore.cs
new file mode 100644
index 0000000..b4ca61f
--- /dev/null
+++ b/src/marlin.web/Models/DatabaseSourceSecretStore.cs
@@ -0,0 +1,27 @@
+namespace marlin.web.Models;
+
+using core.models;
+using Data;
+using Microsoft.EntityFrameworkCore;
+
+public class DatabaseSourceSecretStore(ApplicationDbContext dbContext) : ISourceSecretStore
+{
+ public async Task<ISecret?> GetAsync(Guid id, CancellationToken ct)
+ {
+ return await dbContext.Secrets
+ .FirstOrDefaultAsync(x => x.Id == id, cancellationToken: ct);
+ }
+}
+
+public class VersionControlSecret : ISecret
+{
+ public Guid Id { get; set; }
+
+ public Guid SourceId { get; set; }
+ public VersionControlSource Source { get; set; }
+
+ public bool MayReveal { get; set; }
+ public string? Kind { get; set; }
+ public string Label { get; set; }
+ public Dictionary<string, string> Content { get; set; }
+} \ No newline at end of file