api: move AcmeChallengeSchema to acme types module
It will be reused in a later patch in another module which should not depend on the actual API implementation (ugly and cyclic) Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::Value;
|
||||
|
||||
use proxmox::api::{api, schema::{Schema, StringSchema, ApiStringFormat}};
|
||||
|
||||
@ -68,3 +69,32 @@ proxmox::api_string_type! {
|
||||
#[serde(transparent)]
|
||||
pub struct AcmeAccountName(String);
|
||||
}
|
||||
|
||||
#[api(
|
||||
properties: {
|
||||
schema: {
|
||||
type: Object,
|
||||
additional_properties: true,
|
||||
properties: {},
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
},
|
||||
},
|
||||
)]
|
||||
#[derive(Serialize)]
|
||||
/// Schema for an ACME challenge plugin.
|
||||
pub struct AcmeChallengeSchema {
|
||||
/// Plugin ID.
|
||||
pub id: String,
|
||||
|
||||
/// Human readable name, falls back to id.
|
||||
pub name: String,
|
||||
|
||||
/// Plugin Type.
|
||||
#[serde(rename = "type")]
|
||||
pub ty: &'static str,
|
||||
|
||||
/// The plugin's parameter schema.
|
||||
pub schema: Value,
|
||||
}
|
||||
|
Reference in New Issue
Block a user