vaultrs/api/auth/cert/
requests.rs1use rustify_derive::Endpoint;
2
3use super::responses::{ListCaCertificateRoleResponse, ReadCaCertificateRoleResponse};
4
5#[derive(Builder, Debug, Default, Endpoint)]
13#[endpoint(
14 path = "/auth/{self.mount}/certs/{self.name}",
15 method = "POST",
16 builder = "true"
17)]
18#[builder(setter(into, strip_option), default)]
19pub struct CreateCaCertificateRoleRequest {
20 #[endpoint(skip)]
21 pub mount: String,
22 #[endpoint(skip)]
23 pub name: String,
24 pub certificate: String,
25 pub allowed_common_names: Option<Vec<String>>,
26 pub allowed_dns_sans: Option<Vec<String>>,
27 pub allowed_email_sans: Option<Vec<String>>,
28 pub allowed_uri_sans: Option<Vec<String>>,
29 pub allowed_organizational_units: Option<Vec<String>>,
30 pub required_extensions: Option<Vec<String>>,
31 pub allowed_metadata_extensions: Option<Vec<String>>,
32 pub ocsp_enabled: Option<bool>,
33 pub ocsp_ca_certificates: Option<String>,
34 pub ocsp_servers_override: Option<Vec<String>>,
35 pub ocsp_fail_open: Option<bool>,
36 pub ocsp_query_all_servers: Option<bool>,
37 pub display_name: Option<String>,
38 pub token_ttl: Option<String>,
39 pub token_max_ttl: Option<String>,
40 pub token_policies: Option<Vec<String>>,
41 pub token_bound_cidrs: Option<Vec<String>>,
42 pub token_explicit_max_ttl: Option<String>,
43 pub token_no_default_policy: Option<bool>,
44 pub token_num_uses: Option<u64>,
45 pub token_period: Option<String>,
46 pub token_type: Option<String>,
47}
48
49#[derive(Builder, Debug, Default, Endpoint)]
57#[endpoint(
58 path = "/auth/{self.mount}/certs/{self.name}",
59 response = "ReadCaCertificateRoleResponse",
60 builder = "true"
61)]
62#[builder(setter(into, strip_option), default)]
63pub struct ReadCaCertificateRoleRequest {
64 #[endpoint(skip)]
65 pub mount: String,
66 #[endpoint(skip)]
67 pub name: String,
68}
69
70#[derive(Builder, Debug, Default, Endpoint)]
78#[endpoint(
79 path = "/auth/{self.mount}/certs/{self.name}",
80 method = "DELETE",
81 builder = "true"
82)]
83#[builder(setter(into, strip_option), default)]
84pub struct DeleteCaCertificateRoleRequest {
85 #[endpoint(skip)]
86 pub mount: String,
87 #[endpoint(skip)]
88 pub name: String,
89}
90
91#[derive(Builder, Debug, Default, Endpoint)]
99#[endpoint(
100 path = "/auth/{self.mount}/certs",
101 method = "LIST",
102 response = "ListCaCertificateRoleResponse",
103 builder = "true"
104)]
105#[builder(setter(into, strip_option), default)]
106pub struct ListCaCertificateRoleRequest {
107 #[endpoint(skip)]
108 pub mount: String,
109}
110
111#[derive(Builder, Debug, Default, Endpoint)]
119#[endpoint(path = "/auth/{self.mount}/config", method = "POST", builder = "true")]
120#[builder(setter(into, strip_option), default)]
121pub struct ConfigureTlsCertificateMethod {
122 #[endpoint(skip)]
123 pub mount: String,
124 disable_binding: Option<bool>,
126 enable_identity_alias_metadata: Option<bool>,
128 ocsp_cache_size: Option<u64>,
130 role_cache_size: Option<u64>,
132}
133
134#[derive(Builder, Debug, Default, Endpoint)]
143#[endpoint(path = "/auth/{self.mount}/login", method = "POST", builder = "true")]
144#[builder(setter(into, strip_option), default)]
145pub struct LoginRequest {
146 #[endpoint(skip)]
147 pub mount: String,
148 pub cert_name: String,
149}