aboutsummaryrefslogtreecommitdiff
path: root/docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs')
-rw-r--r--docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs
new file mode 100644
index 0000000..fc13707
--- /dev/null
+++ b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs
@@ -0,0 +1,20 @@
+using CrupestApi.Commons;
+using CrupestApi.Commons.Crud;
+
+namespace CrupestApi.Commons.Secrets;
+
+public class SecretService : CrudService<SecretInfo>, ISecretService
+{
+ public SecretService(ITableInfoFactory tableInfoFactory, IDbConnectionFactory dbConnectionFactory, EntityJsonHelper<SecretInfo> jsonHelper, ILoggerFactory loggerFactory)
+ : base(tableInfoFactory, dbConnectionFactory, jsonHelper, loggerFactory)
+ {
+
+ }
+
+ public List<string> GetPermissions(string secret)
+ {
+ var list = _table.Select<SecretInfo>(_dbConnection,
+ where: WhereClause.Create().Eq(nameof(SecretInfo.Secret), secret));
+ return list.Select(x => x.Key).ToList();
+ }
+}