1 use serde
::{Deserialize, Serialize}
;
4 use proxmox_schema
::{api, ApiType, Schema, StringSchema, ApiStringFormat}
;
7 DNS_ALIAS_FORMAT
, DNS_NAME_FORMAT
, PROXMOX_SAFE_ID_FORMAT
,
12 "domain": { format: &DNS_NAME_FORMAT }
,
15 format
: &DNS_ALIAS_FORMAT
,
19 format
: &PROXMOX_SAFE_ID_FORMAT
,
22 default_key
: "domain",
24 #[derive(Deserialize, Serialize)]
25 /// A domain entry for an ACME certificate.
26 pub struct AcmeDomain
{
27 /// The domain to certify for.
30 /// The domain to use for challenges instead of the default acme challenge domain.
32 /// This is useful if you use CNAME entries to redirect `_acme-challenge.*` domains to a
33 /// different DNS server.
34 #[serde(skip_serializing_if = "Option::is_none")]
35 pub alias
: Option
<String
>,
37 /// The plugin to use to validate this domain.
39 /// Empty means standalone HTTP validation is used.
40 #[serde(skip_serializing_if = "Option::is_none")]
41 pub plugin
: Option
<String
>,
44 pub const ACME_DOMAIN_PROPERTY_SCHEMA
: Schema
= StringSchema
::new(
45 "ACME domain configuration string")
46 .format(&ApiStringFormat
::PropertyString(&AcmeDomain
::API_SCHEMA
))
51 name
: { type: String }
,
52 url
: { type: String }
,
55 /// An ACME directory endpoint with a name and URL.
57 pub struct KnownAcmeDirectory
{
58 /// The ACME directory's name.
59 pub name
: &'
static str,
61 /// The ACME directory's endpoint URL.
62 pub url
: &'
static str,
65 proxmox_schema
::api_string_type
! {
66 #[api(format: &PROXMOX_SAFE_ID_FORMAT)]
67 /// ACME account name.
68 #[derive(Clone, Eq, PartialEq, Hash, Deserialize, Serialize)]
70 pub struct AcmeAccountName(String
);
77 additional_properties
: true,
86 /// Schema for an ACME challenge plugin.
87 pub struct AcmeChallengeSchema
{
91 /// Human readable name, falls back to id.
95 #[serde(rename = "type")]
98 /// The plugin's parameter schema.