aboutsummaryrefslogtreecommitdiff
path: root/lib/VNLib.Plugins.Extensions.Loading/src/Secrets/IKvVaultClient.cs
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-05-22 15:28:54 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2024-05-22 15:28:54 -0400
commit1350c983c371fdd6a93596c8474345f9168284e1 (patch)
tree7c6f1815d9a01bec4a97c2f53c3ec0f608222b45 /lib/VNLib.Plugins.Extensions.Loading/src/Secrets/IKvVaultClient.cs
parent5ad520e078414ca26f6144da0aab4e975347a121 (diff)
Squashed commit of the following:
commit 27fb5382d80d9bcfb4c65974bbae20c5e7b8ccbc Author: vnugent <public@vaughnnugent.com> Date: Wed May 22 00:57:34 2024 -0400 feat: Vault environment vars commit 69f13e43dfdd8069459800ccc3039f45fc884814 Author: vnugent <public@vaughnnugent.com> Date: Wed May 15 22:04:43 2024 -0400 fix: #3 Defer vault loading until a secret actually needs it commit c848787d4830a73e9ba93898897282be2f3752f2 Author: vnugent <public@vaughnnugent.com> Date: Wed May 15 22:02:02 2024 -0400 package updates commit 21c6c85f540740ac29536a7091346a731aa85148 Author: vnugent <public@vaughnnugent.com> Date: Wed May 15 22:01:16 2024 -0400 fix: #3 Error raised when managed password type disposed commit 8e77289041349b16536497f48f0c0a4ec6fe30f5 Author: vnugent <public@vaughnnugent.com> Date: Thu May 2 15:44:42 2024 -0400 feat: #2 Middleware helpers, proj cleanup, fix sync secrets, vault client commit e0a5c85297516188e57b54d9b530b2482cb03eb0 Merge: a977dab 5ad520e Author: vnugent <public@vaughnnugent.com> Date: Sat Apr 27 17:44:09 2024 -0400 Merge branch 'master' into develop commit a977dabef1dec915e00f755cb3ee3363aa9985f1 Author: vnugent <public@vaughnnugent.com> Date: Sat Apr 27 17:26:35 2024 -0400 chore: package updates commit a2e2c3c4152d000b8df25c3c3fee14d491aab2c6 Merge: f03b727 87bfa83 Author: vnugent <public@vaughnnugent.com> Date: Sat Apr 20 12:11:45 2024 -0400 Merge branch 'master' into develop commit f03b727d8f8e52f1dbd6293ea5c5a492c6d8e2da Author: vnugent <public@vaughnnugent.com> Date: Sat Apr 20 12:02:07 2024 -0400 chore: Package updates
Diffstat (limited to 'lib/VNLib.Plugins.Extensions.Loading/src/Secrets/IKvVaultClient.cs')
-rw-r--r--lib/VNLib.Plugins.Extensions.Loading/src/Secrets/IKvVaultClient.cs64
1 files changed, 64 insertions, 0 deletions
diff --git a/lib/VNLib.Plugins.Extensions.Loading/src/Secrets/IKvVaultClient.cs b/lib/VNLib.Plugins.Extensions.Loading/src/Secrets/IKvVaultClient.cs
new file mode 100644
index 0000000..77579ef
--- /dev/null
+++ b/lib/VNLib.Plugins.Extensions.Loading/src/Secrets/IKvVaultClient.cs
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2024 Vaughn Nugent
+*
+* Library: VNLib
+* Package: VNLib.Plugins.Extensions.Loading
+* File: IKvVaultClient.cs
+*
+* IKvVaultClient.cs is part of VNLib.Plugins.Extensions.Loading which is
+* part of the larger VNLib collection of libraries and utilities.
+*
+* VNLib.Plugins.Extensions.Loading is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Affero General Public License as
+* published by the Free Software Foundation, either version 3 of the
+* License, or (at your option) any later version.
+*
+* VNLib.Plugins.Extensions.Loading is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Affero General Public License for more details.
+*
+* You should have received a copy of the GNU Affero General Public License
+* along with this program. If not, see https://www.gnu.org/licenses/.
+*/
+
+using System;
+using System.Net.Http;
+using System.Threading.Tasks;
+
+namespace VNLib.Plugins.Extensions.Loading
+{
+ /// <summary>
+ /// A secret client interace for reading secrets from a vault server
+ /// </summary>
+ public interface IKvVaultClient
+ {
+ /// <summary>
+ /// Reads a single KeyValue secret from the vault server asyncrhonously and returns the result
+ /// or null if the secret does not exist
+ /// </summary>
+ /// <param name="path">The path to the item within the store</param>
+ /// <param name="mountPoint">The vault mount points</param>
+ /// <param name="secretName">The name of the secret within the property array to retrieve</param>
+ /// <returns>The secret wrapper if found, null otherwise</returns>
+ /// <exception cref="ArgumentException"></exception>
+ /// <exception cref="ArgumentNullException"></exception>
+ /// <exception cref="HCVaultException"></exception>
+ /// <exception cref="HttpRequestException"></exception>
+ Task<ISecretResult?> ReadSecretAsync(string path, string mountPoint, string secretName);
+
+ /// <summary>
+ /// Reads a single KeyValue secret from the vault server syncrhonously and returns the result
+ /// or null if the secret does not exist
+ /// </summary>
+ /// <param name="path">The path to the item within the store</param>
+ /// <param name="mountPoint">The vault mount points</param>
+ /// <param name="secretName">The name of the secret within the property array to retrieve</param>
+ /// <returns>The secret wrapper if found, null otherwise</returns>
+ /// <exception cref="ArgumentException"></exception>
+ /// <exception cref="ArgumentNullException"></exception>
+ /// <exception cref="HCVaultException"></exception>
+ /// <exception cref="HttpRequestException"></exception>
+ ISecretResult? ReadSecret(string path, string mountPoint, string secretName);
+ }
+}