/
IVaultClient.cs
1928 lines (1786 loc) · 106 KB
/
IVaultClient.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using VaultSharp.Backends.Audit.Models;
using VaultSharp.Backends.Authentication.Models;
using VaultSharp.Backends.Authentication.Models.Token;
using VaultSharp.Backends.Secret.Models;
using VaultSharp.Backends.Secret.Models.AWS;
using VaultSharp.Backends.Secret.Models.Cassandra;
using VaultSharp.Backends.Secret.Models.Consul;
using VaultSharp.Backends.Secret.Models.MicrosoftSql;
using VaultSharp.Backends.Secret.Models.MySql;
using VaultSharp.Backends.Secret.Models.PKI;
using VaultSharp.Backends.Secret.Models.PostgreSql;
using VaultSharp.Backends.Secret.Models.SSH;
using VaultSharp.Backends.Secret.Models.Transit;
using VaultSharp.Backends.System.Models;
namespace VaultSharp
{
/// <summary>
/// Provides an interface to interact with Vault as a client.
/// This is the only entry point for consuming the Vault Client.
/// </summary>
public interface IVaultClient
{
/// <summary>
/// Gets the initialization status of Vault.
/// This is an unauthenticated call and does not use the credentials.
/// </summary>
/// <returns>
/// The initialization status of Vault.
/// </returns>
Task<bool> GetInitializationStatusAsync();
/// <summary>
/// Initializes a new Vault. The Vault must have not been previously initialized.
/// This is an unauthenticated call and does not use the credentials.
/// </summary>
/// <param name="secretShares"><para>[required]</para>
/// The number of shares to split the master key into.</param>
/// <param name="secretThreshold"><para>[required]</para>
/// The number of shares required to reconstruct the master key.
/// This must be less than or equal to <see cref="secretShares" />.</param>
/// <param name="pgpKeys"><para>[optional]</para>
/// An array of PGP public keys used to encrypt the output unseal keys.
/// Ordering is preserved.
/// The keys must be base64-encoded from their original binary representation.
/// The size of this array must be the same as <see cref="secretShares" />.</param>
/// <returns>
/// An object including the (possibly encrypted, if pgp_keys was provided) master keys and initial root token.
/// </returns>
Task<MasterCredentials> InitializeAsync(int secretShares, int secretThreshold, string[] pgpKeys = null);
/// <summary>
/// Initializes a new root generation attempt.
/// Only a single root generation attempt can take place at a time.
/// One (and only one) of <see cref="base64EncodedOneTimePassword"/> or <see cref="pgpKey"/> are required.
/// </summary>
/// <param name="base64EncodedOneTimePassword"><para>[optional]</para>
/// A base64-encoded 16-byte value. The raw bytes of the token will be XOR'd with this
/// value before being returned to the final unseal key provider.</param>
/// <param name="pgpKey"><para>[optional]</para>
/// The PGP key.</param>
/// <returns>The root token generation progress.</returns>
Task<RootTokenGenerationProgress> InitiateRootTokenGenerationAsync(string base64EncodedOneTimePassword = null, string pgpKey = null);
/// <summary>
/// Gets the configuration and progress of the current root generation attempt.
/// </summary>
/// <returns></returns>
Task<RootTokenGenerationProgress> GetRootTokenGenerationProgressAsync();
/// <summary>
/// Cancels any in-progress root generation attempt.
/// This clears any progress made.
/// This must be called to change the OTP or PGP key being used.
/// </summary>
/// <returns>The task.</returns>
Task CancelRootTokenGenerationAsync();
/// <summary>
/// Continues the root generation process.
/// Enter a single master key share to progress the root generation attempt.
/// If the threshold number of master key shares is reached,
/// Vault will complete the root generation and issue the new token.
/// Otherwise, this API must be called multiple times until that threshold is met.
/// The attempt nonce must be provided with each call.
/// </summary>
/// <param name="masterShareKey"><para>[required]</para>
/// A single master share key.</param>
/// <param name="nonce"><para>[required]</para>
/// The nonce of the root generation attempt.</param>
/// <returns>
/// An object indicating the attempt nonce, and completion status,
/// and the encoded root token, if the attempt is complete.
/// </returns>
Task<RootTokenGenerationProgress> ContinueRootTokenGenerationAsync(string masterShareKey, string nonce);
/// <summary>
/// Gets the seal status of the Vault.
/// This is an unauthenticated call and does not use the credentials.
/// </summary>
/// <returns>
/// The seal status of the Vault.
/// </returns>
Task<SealStatus> GetSealStatusAsync();
/// <summary>
/// Seals the Vault.
/// </summary>
/// <returns>
/// The task.
/// </returns>
Task SealAsync();
/// <summary>
/// Progresses the unsealing of the Vault.
/// Enter a single master key share to progress the unsealing of the Vault.
/// If the threshold number of master key shares is reached, Vault will attempt to unseal the Vault.
/// Otherwise, this API must be called multiple times until that threshold is met.
/// <para>
/// Either the <see cref="masterShareKey" /> or <see cref="resetCompletely" /> parameter must be provided; if both are provided, <see cref="resetCompletely" /> takes precedence.
/// </para>
/// This is an unauthenticated call and does not use the credentials.
/// </summary>
/// <param name="masterShareKey">A single master share key.</param>
/// <param name="resetCompletely">When <value>true</value>, the previously-provided unseal keys are discarded from memory and the unseal process is completely reset.
/// Default value is <value>false</value>.
/// If you make a call with the value as <value>true</value>, it doesn't matter if this call has a valid unused <see cref="masterShareKey" />. It'll be ignored.</param>
/// <returns>
/// The seal status of the Vault.
/// </returns>
Task<SealStatus> UnsealAsync(string masterShareKey, bool resetCompletely = false);
/// <summary>
/// Unseals the Vault in a single call.
/// Provide all the master keys together.
/// </summary>
/// <param name="allMasterShareKeys">All the master share keys.</param>
/// <returns>The final Seal Status after all the share keys are applied.</returns>
Task<SealStatus> UnsealQuickAsync(string[] allMasterShareKeys);
/// <summary>
/// Gets all the mounted secret backends.
/// </summary>
/// <returns>
/// The mounted secret backends.
/// </returns>
Task<IEnumerable<SecretBackend>> GetAllMountedSecretBackendsAsync();
/// <summary>
/// Gets the mounted secret backend's configuration values.
/// The lease values for each TTL may be the system default ("0" or "system") or a mount-specific value.
/// </summary>
/// <param name="mountPoint"><para>[required]</para>
/// The mount point for the secret backend. (with or without trailing slashes. it doesn't matter)</param>
/// <returns>
/// The mounted secret backend's configuration values.
/// </returns>
Task<SecretBackendConfiguration> GetMountedSecretBackendConfigurationAsync(string mountPoint);
/// <summary>
/// Mounts the new secret backend to the mount point in the URL.
/// </summary>
/// <param name="secretBackend">The secret backend.</param>
/// <returns>
/// A task
/// </returns>
Task MountSecretBackendAsync(SecretBackend secretBackend);
/// <summary>
/// Tunes the secret backend configuration parameters for the given <see cref="mountPoint" />.
/// </summary>
/// <param name="mountPoint"><para>[required]</para>
/// The mount point for the secret backend. (with or without trailing slashes. it doesn't matter)</param>
/// <param name="secretBackendConfiguration"><para>[required]</para>
/// The secret backend configuration with the required setting values.
/// Provide a value of <value>"0"</value> or <value>"system"</value> for the TTL settings if you want to use the system defaults.</param>
/// <returns>
/// A task
/// </returns>
Task TuneSecretBackendConfigurationAsync(string mountPoint, SecretBackendConfiguration secretBackendConfiguration);
/// <summary>
/// Unmounts the secret backend from the mount point.
/// When a backend is unmounted, all of its secrets are revoked and its data is deleted.
/// If either of these operations fail, the backend remains mounted.
/// </summary>
/// <param name="mountPoint"><para>[required]</para>
/// The mount point for the secret backend. (with or without trailing slashes. it doesn't matter)</param>
/// <returns>
/// A task
/// </returns>
Task UnmountSecretBackendAsync(string mountPoint);
/// <summary>
/// Remounts the secret backend from the previous mount point to the new mount point.
/// This is a disruptive command.
/// Though the stored data is retained, all secrets are revoked since secrets are closely tied to their mount paths.
/// </summary>
/// <param name="previousMountPoint"><para>[required]</para>
/// The previous mount point for the secret backend.</param>
/// <param name="newMountPoint"><para>[required]</para>
/// The new mount point for the secret backend.</param>
/// <returns>
/// The task.
/// </returns>
Task RemountSecretBackendAsync(string previousMountPoint, string newMountPoint);
/// <summary>
/// Gets all the enabled authentication backends.
/// </summary>
/// <returns>
/// The enabled authentication backends.
/// </returns>
Task<IEnumerable<AuthenticationBackend>> GetAllEnabledAuthenticationBackendsAsync();
/// <summary>
/// Enables a new authentication backend.
/// The authentication backend can be accessed and configured via the mount point specified in the URL.
/// </summary>
/// <param name="authenticationBackend">The authentication backend.</param>
/// <returns>
/// The task.
/// </returns>
Task EnableAuthenticationBackendAsync(AuthenticationBackend authenticationBackend);
/// <summary>
/// Disables the authentication backend at the given mount point.
/// </summary>
/// <param name="mountPoint"><para>[required]</para>
/// The mount point for the authentication backend. (with or without trailing slashes. it doesn't matter)</param>
/// <returns>
/// The task.
/// </returns>
Task DisableAuthenticationBackendAsync(string mountPoint);
/// <summary>
/// Enables multi factor authentication with the specific type.
/// </summary>
/// <param name="supportedAuthenticationBackendMountPoint">
/// <para>[required]</para>
/// The supported authentication backend mount point.
/// </param>
/// <param name="mfaType">
/// <para>[required]</para>
/// Type of the mfa.
/// </param>
/// <returns>The task.</returns>
Task EnableMultiFactorAuthenticationAsync(string supportedAuthenticationBackendMountPoint, string mfaType = "duo");
/// <summary>
/// Writes contains connection information for the Duo Auth API.
/// </summary>
/// <param name="supportedAuthenticationBackendMountPoint">
/// <para>[required]</para>
/// The supported authentication backend mount point.
/// </param>
/// <param name="host">
/// <para>[required]</para>
/// The host.
/// </param>
/// <param name="integrationKey">
/// <para>[required]</para>
/// The integration key.
/// </param>
/// <param name="secretKey">
/// <para>[required]</para>
/// The secret key.
/// </param>
/// <returns>The task.</returns>
Task WriteDuoAccessAsync(string supportedAuthenticationBackendMountPoint, string host, string integrationKey, string secretKey);
/// <summary>
/// Writes the duo configuration asynchronous.
/// </summary>
/// <param name="supportedAuthenticationBackendMountPoint">
/// <para>[required]</para>
/// The supported authentication backend mount point.
/// </param>
/// <param name="userAgent">
/// <para>[required]</para>
/// The user agent to use when connecting to Duo.
/// </param>
/// <param name="usernameFormat">
/// <para>[required]</para>
/// The username format which controls how the username used to login is transformed before authenticating with Duo.
/// This field is a format string that is passed the original username as its first argument and outputs the new username.
/// For example "%s@example.com" would append "@example.com" to the provided username before connecting to Duo.
/// </param>
/// <returns>The task.</returns>
Task WriteDuoConfigurationAsync(string supportedAuthenticationBackendMountPoint, string userAgent, string usernameFormat);
/// <summary>
/// Gets all the available policy names in the system.
/// </summary>
/// <returns>
/// The policy names.
/// </returns>
Task<IEnumerable<string>> GetAllPoliciesAsync();
/// <summary>
/// Gets the rules for the named policy.
/// </summary>
/// <param name="policyName">
/// <para>[required]</para>
/// The name of the policy.</param>
/// <returns>
/// The rules for the policy.
/// </returns>
Task<Policy> GetPolicyAsync(string policyName);
/// <summary>
/// Adds or updates the policy.
/// </summary>
/// <param name="policy"><para>[required]</para>
/// The policy to be added or updated.</param>
/// <returns>
/// The task.
/// </returns>
Task WritePolicyAsync(Policy policy);
/// <summary>
/// Deletes the named policy.
/// </summary>
/// <param name="policyName"><para>[required]</para>
/// The name of the policy.</param>
/// <returns>
/// The task.
/// </returns>
Task DeletePolicyAsync(string policyName);
/// <summary>
/// Gets the capabilities of the token on the given path.
/// </summary>
/// <param name="token"><para>[required]</para>
/// Token for which capabilities are being queried.</param>
/// <param name="path"><para>[required]</para>
/// Path on which the token's capabilities will be checked.</param>
/// <returns>The list of capabilities.</returns>
Task<IEnumerable<string>> GetTokenCapabilitiesAsync(string token, string path);
/// <summary>
/// Gets the capabilities of client token on the given path.
/// Client token is the Vault token with which this API call is made.
/// </summary>
/// <param name="path"><para>[required]</para>
/// Path on which the token's capabilities will be checked.</param>
/// <returns>The list of capabilities.</returns>
Task<IEnumerable<string>> GetCallingTokenCapabilitiesAsync(string path);
/// <summary>
/// Gets the capabilities of the token associated with an accessor, on the given path.
/// </summary>
/// <param name="tokenAccessor"><para>[required]</para>
/// Token accessor for which capabilities are being queried.</param>
/// <param name="path"><para>[required]</para>
/// Path on which the token's capabilities will be checked.</param>
/// <returns>The list of capabilities.</returns>
Task<IEnumerable<string>> GetTokenAccessorCapabilitiesAsync(string tokenAccessor, string path);
/// <summary>
/// Gets all the enabled audit backends.
/// </summary>
/// <returns>
/// The enabled audit backends.
/// </returns>
Task<IEnumerable<AuditBackend>> GetAllEnabledAuditBackendsAsync();
/// <summary>
/// Enables a new audit backend at the specified mount point.
/// </summary>
/// <param name="auditBackend">The audit backend.</param>
/// <returns>
/// The task.
/// </returns>
Task EnableAuditBackendAsync(AuditBackend auditBackend);
/// <summary>
/// Disables the audit backend at the given mount point.
/// </summary>
/// <param name="mountPoint"><para>[required]</para>
/// The mount point for the audit backend. (with or without trailing slashes. it doesn't matter)</param>
/// <returns>
/// The task.
/// </returns>
Task DisableAuditBackendAsync(string mountPoint);
/// <summary>
/// Hash the given input data with the specified audit backend's hash function and salt.
/// This endpoint can be used to discover whether a given plaintext string (the input parameter) appears in
/// the audit log in obfuscated form.
/// Note that the audit log records requests and responses; since the Vault API is JSON-based,
/// any binary data returned from an API call (such as a DER-format certificate) is base64-encoded by
/// the Vault server in the response, and as a result such information should also be base64-encoded
/// to supply into the <see cref="inputToHash" /> parameter.
/// </summary>
/// <param name="mountPoint"><para>[required]</para>
/// The mount point for the audit backend. (with or without trailing slashes. it doesn't matter)</param>
/// <param name="inputToHash"><para>[required]</para>
/// The input value to hash</param>
/// <returns>
/// The hashed value.
/// </returns>
Task<string> HashWithAuditBackendAsync(string mountPoint, string inputToHash);
/// <summary>
/// Renews the secret by requesting to extending the lease.
/// </summary>
/// <param name="leaseId"><para>[required]</para>
/// The lease identifier for the secret.</param>
/// <param name="incrementSeconds"><para>[optional]</para>
/// A requested amount of time in seconds to extend the lease. This is advisory.</param>
/// <returns>
/// The secret with the lease information and the data as a dictionary.
/// </returns>
Task<Secret<Dictionary<string, object>>> RenewSecretAsync(string leaseId, int? incrementSeconds = null);
/// <summary>
/// Revokes the secret effective immediately.
/// </summary>
/// <param name="leaseId"><para>[required]</para>
/// The lease identifier for the secret.</param>
/// <returns>
/// The task
/// </returns>
Task RevokeSecretAsync(string leaseId);
/// <summary>
/// Revokes all the secrets generated under the given prefix immediately.
/// </summary>
/// <param name="pathPrefix"><para>[required]</para>
/// The path prefix. (with or without trailing slashes. it doesn't matter)</param>
/// <returns>
/// The task.
/// </returns>
Task RevokeAllSecretsUnderPrefixAsync(string pathPrefix);
/// <summary>
/// Revoke all secrets or tokens generated under a given prefix immediately.
/// Unlike <see cref="RevokeAllSecretsUnderPrefixAsync"/>, this path ignores backend errors
/// encountered during revocation.
/// This is potentially very dangerous and should only be used in specific emergency
/// situations where errors in the backend or the connected backend service
/// prevent normal revocation.
/// By ignoring these errors, Vault abdicates responsibility for ensuring that the issued
/// credentials or secrets are properly revoked and/or cleaned up.
/// Access to this endpoint should be tightly controlled.
/// </summary>
/// <param name="pathPrefix">The path prefix.</param>
/// <returns>The task.</returns>
Task ForceRevokeAllSecretsUnderPrefixAsync(string pathPrefix);
/// <summary>
/// Gets the high availability status and current leader instance of Vault.
/// </summary>
/// <returns>
/// The leader info.
/// </returns>
Task<Leader> GetLeaderAsync();
/// <summary>
/// Forces the node to give up active status.
/// If the node does not have active status, this endpoint does nothing.
/// Note that the node will sleep for ten seconds before attempting to grab the active lock again,
/// but if no standby nodes grab the active lock in the interim,
/// the same node may become the active node again.
/// This API is a root protected call.
/// </summary>
/// <returns>The task.</returns>
Task StepDownActiveNodeAsync();
/// <summary>
/// Gets information about the current encryption key used by Vault
/// </summary>
/// <returns>
/// The status of the encryption key.
/// </returns>
Task<EncryptionKeyStatus> GetEncryptionKeyStatusAsync();
/// <summary>
/// Gets the configuration and progress of the current rekey attempt.
/// Information about the new shares to generate and the threshold required for the new shares,
/// the number of unseal keys provided for this rekey and the required number of unseal keys is returned.
/// </summary>
/// <returns>
/// The rekey status.
/// </returns>
Task<RekeyStatus> GetRekeyStatusAsync();
/// <summary>
/// Initiates a new rekey attempt.
/// Only a single rekey attempt can take place at a time, and changing the parameters of a rekey requires canceling and starting a new rekey.
/// </summary>
/// <param name="secretShares"><para>[required]</para>
/// The number of shares to split the master key into.</param>
/// <param name="secretThreshold"><para>[required]</para>
/// The number of shares required to reconstruct the master key.
/// This must be less than or equal to <see cref="secretShares" />.</param>
/// <param name="pgpKeys"><para>[optional]</para>
/// An array of PGP public keys used to encrypt the output unseal keys.
/// Ordering is preserved.
/// The keys must be base64-encoded from their original binary representation.
/// The size of this array must be the same as <see cref="secretShares" />.</param>
/// <param name="backup"><para>[optional]</para>
/// If using PGP-encrypted keys, whether Vault should also back them up to a well-known
/// location in physical storage. These can then be retrieved and removed
/// via the GetRekeyBackupAsync endpoint. Makes sense only when pgp keys are provided.
/// Defaults to 'false', meaning no backup.
/// </param>
/// <returns>
/// The task.
/// </returns>
Task InitiateRekeyAsync(int secretShares, int secretThreshold, string[] pgpKeys = null, bool backup = false);
/// <summary>
/// Cancels any in-progress rekey. This clears the rekey settings as well as any progress made.
/// This must be called to change the parameters of the rekey.
/// </summary>
/// <returns>
/// The task.
/// </returns>
Task CancelRekeyAsync();
/// <summary>
/// Gets the the backup copy of PGP-encrypted unseal keys.
/// The returned value is the nonce of the rekey operation and a map of PGP key
/// fingerprint to hex-encoded PGP-encrypted key.
/// </summary>
/// <returns>The rekey backup info.</returns>
Task<RekeyBackupInfo> GetRekeyBackupKeysAsync();
/// <summary>
/// Deletes the backup copy of PGP-encrypted unseal keys.
/// </summary>
/// <returns>The task.</returns>
Task DeleteRekeyBackupKeysAsync();
/// <summary>
/// Continues the rekey process. Enter a single master key share to progress the rekey of the Vault.
/// If the threshold number of master key shares is reached, Vault will complete the rekey.
/// Otherwise, this API must be called multiple times until that threshold is met.
/// </summary>
/// <param name="masterShareKey"><para>[required]</para>
/// A single master share key.</param>
/// <param name="rekeyNonce"><para>[required]</para>
/// The nonce of the rekey operation.</param>
/// <returns>
/// An object indicating the rekey operation nonce and completion status;
/// if completed, the new master keys are returned.
/// If the keys are PGP-encrypted, an array of key fingerprints will also be provided
/// (with the order in which the keys were used for encryption) along with whether
/// or not the keys were backed up to physical storage.
/// </returns>
Task<RekeyProgress> ContinueRekeyAsync(string masterShareKey, string rekeyNonce);
/// <summary>
/// Trigger a rotation of the backend encryption key. This is the key that is used to encrypt data written to the storage backend, and is not provided to operators.
/// This operation is done online. Future values are encrypted with the new key, while old values are decrypted with previous encryption keys.
/// </summary>
/// <returns>
/// The task.
/// </returns>
Task RotateEncryptionKeyAsync();
/// <summary>
/// Reads the value of the key at the given path.
/// This is the raw path in the sorage backend and not the logical path that is exposed via the mount system.
/// </summary>
/// <param name="storagePath"><para>[required]</para>
/// Raw path in the storage backend and not the logical path that is exposed via the mount system.</param>
/// <returns>
/// The Secret with raw data.
/// </returns>
/// t
Task<Secret<RawData>> ReadRawSecretAsync(string storagePath);
/// <summary>
/// Update the value of the key at the given path.
/// This is the raw path in the storage backend and not the logical path that is exposed via the mount system.
/// </summary>
/// <param name="storagePath"><para>[required]</para>
/// Raw path in the storage backend and not the logical path that is exposed via the mount system.</param>
/// <param name="values"><para>[required]</para>
/// The values to write. The dictionary will be JSONized as a raw value string before being written.</param>
/// <returns>
/// The task.
/// </returns>
Task WriteRawSecretAsync(string storagePath, IDictionary<string, object> values);
/// <summary>
/// Delete the key with given path.
/// This is the raw path in the storage backend and not the logical path that is exposed via the mount system.
/// </summary>
/// <param name="storagePath"><para>[required]</para>
/// Raw path in the storage backend and not the logical path that is exposed via the mount system.</param>
/// <returns>
/// The task.
/// </returns>
Task DeleteRawSecretAsync(string storagePath);
/// <summary>
/// Gets the health status of Vault. This provides a simple way to monitor the health of a Vault instance.
/// This is an unauthenticated call and does not use the credentials.
/// </summary>
/// <param name="standbyOk"><para>[optional]</para>
/// A flag to indicate that being a standby should still return the active status code
/// instead of the standby status code of HTTP 429 (or whatever is provided as standbyStatusCode)
/// DEFAULTs to <value>null</value>, meaning a standby code will be returned.
/// </param>
/// <param name="activeStatusCode"><para>[optional]</para>
/// A user defined status code provided to indicate the status code that should be returned
/// for an active node instead of the default successful response of HTTP 200.
/// DEFAULTs to <value>null</value>, meaning the default HTTP 200 Status code will be returned.
/// </param>
/// <param name="standbyStatusCode"><para>[optional]</para>
/// A user defined status code provided to indicate the status code that should be returned
/// for an standby node instead of the default error response of HTTP 429.
/// DEFAULTs to <value>null</value>, meaning the default HTTP 429 Status code will be returned.
/// </param>
/// <param name="sealedStatusCode"><para>[optional]</para>
/// A user defined status code provided to indicate the status code that should be returned
/// for an sealed node instead of the default error response of HTTP 503.
/// DEFAULTs to <value>null</value>, meaning the default HTTP 503 Status code will be returned.
/// </param>
/// <param name="uninitializedStatusCode"><para>[optional]</para>
/// A user defined status code provided to indicate the status code that should be returned
/// for an uninitialized vault node instead of the default error response of HTTP 501.
/// DEFAULTs to <value>null</value>, meaning the default HTTP 501 Status code will be returned.
/// </param>
/// <returns>
/// The health status.
/// </returns>
Task<HealthStatus> GetHealthStatusAsync(bool? standbyOk = null, int? activeStatusCode = null, int? standbyStatusCode = null, int? sealedStatusCode = null, int? uninitializedStatusCode = null);
/// <summary>
/// An all-purpose method to read any value from vault from any path.
/// </summary>
/// <param name="path"><para>[required]</para>
/// The path where the value is stored.</param>
/// <returns>
/// The data as a general dictionary along with the lease information.
/// </returns>
Task<Secret<Dictionary<string, object>>> ReadSecretAsync(string path);
/// <summary>
/// An all-purpose method to write any value to vault at any path.
/// </summary>
/// <param name="path"><para>[required]</para>
/// The path where the value is to be stored.</param>
/// <param name="values"><para>[required]</para>
/// The value to be written.</param>
/// <returns>
/// The task.
/// </returns>
Task WriteSecretAsync(string path, IDictionary<string, object> values);
/// <summary>
/// Deletes the value at the specified path in Vault.
/// </summary>
/// <param name="path"><para>[required]</para>
/// The path where the value is to be stored.</param>
/// <returns>
/// The task.
/// </returns>
Task DeleteSecretAsync(string path);
/// <summary>
/// Gets token accessors. This requires root capability, and access to it should be tightly
/// controlled as the accessors can be used to revoke very large numbers of tokens
/// and their associated leases at once.
/// </summary>
/// <returns>The list of accessors.</returns>
Task<Secret<IEnumerable<string>>> GetTokenAccessorListAsync();
/// <summary>
/// Creates a new token.
/// <para>
/// Certain options are only available to when called by a root token.
/// If used with the 'createAsOrphan' flag, a root token is not required to create an orphan token (otherwise set with the noParent option).
/// </para>
/// </summary>
/// <param name="tokenCreationOptions">The token creation options.</param>
/// <returns>
/// The secret with the data.
/// </returns>
Task<Secret<Dictionary<string, object>>> CreateTokenAsync(TokenCreationOptions tokenCreationOptions = null);
/// <summary>
/// Gets the calling client token information. i.e. the token used by the client as part of this call.
/// </summary>
/// <returns>
/// The secret with <see cref="TokenInfo" />.
/// </returns>
Task<Secret<TokenInfo>> GetCallingTokenInfoAsync();
/// <summary>
/// Gets the token information for the provided <see cref="token" />.
/// </summary>
/// <param name="token"><para>[required]</para>
/// The token.</param>
/// <returns>
/// The secret with <see cref="TokenInfo" />.
/// </returns>
Task<Secret<TokenInfo>> GetTokenInfoAsync(string token);
/// <summary>
/// Gets the properties of the token associated with the accessor,
/// except the token ID.
/// This is meant for purposes where there is no access to token ID
/// but there is need to fetch the properties of a token.
/// </summary>
/// <param name="tokenAccessor"><para>[required]</para>
/// Accessor of the token to lookup.</param>
/// <returns>The token info.</returns>
Task<Secret<TokenInfo>> GetTokenInfoByAccessorAsync(string tokenAccessor);
/// <summary>
/// Revokes a token and all child tokens if the <see cref="revokeAllChildTokens" /> value is <value>true</value>.
/// When the token is revoked, all secrets generated with it are also revoked.
/// </summary>
/// <param name="token"><para>[required]</para>
/// The token to revoke.</param>
/// <param name="revokeAllChildTokens"><para>[required]</para>
/// if set to <c>true</c> [revoke all child tokens].
/// else only the current token is revoked. All child tokens are orphaned, but can be revoked subsequently.</param>
/// <returns>
/// The task.
/// </returns>
Task RevokeTokenAsync(string token, bool revokeAllChildTokens);
/// <summary>
/// Revokes the token associated with the accessor and all the child tokens.
/// This is meant for purposes where there is no access to token ID
/// but there is need to revoke a token and its children.
/// </summary>
/// <param name="tokenAccessor"><para>[required]</para>
/// Accessor of the token.</param>
/// <returns>The token info.</returns>
Task RevokeTokenByAccessorAsync(string tokenAccessor);
/// <summary>
/// Revokes the calling client token and all child tokens.
/// When the token is revoked, all secrets generated with it are also revoked.
/// </summary>
/// <returns>
/// The task.
/// </returns>
Task RevokeCallingTokenAsync();
/// <summary>
/// Renews a lease associated with the calling token.
/// This is used to prevent the expiration of a token, and the automatic revocation of it.
/// Token renewal is possible only if there is a lease associated with it.
/// </summary>
/// <param name="incrementSeconds"><para>[optional]</para>
/// A requested amount of time in seconds to extend the lease. This is advisory and may be ignored.</param>
/// <returns>
/// The task.
/// </returns>
Task RenewCallingTokenAsync(int? incrementSeconds = null);
/// <summary>
/// Renews a lease associated with the calling token.
/// This is used to prevent the expiration of a token, and the automatic revocation of it.
/// Token renewal is possible only if there is a lease associated with it.
/// </summary>
/// <param name="token"><para>[required]</para>
/// The token to renew.</param>
/// <param name="incrementSeconds"><para>[optional]</para>
/// A requested amount of time in seconds to extend the lease. This is advisory and may be ignored.</param>
/// <returns>
/// The task.
/// </returns>
Task RenewTokenAsync(string token, int? incrementSeconds = null);
/// <summary>
/// Configures the root IAM credentials that perform various IAM actions.
/// This API is a root protected call.
/// </summary>
/// <param name="awsRootCredentials"><para>[required]</para>
/// The root credentials need permission to perform various IAM actions.
/// These are the actions that the AWS secret backend uses to manage IAM credentials.</param>
/// <param name="awsBackendMountPoint"><para>[optional]</para>
/// The mount point for the AWS backend. Defaults to <see cref="SecretBackendType.AWS" />
/// Provide a value only if you have customized the AWS mount point.</param>
/// <returns>
/// The task.
/// </returns>
Task AWSConfigureRootCredentialsAsync(AWSRootCredentials awsRootCredentials, string awsBackendMountPoint = SecretBackendDefaultMountPoints.AWS);
/// <summary>
/// Configures the lease settings for generated credentials.
/// This API is a root protected call.
/// </summary>
/// <param name="credentialLeaseSettings"><para>[required]</para>
/// The credential lease settings.</param>
/// <param name="awsBackendMountPoint"><para>[optional]</para>
/// The mount point for the AWS backend. Defaults to <see cref="SecretBackendType.AWS" />
/// Provide a value only if you have customized the AWS mount point.</param>
/// <returns>
/// The task.
/// </returns>
Task AWSConfigureCredentialLeaseSettingsAsync(CredentialLeaseSettings credentialLeaseSettings, string awsBackendMountPoint = SecretBackendDefaultMountPoints.AWS);
/// <summary>
/// Creates or updates a named AWS role.
/// </summary>
/// <param name="awsRoleName"><para>[required]</para>
/// Name of the AWS role.</param>
/// <param name="awsRoleDefinition"><para>[required]</para>
/// The AWS role definition IAM policy in a string JSON format.</param>
/// <param name="awsBackendMountPoint"><para>[optional]</para>
/// The mount point for the AWS backend. Defaults to <see cref="SecretBackendType.AWS" />
/// Provide a value only if you have customized the AWS mount point.</param>
/// <returns>
/// The task.
/// </returns>
Task AWSWriteNamedRoleAsync(string awsRoleName, AWSRoleDefinition awsRoleDefinition, string awsBackendMountPoint = SecretBackendDefaultMountPoints.AWS);
/// <summary>
/// Queries a named AWS role definition to get the IAM policy.
/// </summary>
/// <param name="awsRoleName"><para>[required]</para>
/// Name of the AWS role.</param>
/// <param name="awsBackendMountPoint"><para>[optional]</para>
/// The mount point for the AWS backend. Defaults to <see cref="SecretBackendType.AWS" />
/// Provide a value only if you have customized the AWS mount point.</param>
/// <returns>
/// The secret with the AWS Role definition as an IAM policy in a string JSON format.
/// </returns>
Task<Secret<AWSRoleDefinition>> AWSReadNamedRoleAsync(string awsRoleName, string awsBackendMountPoint = SecretBackendDefaultMountPoints.AWS);
/// <summary>
/// Deletes a named AWS role.
/// </summary>
/// <param name="awsRoleName"><para>[required]</para>
/// Name of the AWS role.</param>
/// <param name="awsBackendMountPoint"><para>[optional]</para>
/// The mount point for the AWS backend. Defaults to <see cref="SecretBackendType.AWS" />
/// Provide a value only if you have customized the AWS mount point.</param>
/// <returns>
/// The task.
/// </returns>
Task AWSDeleteNamedRoleAsync(string awsRoleName, string awsBackendMountPoint = SecretBackendDefaultMountPoints.AWS);
/// <summary>
/// Generates a dynamic IAM AWS credential based on the named role.
/// </summary>
/// <param name="awsRoleName"><para>[required]</para>
/// Name of the AWS role.</param>
/// <param name="awsBackendMountPoint"><para>[optional]</para>
/// The mount point for the AWS backend. Defaults to <see cref="SecretBackendType.AWS" />
/// Provide a value only if you have customized the AWS mount point.</param>
/// <returns>
/// The secret with the <see cref="AWSCredentials" /> as the data.
/// </returns>
Task<Secret<AWSCredentials>> AWSGenerateDynamicCredentialsAsync(string awsRoleName, string awsBackendMountPoint = SecretBackendDefaultMountPoints.AWS);
/// <summary>
/// Configures the connection information used to communicate with Cassandra.
/// This API is a root protected call.
/// </summary>
/// <param name="cassandraConnectionInfo"><para>[required]</para>
/// The cassandra connection information.</param>
/// <param name="cassandraBackendMountPoint"><para>[optional]</para>
/// The mount point for the Cassandra backend. Defaults to <see cref="SecretBackendType.Cassandra" />
/// Provide a value only if you have customized the Cassandra mount point.</param>
/// <returns>
/// The task.
/// </returns>
Task CassandraConfigureConnectionAsync(CassandraConnectionInfo cassandraConnectionInfo, string cassandraBackendMountPoint = SecretBackendDefaultMountPoints.Cassandra);
/// <summary>
/// Creates or updates a named Cassandra role.
/// </summary>
/// <param name="cassandraRoleName"><para>[required]</para>
/// Name of the Cassandra role.</param>
/// <param name="cassandraRoleDefinition"><para>[required]</para>
/// The Cassandra role definition with the creation, rollback query and lease information.</param>
/// <param name="cassandraBackendMountPoint"><para>[optional]</para>
/// The mount point for the Cassandra backend. Defaults to <see cref="SecretBackendType.Cassandra" />
/// Provide a value only if you have customized the Cassandra mount point.</param>
/// <returns>
/// The task.
/// </returns>
Task CassandraWriteNamedRoleAsync(string cassandraRoleName, CassandraRoleDefinition cassandraRoleDefinition, string cassandraBackendMountPoint = SecretBackendDefaultMountPoints.Cassandra);
/// <summary>
/// Queries a named Cassandra role definition
/// </summary>
/// <param name="cassandraRoleName"><para>[required]</para>
/// Name of the Cassandra role.</param>
/// <param name="cassandraBackendMountPoint"><para>[optional]</para>
/// The mount point for the Cassandra backend. Defaults to <see cref="SecretBackendType.Cassandra" />
/// Provide a value only if you have customized the Cassandra mount point.</param>
/// <returns>
/// The secret with the Cassandra role definition with the creation, rollback query and lease information.
/// </returns>
Task<Secret<CassandraRoleDefinition>> CassandraReadNamedRoleAsync(string cassandraRoleName, string cassandraBackendMountPoint = SecretBackendDefaultMountPoints.Cassandra);
/// <summary>
/// Deletes a named Cassandra role definition
/// </summary>
/// <param name="cassandraRoleName"><para>[required]</para>
/// Name of the Cassandra role.</param>
/// <param name="cassandraBackendMountPoint"><para>[optional]</para>
/// The mount point for the Cassandra backend. Defaults to <see cref="SecretBackendType.Cassandra" />
/// Provide a value only if you have customized the Cassandra mount point.</param>
/// <returns>
/// The task.
/// </returns>
Task CassandraDeleteNamedRoleAsync(string cassandraRoleName, string cassandraBackendMountPoint = SecretBackendDefaultMountPoints.Cassandra);
/// <summary>
/// Generates a new set of dynamic credentials based on the named role.
/// </summary>
/// <param name="cassandraRoleName"><para>[required]</para>
/// Name of the Cassandra role.</param>
/// <param name="cassandraBackendMountPoint"><para>[optional]</para>
/// The mount point for the Cassandra backend. Defaults to <see cref="SecretBackendType.Cassandra" />
/// Provide a value only if you have customized the Cassandra mount point.</param>
/// <returns>
/// The secret with the <see cref="UsernamePasswordCredentials" /> as the data.
/// </returns>
Task<Secret<UsernamePasswordCredentials>> CassandraGenerateDynamicCredentialsAsync(string cassandraRoleName, string cassandraBackendMountPoint = SecretBackendDefaultMountPoints.Cassandra);
/// <summary>
/// Configures the access information for Consul.
/// This API is a root protected call.
/// </summary>
/// <param name="consulAccessInfo"><para>[required]</para>
/// The consul access information.</param>
/// <param name="consulBackendMountPoint"><para>[optional]</para>
/// The mount point for the Consul backend. Defaults to <see cref="SecretBackendType.Consul" />
/// Provide a value only if you have customized the Consul mount point.</param>
/// <returns>
/// The task.
/// </returns>
Task ConsulConfigureAccessAsync(ConsulAccessInfo consulAccessInfo, string consulBackendMountPoint = SecretBackendDefaultMountPoints.Consul);
/// <summary>
/// Creates or updates a named Consul role.
/// </summary>
/// <param name="consulRoleName"><para>[required]</para>
/// Name of the Consul role.</param>
/// <param name="consulRoleDefinition"><para>[required]</para>
/// The Consul role definition with the policy and token information.</param>
/// <param name="consulBackendMountPoint"><para>[optional]</para>
/// The mount point for the Consul backend. Defaults to <see cref="SecretBackendType.Consul" />
/// Provide a value only if you have customized the Consul mount point.</param>
/// <returns>
/// The task.
/// </returns>
Task ConsulWriteNamedRoleAsync(string consulRoleName, ConsulRoleDefinition consulRoleDefinition, string consulBackendMountPoint = SecretBackendDefaultMountPoints.Consul);
/// <summary>
/// Queries a named Consul role.
/// </summary>
/// <param name="consulRoleName"><para>[required]</para>
/// Name of the Consul role.</param>
/// <param name="consulBackendMountPoint"><para>[optional]</para>
/// The mount point for the Consul backend. Defaults to <see cref="SecretBackendType.Consul" />
/// Provide a value only if you have customized the Consul mount point.</param>
/// <returns>
/// The secret with the Consul role definition.
/// </returns>
Task<Secret<ConsulRoleDefinition>> ConsulReadNamedRoleAsync(string consulRoleName, string consulBackendMountPoint = SecretBackendDefaultMountPoints.Consul);
/// <summary>
/// Deletes a named Consul role.
/// </summary>
/// <param name="consulRoleName"><para>[required]</para>
/// Name of the Consul role.</param>
/// <param name="consulBackendMountPoint"><para>[optional]</para>
/// The mount point for the Consul backend. Defaults to <see cref="SecretBackendType.Consul" />
/// Provide a value only if you have customized the Consul mount point.</param>
/// <returns>
/// The task.
/// </returns>
Task ConsulDeleteNamedRoleAsync(string consulRoleName, string consulBackendMountPoint = SecretBackendDefaultMountPoints.Consul);
/// <summary>
/// Generates a dynamic Consul token based on the role definition.
/// </summary>
/// <param name="consulRoleName"><para>[required]</para>
/// Name of the Consul role.</param>
/// <param name="consulBackendMountPoint"><para>[optional]</para>
/// The mount point for the Consul backend. Defaults to <see cref="SecretBackendType.Consul" />
/// Provide a value only if you have customized the Consul mount point.</param>
/// <returns>
/// The secret with the <see cref="ConsulCredentials" /> as the data.
/// </returns>
Task<Secret<ConsulCredentials>> ConsulGenerateDynamicCredentialsAsync(string consulRoleName, string consulBackendMountPoint = SecretBackendDefaultMountPoints.Consul);
/// <summary>
/// Retrieves the secret at the specified location.
/// </summary>
/// <param name="locationPath"><para>[required]</para>