From 879fb614c6853ab3bb83155c82722afb2933fc60 Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 2 Dec 2022 11:04:34 +0800 Subject: ... --- .../CrupestApi.Secrets/ISecretsService.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 docker/crupest-api/CrupestApi/CrupestApi.Secrets/ISecretsService.cs (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Secrets/ISecretsService.cs') 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> GetSecretListAsync(bool includeExpired = false, bool includeRevoked = false); + + Task> GetSecretListByKeyAsync(string key, bool includeExpired = false, bool includeRevoked = false); + + Task 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 CreateSecretAsync(string key, string description, DateTime? expireTime = null); + + Task RevokeSecretAsync(string secret); + + // Throw SecretNotExistException if request secret does not exist. + Task ModifySecretAsync(string secret, SecretModifyRequest modifyRequest); +} -- cgit v1.2.3