proxmox/proxmox-api-macro/tests/api1.rs
Wolfgang Bumiller a646146f75 replace builder-pattern api macro parser with json
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-26 12:12:49 +01:00

52 lines
1.1 KiB
Rust

#![allow(dead_code)]
use proxmox::api::{ApiMethod, RpcEnvironment};
use proxmox_api_macro::api;
use failure::Error;
use serde_json::Value;
#[api]
#[input({
type: Object,
elements: {
username: {
type: String,
description: "User name",
max_length: 64,
},
password: {
type: String,
description: "The secret password or a valid ticket.",
},
}
})]
#[returns({
type: Object,
description: "Returns a ticket",
elements: {
"username": {
type: String,
description: "User name.",
},
"ticket": {
type: String,
description: "Auth ticket.",
},
"CSRFPreventionToken": {
type: String,
description: "Cross Site Request Forgerty Prevention Token.",
},
},
})]
/// Create or verify authentication ticket.
///
/// Returns: ...
fn create_ticket(
_param: Value,
_info: &ApiMethod,
_rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> {
panic!("implement me");
}