mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-01 09:37:21 +00:00
87 lines
2.1 KiB
Rust
87 lines
2.1 KiB
Rust
#![allow(dead_code)]
|
|
|
|
use proxmox_api_macro::api;
|
|
|
|
use failure::Error;
|
|
use serde_json::Value;
|
|
|
|
#[api(
|
|
input: {
|
|
properties: {
|
|
username: {
|
|
type: String,
|
|
description: "User name",
|
|
max_length: 64,
|
|
},
|
|
password: {
|
|
type: String,
|
|
description: "The secret password or a valid ticket.",
|
|
},
|
|
}
|
|
},
|
|
returns: {
|
|
properties: {
|
|
"username": {
|
|
type: String,
|
|
description: "User name.",
|
|
},
|
|
"ticket": {
|
|
type: String,
|
|
description: "Auth ticket.",
|
|
},
|
|
"CSRFPreventionToken": {
|
|
type: String,
|
|
description: "Cross Site Request Forgerty Prevention Token.",
|
|
},
|
|
},
|
|
},
|
|
protected: true,
|
|
)]
|
|
/// Create or verify authentication ticket.
|
|
///
|
|
/// Returns: A ticket.
|
|
fn create_ticket(_param: Value) -> Result<Value, Error> {
|
|
panic!("implement me");
|
|
}
|
|
|
|
#[api(
|
|
input: {
|
|
properties: {
|
|
username: {
|
|
type: String,
|
|
description: "User name",
|
|
max_length: 64,
|
|
},
|
|
password: {
|
|
type: String,
|
|
description: "The secret password or a valid ticket.",
|
|
},
|
|
}
|
|
},
|
|
returns: {
|
|
properties: {
|
|
"username": {
|
|
type: String,
|
|
description: "User name.",
|
|
},
|
|
"ticket": {
|
|
type: String,
|
|
description: "Auth ticket.",
|
|
},
|
|
"CSRFPreventionToken": {
|
|
type: String,
|
|
description: "Cross Site Request Forgerty Prevention Token.",
|
|
},
|
|
},
|
|
},
|
|
protected: true,
|
|
)]
|
|
/// Create or verify authentication ticket.
|
|
///
|
|
/// Returns: A ticket.
|
|
fn create_ticket_direct(username: String, password: String) -> Result<Value, Error> {
|
|
let _ = username;
|
|
let _ = password;
|
|
panic!("implement me");
|
|
}
|