aboutsummaryrefslogtreecommitdiff
path: root/docker/crupest-api/CrupestApi/CrupestApi.Secrets/ISecretsService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Secrets/ISecretsService.cs')
-rw-r--r--docker/crupest-api/CrupestApi/CrupestApi.Secrets/ISecretsService.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/docker/crupest-api/CrupestApi/CrupestApi.Secrets/ISecretsService.cs b/docker/crupest-api/CrupestApi/CrupestApi.Secrets/ISecretsService.cs
new file mode 100644
index 0000000..c42fbdc
--- /dev/null
+++ b/docker/crupest-api/CrupestApi/CrupestApi.Secrets/ISecretsService.cs
@@ -0,0 +1,21 @@
+namespace CrupestApi.Secrets;
+
+public interface ISecretsService
+{
+ Task<List<SecretInfo>> GetSecretListAsync(bool includeExpired = false, bool includeRevoked = false);
+
+ Task<List<SecretInfo>> GetSecretListByKeyAsync(string key, bool includeExpired = false, bool includeRevoked = false);
+
+ Task<bool> VerifySecretAsync(string key, string secret);
+
+ // Check if "secret" query param exists and is only one. Then check the secret is valid for given key.
+ // If check fails, will throw a VerifySecretException with proper message that can be send to client.
+ Task VerifySecretForHttpRequestAsync(HttpRequest request, string key, string queryKey = "secret");
+
+ Task<SecretInfo> CreateSecretAsync(string key, string description, DateTime? expireTime = null);
+
+ Task RevokeSecretAsync(string secret);
+
+ // Throw SecretNotExistException if request secret does not exist.
+ Task<SecretInfo> ModifySecretAsync(string secret, SecretModifyRequest modifyRequest);
+}