1use std::collections::HashMap;
2use std::future::Future;
3
4use secrecy::SecretString;
5use serde::de::DeserializeOwned;
6
7use crate::types::auth::*;
8use crate::types::aws::*;
9use crate::types::azure::*;
10use crate::types::consul::*;
11use crate::types::database::*;
12use crate::types::error::VaultError;
13use crate::types::gcp::*;
14use crate::types::identity::*;
15use crate::types::kv::{KvConfig, KvFullMetadata, KvMetadata, KvMetadataParams, KvReadResponse};
16use crate::types::nomad::*;
17use crate::types::pki::*;
18use crate::types::rabbitmq::*;
19use crate::types::response::{AuthInfo, WrapInfo};
20use crate::types::ssh::*;
21use crate::types::sys::*;
22use crate::types::terraform::*;
23use crate::types::totp::*;
24use crate::types::transit::*;
25
26pub trait CubbyholeOperations: Send + Sync {
31 fn read<T: DeserializeOwned + Send>(
32 &self,
33 path: &str,
34 ) -> impl Future<Output = Result<T, VaultError>> + Send;
35
36 fn write(
37 &self,
38 path: &str,
39 data: &serde_json::Value,
40 ) -> impl Future<Output = Result<(), VaultError>> + Send;
41
42 fn delete(&self, path: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
43
44 fn list(&self, path: &str) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
45}
46
47pub trait Kv1Operations: Send + Sync {
52 fn read<T: DeserializeOwned + Send>(
53 &self,
54 path: &str,
55 ) -> impl Future<Output = Result<T, VaultError>> + Send;
56
57 fn write(
58 &self,
59 path: &str,
60 data: &serde_json::Value,
61 ) -> impl Future<Output = Result<(), VaultError>> + Send;
62
63 fn delete(&self, path: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
64
65 fn list(&self, path: &str) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
66}
67
68pub trait Kv2Operations: Send + Sync {
73 fn read_config(&self) -> impl Future<Output = Result<KvConfig, VaultError>> + Send;
74
75 fn write_config(&self, cfg: &KvConfig) -> impl Future<Output = Result<(), VaultError>> + Send;
76
77 fn read<T: DeserializeOwned + Send>(
78 &self,
79 path: &str,
80 ) -> impl Future<Output = Result<KvReadResponse<T>, VaultError>> + Send;
81
82 fn read_data<T: DeserializeOwned + Send>(
84 &self,
85 path: &str,
86 ) -> impl Future<Output = Result<T, VaultError>> + Send;
87
88 fn read_version<T: DeserializeOwned + Send>(
89 &self,
90 path: &str,
91 version: u64,
92 ) -> impl Future<Output = Result<KvReadResponse<T>, VaultError>> + Send;
93
94 fn write(
95 &self,
96 path: &str,
97 data: &serde_json::Value,
98 ) -> impl Future<Output = Result<KvMetadata, VaultError>> + Send;
99
100 fn write_cas(
101 &self,
102 path: &str,
103 data: &serde_json::Value,
104 cas: u64,
105 ) -> impl Future<Output = Result<KvMetadata, VaultError>> + Send;
106
107 fn patch(
108 &self,
109 path: &str,
110 data: &serde_json::Value,
111 ) -> impl Future<Output = Result<KvMetadata, VaultError>> + Send;
112
113 fn list(&self, path: &str) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
114
115 fn delete(&self, path: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
116
117 fn delete_versions(
118 &self,
119 path: &str,
120 versions: &[u64],
121 ) -> impl Future<Output = Result<(), VaultError>> + Send;
122
123 fn undelete_versions(
124 &self,
125 path: &str,
126 versions: &[u64],
127 ) -> impl Future<Output = Result<(), VaultError>> + Send;
128
129 fn destroy_versions(
130 &self,
131 path: &str,
132 versions: &[u64],
133 ) -> impl Future<Output = Result<(), VaultError>> + Send;
134
135 fn read_metadata(
136 &self,
137 path: &str,
138 ) -> impl Future<Output = Result<KvFullMetadata, VaultError>> + Send;
139
140 fn write_metadata(
141 &self,
142 path: &str,
143 meta: &KvMetadataParams,
144 ) -> impl Future<Output = Result<(), VaultError>> + Send;
145
146 fn patch_metadata(
147 &self,
148 path: &str,
149 meta: &KvMetadataParams,
150 ) -> impl Future<Output = Result<(), VaultError>> + Send;
151
152 fn delete_metadata(&self, path: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
153
154 fn read_subkeys(
155 &self,
156 path: &str,
157 depth: Option<u32>,
158 ) -> impl Future<Output = Result<serde_json::Value, VaultError>> + Send;
159}
160
161pub trait TransitOperations: Send + Sync {
166 fn create_key(
167 &self,
168 name: &str,
169 params: &TransitKeyParams,
170 ) -> impl Future<Output = Result<(), VaultError>> + Send;
171
172 fn read_key(
173 &self,
174 name: &str,
175 ) -> impl Future<Output = Result<TransitKeyInfo, VaultError>> + Send;
176
177 fn list_keys(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
178
179 fn delete_key(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
180
181 fn update_key_config(
182 &self,
183 name: &str,
184 cfg: &TransitKeyConfig,
185 ) -> impl Future<Output = Result<(), VaultError>> + Send;
186
187 fn rotate_key(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
188
189 fn export_key(
190 &self,
191 name: &str,
192 key_type: &str,
193 version: Option<u64>,
194 ) -> impl Future<Output = Result<TransitExportedKey, VaultError>> + Send;
195
196 fn encrypt(
197 &self,
198 name: &str,
199 plaintext: &SecretString,
200 ) -> impl Future<Output = Result<String, VaultError>> + Send;
201
202 fn decrypt(
203 &self,
204 name: &str,
205 ciphertext: &str,
206 ) -> impl Future<Output = Result<SecretString, VaultError>> + Send;
207
208 fn rewrap(
209 &self,
210 name: &str,
211 ciphertext: &str,
212 ) -> impl Future<Output = Result<String, VaultError>> + Send;
213
214 fn batch_encrypt(
215 &self,
216 name: &str,
217 items: &[TransitBatchPlaintext],
218 ) -> impl Future<Output = Result<Vec<TransitBatchCiphertext>, VaultError>> + Send;
219
220 fn batch_decrypt(
221 &self,
222 name: &str,
223 items: &[TransitBatchCiphertext],
224 ) -> impl Future<Output = Result<Vec<TransitBatchDecryptItem>, VaultError>> + Send;
225
226 fn sign(
227 &self,
228 name: &str,
229 input: &[u8],
230 params: &TransitSignParams,
231 ) -> impl Future<Output = Result<String, VaultError>> + Send;
232
233 fn verify(
234 &self,
235 name: &str,
236 input: &[u8],
237 signature: &str,
238 ) -> impl Future<Output = Result<bool, VaultError>> + Send;
239
240 fn batch_sign(
241 &self,
242 name: &str,
243 items: &[TransitBatchSignInput],
244 params: &TransitSignParams,
245 ) -> impl Future<Output = Result<Vec<TransitBatchSignResult>, VaultError>> + Send;
246
247 fn batch_verify(
248 &self,
249 name: &str,
250 items: &[TransitBatchVerifyInput],
251 ) -> impl Future<Output = Result<Vec<TransitBatchVerifyResult>, VaultError>> + Send;
252
253 fn hash(
254 &self,
255 input: &[u8],
256 algorithm: &str,
257 ) -> impl Future<Output = Result<String, VaultError>> + Send;
258
259 fn hmac(
260 &self,
261 name: &str,
262 input: &[u8],
263 algorithm: &str,
264 ) -> impl Future<Output = Result<String, VaultError>> + Send;
265
266 fn random(
267 &self,
268 num_bytes: u32,
269 format: &str,
270 ) -> impl Future<Output = Result<String, VaultError>> + Send;
271
272 fn generate_data_key(
273 &self,
274 name: &str,
275 key_type: &str,
276 ) -> impl Future<Output = Result<TransitDataKey, VaultError>> + Send;
277
278 fn trim_key(
279 &self,
280 name: &str,
281 min_version: u64,
282 ) -> impl Future<Output = Result<(), VaultError>> + Send;
283
284 fn backup_key(
285 &self,
286 name: &str,
287 ) -> impl Future<Output = Result<SecretString, VaultError>> + Send;
288
289 fn restore_key(
290 &self,
291 name: &str,
292 backup: &SecretString,
293 ) -> impl Future<Output = Result<(), VaultError>> + Send;
294
295 fn read_cache_config(
296 &self,
297 ) -> impl Future<Output = Result<TransitCacheConfig, VaultError>> + Send;
298
299 fn write_cache_config(&self, size: u64) -> impl Future<Output = Result<(), VaultError>> + Send;
300}
301
302pub trait PkiOperations: Send + Sync {
307 fn generate_root(
308 &self,
309 params: &PkiRootParams,
310 ) -> impl Future<Output = Result<PkiCertificate, VaultError>> + Send;
311
312 fn generate_intermediate_csr(
313 &self,
314 params: &PkiIntermediateParams,
315 ) -> impl Future<Output = Result<PkiCsr, VaultError>> + Send;
316
317 fn set_signed_intermediate(
318 &self,
319 certificate: &str,
320 ) -> impl Future<Output = Result<PkiImportResult, VaultError>> + Send;
321
322 fn delete_root(&self) -> impl Future<Output = Result<(), VaultError>> + Send;
323
324 fn list_issuers(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
325
326 fn read_issuer(
327 &self,
328 issuer_ref: &str,
329 ) -> impl Future<Output = Result<PkiIssuerInfo, VaultError>> + Send;
330
331 fn update_issuer(
332 &self,
333 issuer_ref: &str,
334 params: &PkiIssuerUpdateParams,
335 ) -> impl Future<Output = Result<PkiIssuerInfo, VaultError>> + Send;
336
337 fn delete_issuer(
338 &self,
339 issuer_ref: &str,
340 ) -> impl Future<Output = Result<(), VaultError>> + Send;
341
342 fn create_role(
343 &self,
344 name: &str,
345 params: &PkiRoleParams,
346 ) -> impl Future<Output = Result<(), VaultError>> + Send;
347
348 fn read_role(&self, name: &str) -> impl Future<Output = Result<PkiRole, VaultError>> + Send;
349
350 fn list_roles(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
351
352 fn delete_role(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
353
354 fn issue(
355 &self,
356 role: &str,
357 params: &PkiIssueParams,
358 ) -> impl Future<Output = Result<PkiIssuedCert, VaultError>> + Send;
359
360 fn sign(
361 &self,
362 role: &str,
363 params: &PkiSignParams,
364 ) -> impl Future<Output = Result<PkiSignedCert, VaultError>> + Send;
365
366 fn sign_verbatim(
367 &self,
368 role: &str,
369 csr: &str,
370 ) -> impl Future<Output = Result<PkiSignedCert, VaultError>> + Send;
371
372 fn list_certs(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
373
374 fn read_cert(
375 &self,
376 serial: &str,
377 ) -> impl Future<Output = Result<PkiCertificateEntry, VaultError>> + Send;
378
379 fn set_urls(
380 &self,
381 config: &PkiUrlsConfig,
382 ) -> impl Future<Output = Result<(), VaultError>> + Send;
383
384 fn read_urls(&self) -> impl Future<Output = Result<PkiUrlsConfig, VaultError>> + Send;
385
386 fn revoke(
387 &self,
388 serial: &str,
389 ) -> impl Future<Output = Result<PkiRevocationInfo, VaultError>> + Send;
390
391 fn revoke_with_key(
392 &self,
393 serial: &str,
394 private_key: &SecretString,
395 ) -> impl Future<Output = Result<PkiRevocationInfo, VaultError>> + Send;
396
397 fn rotate_crl(&self) -> impl Future<Output = Result<(), VaultError>> + Send;
398
399 fn tidy(&self, params: &PkiTidyParams) -> impl Future<Output = Result<(), VaultError>> + Send;
400
401 fn tidy_status(&self) -> impl Future<Output = Result<PkiTidyStatus, VaultError>> + Send;
402
403 fn cross_sign_intermediate(
404 &self,
405 params: &PkiCrossSignRequest,
406 ) -> impl Future<Output = Result<PkiCertificate, VaultError>> + Send;
407
408 fn read_acme_config(&self) -> impl Future<Output = Result<PkiAcmeConfig, VaultError>> + Send;
409
410 fn write_acme_config(
411 &self,
412 config: &PkiAcmeConfig,
413 ) -> impl Future<Output = Result<(), VaultError>> + Send;
414
415 fn rotate_delta_crl(&self) -> impl Future<Output = Result<(), VaultError>> + Send;
416
417 fn read_crl(&self) -> impl Future<Output = Result<Vec<u8>, VaultError>> + Send;
418
419 fn read_crl_delta(&self) -> impl Future<Output = Result<Vec<u8>, VaultError>> + Send;
420}
421
422pub trait SysOperations: Send + Sync {
427 fn health(&self) -> impl Future<Output = Result<HealthResponse, VaultError>> + Send;
428 fn leader(&self) -> impl Future<Output = Result<LeaderResponse, VaultError>> + Send;
429 fn seal_status(&self) -> impl Future<Output = Result<SealStatus, VaultError>> + Send;
430 fn seal(&self) -> impl Future<Output = Result<(), VaultError>> + Send;
431 fn unseal(
432 &self,
433 key: &SecretString,
434 ) -> impl Future<Output = Result<SealStatus, VaultError>> + Send;
435 fn init(
436 &self,
437 params: &InitParams,
438 ) -> impl Future<Output = Result<InitResponse, VaultError>> + Send;
439 fn step_down(&self) -> impl Future<Output = Result<(), VaultError>> + Send;
440 fn list_mounts(
441 &self,
442 ) -> impl Future<Output = Result<HashMap<String, MountInfo>, VaultError>> + Send;
443 fn mount(
444 &self,
445 path: &str,
446 params: &MountParams,
447 ) -> impl Future<Output = Result<(), VaultError>> + Send;
448 fn unmount(&self, path: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
449 fn tune_mount(
450 &self,
451 path: &str,
452 params: &MountTuneParams,
453 ) -> impl Future<Output = Result<(), VaultError>> + Send;
454 fn read_mount_tune(
455 &self,
456 path: &str,
457 ) -> impl Future<Output = Result<MountConfig, VaultError>> + Send;
458 fn list_auth_mounts(
459 &self,
460 ) -> impl Future<Output = Result<HashMap<String, AuthMountInfo>, VaultError>> + Send;
461 fn enable_auth(
462 &self,
463 path: &str,
464 params: &AuthMountParams,
465 ) -> impl Future<Output = Result<(), VaultError>> + Send;
466 fn disable_auth(&self, path: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
467 fn read_auth_tune(
468 &self,
469 path: &str,
470 ) -> impl Future<Output = Result<MountConfig, VaultError>> + Send;
471 fn list_policies(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
472 fn read_policy(
473 &self,
474 name: &str,
475 ) -> impl Future<Output = Result<PolicyInfo, VaultError>> + Send;
476 fn write_policy(
477 &self,
478 name: &str,
479 rules: &str,
480 ) -> impl Future<Output = Result<(), VaultError>> + Send;
481 fn delete_policy(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
482 fn read_lease(
483 &self,
484 lease_id: &str,
485 ) -> impl Future<Output = Result<LeaseInfo, VaultError>> + Send;
486 fn renew_lease(
487 &self,
488 lease_id: &str,
489 increment: Option<&str>,
490 ) -> impl Future<Output = Result<LeaseRenewal, VaultError>> + Send;
491 fn revoke_lease(&self, lease_id: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
492 fn revoke_prefix(&self, prefix: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
493 fn list_audit_devices(
494 &self,
495 ) -> impl Future<Output = Result<HashMap<String, AuditDevice>, VaultError>> + Send;
496 fn enable_audit(
497 &self,
498 path: &str,
499 params: &AuditParams,
500 ) -> impl Future<Output = Result<(), VaultError>> + Send;
501 fn disable_audit(&self, path: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
502 fn unwrap<T: DeserializeOwned + Send>(
503 &self,
504 token: &SecretString,
505 ) -> impl Future<Output = Result<T, VaultError>> + Send;
506 fn wrap_lookup(
507 &self,
508 token: &SecretString,
509 ) -> impl Future<Output = Result<WrapInfo, VaultError>> + Send;
510 fn capabilities(
511 &self,
512 token: &SecretString,
513 paths: &[&str],
514 ) -> impl Future<Output = Result<HashMap<String, Vec<String>>, VaultError>> + Send;
515 fn capabilities_self(
516 &self,
517 paths: &[&str],
518 ) -> impl Future<Output = Result<HashMap<String, Vec<String>>, VaultError>> + Send;
519 fn key_status(&self) -> impl Future<Output = Result<KeyStatus, VaultError>> + Send;
520 fn rotate_encryption_key(&self) -> impl Future<Output = Result<(), VaultError>> + Send;
521
522 fn list_plugins(
524 &self,
525 plugin_type: &str,
526 ) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
527 fn read_plugin(
528 &self,
529 plugin_type: &str,
530 name: &str,
531 ) -> impl Future<Output = Result<PluginInfo, VaultError>> + Send;
532 fn register_plugin(
533 &self,
534 params: &RegisterPluginRequest,
535 ) -> impl Future<Output = Result<(), VaultError>> + Send;
536 fn deregister_plugin(
537 &self,
538 plugin_type: &str,
539 name: &str,
540 ) -> impl Future<Output = Result<(), VaultError>> + Send;
541 fn reload_plugin(&self, plugin: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
542
543 fn raft_config(&self) -> impl Future<Output = Result<RaftConfig, VaultError>> + Send;
545 fn raft_autopilot_state(
546 &self,
547 ) -> impl Future<Output = Result<AutopilotState, VaultError>> + Send;
548 fn raft_remove_peer(
549 &self,
550 server_id: &str,
551 ) -> impl Future<Output = Result<(), VaultError>> + Send;
552 fn raft_snapshot(&self) -> impl Future<Output = Result<Vec<u8>, VaultError>> + Send;
553 fn raft_snapshot_restore(
554 &self,
555 snapshot: &[u8],
556 ) -> impl Future<Output = Result<(), VaultError>> + Send;
557
558 fn in_flight_requests(
560 &self,
561 ) -> impl Future<Output = Result<HashMap<String, InFlightRequest>, VaultError>> + Send;
562
563 fn list_namespaces(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
565 fn create_namespace(
566 &self,
567 path: &str,
568 ) -> impl Future<Output = Result<NamespaceInfo, VaultError>> + Send;
569 fn delete_namespace(&self, path: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
570
571 fn list_rate_limit_quotas(
573 &self,
574 ) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
575 fn read_rate_limit_quota(
576 &self,
577 name: &str,
578 ) -> impl Future<Output = Result<RateLimitQuota, VaultError>> + Send;
579 fn write_rate_limit_quota(
580 &self,
581 name: &str,
582 params: &RateLimitQuotaRequest,
583 ) -> impl Future<Output = Result<(), VaultError>> + Send;
584 fn delete_rate_limit_quota(
585 &self,
586 name: &str,
587 ) -> impl Future<Output = Result<(), VaultError>> + Send;
588
589 fn rekey_init(
591 &self,
592 params: &RekeyInitRequest,
593 ) -> impl Future<Output = Result<RekeyStatus, VaultError>> + Send;
594 fn rekey_status(&self) -> impl Future<Output = Result<RekeyStatus, VaultError>> + Send;
595 fn rekey_cancel(&self) -> impl Future<Output = Result<(), VaultError>> + Send;
596 fn rekey_update(
597 &self,
598 key: &SecretString,
599 nonce: &str,
600 ) -> impl Future<Output = Result<RekeyStatus, VaultError>> + Send;
601
602 fn generate_root_init(
604 &self,
605 params: &GenerateRootInitRequest,
606 ) -> impl Future<Output = Result<GenerateRootStatus, VaultError>> + Send;
607 fn generate_root_status(
608 &self,
609 ) -> impl Future<Output = Result<GenerateRootStatus, VaultError>> + Send;
610 fn generate_root_cancel(&self) -> impl Future<Output = Result<(), VaultError>> + Send;
611 fn generate_root_update(
612 &self,
613 key: &SecretString,
614 nonce: &str,
615 ) -> impl Future<Output = Result<GenerateRootStatus, VaultError>> + Send;
616
617 fn remount(
619 &self,
620 from: &str,
621 to: &str,
622 ) -> impl Future<Output = Result<RemountStatus, VaultError>> + Send;
623
624 fn metrics_json(&self) -> impl Future<Output = Result<serde_json::Value, VaultError>> + Send;
626 fn host_info(&self) -> impl Future<Output = Result<HostInfo, VaultError>> + Send;
627 fn internal_counters_activity(
628 &self,
629 ) -> impl Future<Output = Result<serde_json::Value, VaultError>> + Send;
630 fn version_history(
631 &self,
632 ) -> impl Future<Output = Result<Vec<VersionHistoryEntry>, VaultError>> + Send;
633
634 fn rewrap(
636 &self,
637 token: &SecretString,
638 ) -> impl Future<Output = Result<WrapInfo, VaultError>> + Send;
639}
640
641pub trait TokenAuthOperations: Send + Sync {
646 fn lookup_self(&self) -> impl Future<Output = Result<TokenLookupResponse, VaultError>> + Send;
647 fn lookup(
648 &self,
649 token: &SecretString,
650 ) -> impl Future<Output = Result<TokenLookupResponse, VaultError>> + Send;
651 fn renew_self(
652 &self,
653 increment: Option<&str>,
654 ) -> impl Future<Output = Result<AuthInfo, VaultError>> + Send;
655 fn create(
656 &self,
657 params: &TokenCreateRequest,
658 ) -> impl Future<Output = Result<AuthInfo, VaultError>> + Send;
659 fn create_orphan(
660 &self,
661 params: &TokenCreateRequest,
662 ) -> impl Future<Output = Result<AuthInfo, VaultError>> + Send;
663 fn revoke(&self, token: &SecretString) -> impl Future<Output = Result<(), VaultError>> + Send;
664 fn revoke_self(&self) -> impl Future<Output = Result<(), VaultError>> + Send;
665 fn revoke_accessor(
666 &self,
667 accessor: &str,
668 ) -> impl Future<Output = Result<(), VaultError>> + Send;
669 fn list_accessors(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
670}
671
672pub trait AppRoleAuthOperations: Send + Sync {
677 fn login(
678 &self,
679 role_id: &str,
680 secret_id: &SecretString,
681 ) -> impl Future<Output = Result<AuthInfo, VaultError>> + Send;
682 fn create_role(
683 &self,
684 name: &str,
685 params: &AppRoleCreateRequest,
686 ) -> impl Future<Output = Result<(), VaultError>> + Send;
687 fn read_role(&self, name: &str)
688 -> impl Future<Output = Result<AppRoleInfo, VaultError>> + Send;
689 fn delete_role(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
690 fn list_roles(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
691 fn read_role_id(&self, name: &str) -> impl Future<Output = Result<String, VaultError>> + Send;
692 fn generate_secret_id(
693 &self,
694 name: &str,
695 ) -> impl Future<Output = Result<AppRoleSecretIdResponse, VaultError>> + Send;
696 fn destroy_secret_id(
697 &self,
698 name: &str,
699 secret_id: &SecretString,
700 ) -> impl Future<Output = Result<(), VaultError>> + Send;
701}
702
703pub trait K8sAuthOperations: Send + Sync {
708 fn login(
709 &self,
710 role: &str,
711 jwt: &SecretString,
712 ) -> impl Future<Output = Result<AuthInfo, VaultError>> + Send;
713 fn configure(
714 &self,
715 config: &K8sAuthConfigRequest,
716 ) -> impl Future<Output = Result<(), VaultError>> + Send;
717 fn create_role(
718 &self,
719 name: &str,
720 params: &K8sAuthRoleRequest,
721 ) -> impl Future<Output = Result<(), VaultError>> + Send;
722 fn read_role(
723 &self,
724 name: &str,
725 ) -> impl Future<Output = Result<K8sAuthRoleInfo, VaultError>> + Send;
726 fn delete_role(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
727 fn list_roles(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
728}
729
730pub trait UserpassAuthOperations: Send + Sync {
735 fn login(
736 &self,
737 username: &str,
738 password: &SecretString,
739 ) -> impl Future<Output = Result<AuthInfo, VaultError>> + Send;
740 fn create_user(
741 &self,
742 username: &str,
743 params: &UserpassUserRequest,
744 ) -> impl Future<Output = Result<(), VaultError>> + Send;
745 fn read_user(
746 &self,
747 username: &str,
748 ) -> impl Future<Output = Result<UserpassUserInfo, VaultError>> + Send;
749 fn delete_user(&self, username: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
750 fn list_users(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
751 fn update_password(
752 &self,
753 username: &str,
754 password: &SecretString,
755 ) -> impl Future<Output = Result<(), VaultError>> + Send;
756}
757
758pub trait LdapAuthOperations: Send + Sync {
763 fn login(
764 &self,
765 username: &str,
766 password: &SecretString,
767 ) -> impl Future<Output = Result<AuthInfo, VaultError>> + Send;
768 fn configure(
769 &self,
770 config: &LdapConfigRequest,
771 ) -> impl Future<Output = Result<(), VaultError>> + Send;
772 fn read_config(&self) -> impl Future<Output = Result<LdapConfig, VaultError>> + Send;
773 fn write_group(
774 &self,
775 name: &str,
776 params: &LdapGroupRequest,
777 ) -> impl Future<Output = Result<(), VaultError>> + Send;
778 fn read_group(&self, name: &str) -> impl Future<Output = Result<LdapGroup, VaultError>> + Send;
779 fn delete_group(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
780 fn list_groups(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
781 fn write_user(
782 &self,
783 name: &str,
784 params: &LdapUserRequest,
785 ) -> impl Future<Output = Result<(), VaultError>> + Send;
786 fn read_user(&self, name: &str) -> impl Future<Output = Result<LdapUser, VaultError>> + Send;
787 fn delete_user(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
788 fn list_users(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
789}
790
791pub trait CertAuthOperations: Send + Sync {
796 fn login(
797 &self,
798 name: Option<&str>,
799 ) -> impl Future<Output = Result<AuthInfo, VaultError>> + Send;
800 fn create_role(
801 &self,
802 name: &str,
803 params: &CertRoleRequest,
804 ) -> impl Future<Output = Result<(), VaultError>> + Send;
805 fn read_role(
806 &self,
807 name: &str,
808 ) -> impl Future<Output = Result<CertRoleInfo, VaultError>> + Send;
809 fn delete_role(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
810 fn list_roles(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
811}
812
813pub trait GithubAuthOperations: Send + Sync {
818 fn login(
819 &self,
820 token: &SecretString,
821 ) -> impl Future<Output = Result<AuthInfo, VaultError>> + Send;
822 fn configure(
823 &self,
824 config: &GithubConfigRequest,
825 ) -> impl Future<Output = Result<(), VaultError>> + Send;
826 fn read_config(&self) -> impl Future<Output = Result<GithubConfig, VaultError>> + Send;
827 fn map_team(
828 &self,
829 team: &str,
830 params: &GithubTeamMapping,
831 ) -> impl Future<Output = Result<(), VaultError>> + Send;
832 fn read_team_mapping(
833 &self,
834 team: &str,
835 ) -> impl Future<Output = Result<GithubTeamInfo, VaultError>> + Send;
836 fn list_teams(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
837}
838
839pub trait OidcAuthOperations: Send + Sync {
844 fn login_jwt(
845 &self,
846 role: &str,
847 jwt: &SecretString,
848 ) -> impl Future<Output = Result<AuthInfo, VaultError>> + Send;
849 fn configure(
850 &self,
851 config: &OidcConfigRequest,
852 ) -> impl Future<Output = Result<(), VaultError>> + Send;
853 fn read_config(&self) -> impl Future<Output = Result<OidcConfig, VaultError>> + Send;
854 fn create_role(
855 &self,
856 name: &str,
857 params: &OidcRoleRequest,
858 ) -> impl Future<Output = Result<(), VaultError>> + Send;
859 fn read_role(
860 &self,
861 name: &str,
862 ) -> impl Future<Output = Result<OidcRoleInfo, VaultError>> + Send;
863 fn delete_role(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
864 fn list_roles(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
865}
866
867pub trait DatabaseOperations: Send + Sync {
872 fn configure(
873 &self,
874 name: &str,
875 params: &DatabaseConfigRequest,
876 ) -> impl Future<Output = Result<(), VaultError>> + Send;
877 fn read_config(
878 &self,
879 name: &str,
880 ) -> impl Future<Output = Result<DatabaseConfig, VaultError>> + Send;
881 fn delete_config(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
882 fn list_connections(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
883 fn reset_connection(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
884 fn create_role(
885 &self,
886 name: &str,
887 params: &DatabaseRoleRequest,
888 ) -> impl Future<Output = Result<(), VaultError>> + Send;
889 fn read_role(
890 &self,
891 name: &str,
892 ) -> impl Future<Output = Result<DatabaseRole, VaultError>> + Send;
893 fn delete_role(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
894 fn list_roles(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
895 fn get_credentials(
896 &self,
897 role: &str,
898 ) -> impl Future<Output = Result<DatabaseCredentials, VaultError>> + Send;
899 fn create_static_role(
900 &self,
901 name: &str,
902 params: &DatabaseStaticRoleRequest,
903 ) -> impl Future<Output = Result<(), VaultError>> + Send;
904 fn read_static_role(
905 &self,
906 name: &str,
907 ) -> impl Future<Output = Result<DatabaseStaticRole, VaultError>> + Send;
908 fn delete_static_role(&self, name: &str)
909 -> impl Future<Output = Result<(), VaultError>> + Send;
910 fn list_static_roles(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
911 fn get_static_credentials(
912 &self,
913 name: &str,
914 ) -> impl Future<Output = Result<DatabaseStaticCredentials, VaultError>> + Send;
915 fn rotate_static_role(&self, name: &str)
916 -> impl Future<Output = Result<(), VaultError>> + Send;
917}
918
919pub trait SshOperations: Send + Sync {
924 fn configure_ca(
925 &self,
926 params: &SshCaConfigRequest,
927 ) -> impl Future<Output = Result<(), VaultError>> + Send;
928 fn read_public_key(&self) -> impl Future<Output = Result<SshCaPublicKey, VaultError>> + Send;
929 fn delete_ca(&self) -> impl Future<Output = Result<(), VaultError>> + Send;
930 fn create_role(
931 &self,
932 name: &str,
933 params: &SshRoleRequest,
934 ) -> impl Future<Output = Result<(), VaultError>> + Send;
935 fn read_role(&self, name: &str) -> impl Future<Output = Result<SshRole, VaultError>> + Send;
936 fn delete_role(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
937 fn list_roles(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
938 fn sign_key(
939 &self,
940 role: &str,
941 params: &SshSignRequest,
942 ) -> impl Future<Output = Result<SshSignedKey, VaultError>> + Send;
943 fn verify_otp(
944 &self,
945 params: &SshVerifyRequest,
946 ) -> impl Future<Output = Result<SshVerifyResponse, VaultError>> + Send;
947}
948
949pub trait IdentityOperations: Send + Sync {
954 fn create_entity(
955 &self,
956 params: &EntityCreateRequest,
957 ) -> impl Future<Output = Result<Entity, VaultError>> + Send;
958 fn read_entity(&self, id: &str) -> impl Future<Output = Result<Entity, VaultError>> + Send;
959 fn read_entity_by_name(
960 &self,
961 name: &str,
962 ) -> impl Future<Output = Result<Entity, VaultError>> + Send;
963 fn update_entity(
964 &self,
965 id: &str,
966 params: &EntityCreateRequest,
967 ) -> impl Future<Output = Result<(), VaultError>> + Send;
968 fn delete_entity(&self, id: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
969 fn list_entities(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
970 fn create_entity_alias(
971 &self,
972 params: &EntityAliasCreateRequest,
973 ) -> impl Future<Output = Result<EntityAliasResponse, VaultError>> + Send;
974 fn read_entity_alias(
975 &self,
976 id: &str,
977 ) -> impl Future<Output = Result<EntityAliasResponse, VaultError>> + Send;
978 fn delete_entity_alias(&self, id: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
979 fn list_entity_aliases(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
980 fn create_group(
981 &self,
982 params: &GroupCreateRequest,
983 ) -> impl Future<Output = Result<Group, VaultError>> + Send;
984 fn read_group(&self, id: &str) -> impl Future<Output = Result<Group, VaultError>> + Send;
985 fn read_group_by_name(
986 &self,
987 name: &str,
988 ) -> impl Future<Output = Result<Group, VaultError>> + Send;
989 fn update_group(
990 &self,
991 id: &str,
992 params: &GroupCreateRequest,
993 ) -> impl Future<Output = Result<(), VaultError>> + Send;
994 fn delete_group(&self, id: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
995 fn list_groups(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
996 fn create_group_alias(
997 &self,
998 params: &GroupAliasCreateRequest,
999 ) -> impl Future<Output = Result<GroupAliasResponse, VaultError>> + Send;
1000 fn read_group_alias(
1001 &self,
1002 id: &str,
1003 ) -> impl Future<Output = Result<GroupAliasResponse, VaultError>> + Send;
1004 fn delete_group_alias(&self, id: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
1005 fn list_group_aliases(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
1006}
1007
1008pub trait AwsSecretsOperations: Send + Sync {
1013 fn configure_root(
1014 &self,
1015 params: &AwsConfigRootRequest,
1016 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1017 fn read_config_root(&self) -> impl Future<Output = Result<AwsConfigRoot, VaultError>> + Send;
1018 fn rotate_root(&self) -> impl Future<Output = Result<(), VaultError>> + Send;
1019 fn create_role(
1020 &self,
1021 name: &str,
1022 params: &AwsRoleRequest,
1023 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1024 fn read_role(&self, name: &str) -> impl Future<Output = Result<AwsRole, VaultError>> + Send;
1025 fn delete_role(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
1026 fn list_roles(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
1027 fn get_credentials(
1028 &self,
1029 name: &str,
1030 ) -> impl Future<Output = Result<AwsCredentials, VaultError>> + Send;
1031 fn get_sts_credentials(
1032 &self,
1033 name: &str,
1034 params: &AwsStsRequest,
1035 ) -> impl Future<Output = Result<AwsCredentials, VaultError>> + Send;
1036}
1037
1038pub trait AwsAuthOperations: Send + Sync {
1043 fn login(
1044 &self,
1045 params: &AwsAuthLoginRequest,
1046 ) -> impl Future<Output = Result<AuthInfo, VaultError>> + Send;
1047 fn configure(
1048 &self,
1049 config: &AwsAuthConfigRequest,
1050 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1051 fn read_config(&self) -> impl Future<Output = Result<AwsAuthConfig, VaultError>> + Send;
1052 fn create_role(
1053 &self,
1054 name: &str,
1055 params: &AwsAuthRoleRequest,
1056 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1057 fn read_role(
1058 &self,
1059 name: &str,
1060 ) -> impl Future<Output = Result<AwsAuthRoleInfo, VaultError>> + Send;
1061 fn delete_role(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
1062 fn list_roles(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
1063}
1064
1065pub trait TotpOperations: Send + Sync {
1070 fn create_key(
1071 &self,
1072 name: &str,
1073 params: &TotpKeyRequest,
1074 ) -> impl Future<Output = Result<Option<TotpGenerateResponse>, VaultError>> + Send;
1075 fn read_key(&self, name: &str) -> impl Future<Output = Result<TotpKeyInfo, VaultError>> + Send;
1076 fn delete_key(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
1077 fn list_keys(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
1078 fn generate_code(
1079 &self,
1080 name: &str,
1081 ) -> impl Future<Output = Result<TotpCode, VaultError>> + Send;
1082 fn validate_code(
1083 &self,
1084 name: &str,
1085 code: &str,
1086 ) -> impl Future<Output = Result<TotpValidation, VaultError>> + Send;
1087}
1088
1089pub trait ConsulOperations: Send + Sync {
1094 fn configure(
1095 &self,
1096 params: &ConsulConfigRequest,
1097 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1098 fn read_config(&self) -> impl Future<Output = Result<ConsulConfig, VaultError>> + Send;
1099 fn delete_config(&self) -> impl Future<Output = Result<(), VaultError>> + Send;
1100 fn create_role(
1101 &self,
1102 name: &str,
1103 params: &ConsulRoleRequest,
1104 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1105 fn read_role(&self, name: &str) -> impl Future<Output = Result<ConsulRole, VaultError>> + Send;
1106 fn delete_role(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
1107 fn list_roles(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
1108 fn get_credentials(
1109 &self,
1110 role: &str,
1111 ) -> impl Future<Output = Result<ConsulCredentials, VaultError>> + Send;
1112}
1113
1114pub trait NomadOperations: Send + Sync {
1119 fn configure(
1120 &self,
1121 params: &NomadConfigRequest,
1122 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1123 fn read_config(&self) -> impl Future<Output = Result<NomadConfig, VaultError>> + Send;
1124 fn delete_config(&self) -> impl Future<Output = Result<(), VaultError>> + Send;
1125 fn create_role(
1126 &self,
1127 name: &str,
1128 params: &NomadRoleRequest,
1129 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1130 fn read_role(&self, name: &str) -> impl Future<Output = Result<NomadRole, VaultError>> + Send;
1131 fn delete_role(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
1132 fn list_roles(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
1133 fn get_credentials(
1134 &self,
1135 role: &str,
1136 ) -> impl Future<Output = Result<NomadCredentials, VaultError>> + Send;
1137}
1138
1139pub trait AzureSecretsOperations: Send + Sync {
1144 fn configure(
1145 &self,
1146 params: &AzureConfigRequest,
1147 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1148 fn read_config(&self) -> impl Future<Output = Result<AzureConfig, VaultError>> + Send;
1149 fn delete_config(&self) -> impl Future<Output = Result<(), VaultError>> + Send;
1150 fn create_role(
1151 &self,
1152 name: &str,
1153 params: &AzureRoleRequest,
1154 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1155 fn read_role(&self, name: &str) -> impl Future<Output = Result<AzureRole, VaultError>> + Send;
1156 fn delete_role(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
1157 fn list_roles(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
1158 fn get_credentials(
1159 &self,
1160 role: &str,
1161 ) -> impl Future<Output = Result<AzureCredentials, VaultError>> + Send;
1162}
1163
1164pub trait AzureAuthOperations: Send + Sync {
1169 fn login(
1170 &self,
1171 role: &str,
1172 jwt: &SecretString,
1173 subscription_id: Option<&str>,
1174 resource_group_name: Option<&str>,
1175 vm_name: Option<&str>,
1176 vmss_name: Option<&str>,
1177 ) -> impl Future<Output = Result<AuthInfo, VaultError>> + Send;
1178 fn configure(
1179 &self,
1180 config: &AzureAuthConfigRequest,
1181 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1182 fn read_config(&self) -> impl Future<Output = Result<AzureAuthConfig, VaultError>> + Send;
1183 fn create_role(
1184 &self,
1185 name: &str,
1186 params: &AzureAuthRoleRequest,
1187 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1188 fn read_role(
1189 &self,
1190 name: &str,
1191 ) -> impl Future<Output = Result<AzureAuthRoleInfo, VaultError>> + Send;
1192 fn delete_role(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
1193 fn list_roles(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
1194}
1195
1196pub trait GcpSecretsOperations: Send + Sync {
1201 fn configure(
1202 &self,
1203 params: &GcpConfigRequest,
1204 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1205 fn read_config(&self) -> impl Future<Output = Result<GcpConfig, VaultError>> + Send;
1206 fn delete_config(&self) -> impl Future<Output = Result<(), VaultError>> + Send;
1207 fn create_roleset(
1208 &self,
1209 name: &str,
1210 params: &GcpRolesetRequest,
1211 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1212 fn read_roleset(
1213 &self,
1214 name: &str,
1215 ) -> impl Future<Output = Result<GcpRoleset, VaultError>> + Send;
1216 fn delete_roleset(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
1217 fn list_rolesets(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
1218 fn get_service_account_key(
1219 &self,
1220 roleset: &str,
1221 ) -> impl Future<Output = Result<GcpServiceAccountKey, VaultError>> + Send;
1222 fn get_oauth_token(
1223 &self,
1224 roleset: &str,
1225 ) -> impl Future<Output = Result<GcpOAuthToken, VaultError>> + Send;
1226 fn rotate_roleset(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
1227}
1228
1229pub trait GcpAuthOperations: Send + Sync {
1234 fn login(
1235 &self,
1236 role: &str,
1237 jwt: &SecretString,
1238 ) -> impl Future<Output = Result<AuthInfo, VaultError>> + Send;
1239 fn configure(
1240 &self,
1241 config: &GcpAuthConfigRequest,
1242 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1243 fn read_config(&self) -> impl Future<Output = Result<GcpAuthConfig, VaultError>> + Send;
1244 fn create_role(
1245 &self,
1246 name: &str,
1247 params: &GcpAuthRoleRequest,
1248 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1249 fn read_role(
1250 &self,
1251 name: &str,
1252 ) -> impl Future<Output = Result<GcpAuthRoleInfo, VaultError>> + Send;
1253 fn delete_role(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
1254 fn list_roles(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
1255}
1256
1257pub trait RabbitmqOperations: Send + Sync {
1262 fn configure(
1263 &self,
1264 params: &RabbitmqConfigRequest,
1265 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1266 fn configure_lease(
1267 &self,
1268 ttl: &str,
1269 max_ttl: &str,
1270 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1271 fn create_role(
1272 &self,
1273 name: &str,
1274 params: &RabbitmqRoleRequest,
1275 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1276 fn read_role(
1277 &self,
1278 name: &str,
1279 ) -> impl Future<Output = Result<RabbitmqRole, VaultError>> + Send;
1280 fn delete_role(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
1281 fn list_roles(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
1282 fn get_credentials(
1283 &self,
1284 role: &str,
1285 ) -> impl Future<Output = Result<RabbitmqCredentials, VaultError>> + Send;
1286}
1287
1288pub trait TerraformCloudOperations: Send + Sync {
1293 fn configure(
1294 &self,
1295 params: &TerraformCloudConfigRequest,
1296 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1297 fn read_config(&self) -> impl Future<Output = Result<TerraformCloudConfig, VaultError>> + Send;
1298 fn delete_config(&self) -> impl Future<Output = Result<(), VaultError>> + Send;
1299 fn create_role(
1300 &self,
1301 name: &str,
1302 params: &TerraformCloudRoleRequest,
1303 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1304 fn read_role(
1305 &self,
1306 name: &str,
1307 ) -> impl Future<Output = Result<TerraformCloudRole, VaultError>> + Send;
1308 fn delete_role(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
1309 fn list_roles(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
1310 fn get_credentials(
1311 &self,
1312 role: &str,
1313 ) -> impl Future<Output = Result<TerraformCloudToken, VaultError>> + Send;
1314}
1315
1316pub trait RadiusAuthOperations: Send + Sync {
1321 fn login(
1322 &self,
1323 username: &str,
1324 password: &SecretString,
1325 ) -> impl Future<Output = Result<AuthInfo, VaultError>> + Send;
1326 fn configure(
1327 &self,
1328 config: &RadiusConfigRequest,
1329 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1330 fn read_config(&self) -> impl Future<Output = Result<RadiusConfig, VaultError>> + Send;
1331 fn write_user(
1332 &self,
1333 username: &str,
1334 params: &RadiusUserRequest,
1335 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1336 fn read_user(
1337 &self,
1338 username: &str,
1339 ) -> impl Future<Output = Result<RadiusUser, VaultError>> + Send;
1340 fn delete_user(&self, username: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
1341 fn list_users(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
1342}
1343
1344pub trait KerberosAuthOperations: Send + Sync {
1349 fn login(
1350 &self,
1351 authorization: &str,
1352 ) -> impl Future<Output = Result<AuthInfo, VaultError>> + Send;
1353 fn configure(
1354 &self,
1355 config: &KerberosConfigRequest,
1356 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1357 fn read_config(&self) -> impl Future<Output = Result<KerberosConfig, VaultError>> + Send;
1358 fn configure_ldap(
1359 &self,
1360 config: &KerberosLdapConfigRequest,
1361 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1362 fn read_ldap_config(
1363 &self,
1364 ) -> impl Future<Output = Result<KerberosLdapConfig, VaultError>> + Send;
1365 fn write_group(
1366 &self,
1367 name: &str,
1368 params: &KerberosGroupRequest,
1369 ) -> impl Future<Output = Result<(), VaultError>> + Send;
1370 fn read_group(
1371 &self,
1372 name: &str,
1373 ) -> impl Future<Output = Result<KerberosGroup, VaultError>> + Send;
1374 fn delete_group(&self, name: &str) -> impl Future<Output = Result<(), VaultError>> + Send;
1375 fn list_groups(&self) -> impl Future<Output = Result<Vec<String>, VaultError>> + Send;
1376}