src/api2/types.rs: define PROXMOX_AUTH_REALM_SCHEMA and PROXMOX_USER_ID_SCHEMA

And try to use nbew schemas with config api...
This commit is contained in:
Dietmar Maurer
2020-01-13 14:17:22 +01:00
parent b25f313d66
commit 163dc16c0b
3 changed files with 34 additions and 8 deletions

View File

@ -16,9 +16,9 @@ lazy_static! {
// fixme: define better schemas
pub const REMOTE_HOST_SCHEMA: Schema = StringSchema::new("Host IP address or DNS name.").schema();
pub const REMOTE_USERID_SCHEMA: Schema = StringSchema::new("User ID").schema();
pub const REMOTE_PASSWORD_SCHEMA: Schema = StringSchema::new("Password or auth token.").schema();
pub const REMOTE_PASSWORD_SCHEMA: Schema = StringSchema::new("Password or auth token for remote host.")
.max_length(1024)
.schema();
#[api(
properties: {
@ -27,10 +27,10 @@ pub const REMOTE_PASSWORD_SCHEMA: Schema = StringSchema::new("Password or auth t
schema: SINGLE_LINE_COMMENT_SCHEMA,
},
host: {
schema: REMOTE_HOST_SCHEMA,
schema: DNS_NAME_OR_IP_SCHEMA,
},
userid: {
schema: REMOTE_USERID_SCHEMA,
schema: PROXMOX_USER_ID_SCHEMA,
},
password: {
schema: REMOTE_PASSWORD_SCHEMA,