Add authentication methods to server config

pull/146/head
Chip Senkbeil 2 years ago
parent 47c8af6c1b
commit 55dc58888b
No known key found for this signature in database
GPG Key ID: 35EF1F8EC72A4131

@ -1,14 +1,27 @@
use crate::auth::MethodType;
use derive_more::{Display, Error};
use serde::{Deserialize, Serialize};
use std::{num::ParseFloatError, str::FromStr, time::Duration};
/// Represents a general-purpose set of properties tied with a server instance
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct ServerConfig {
/// Supported authentication methods
pub authentication_methods: Vec<MethodType>,
/// Rules for how a server will shutdown automatically
pub shutdown: Shutdown,
}
impl Default for ServerConfig {
fn default() -> Self {
Self {
authentication_methods: vec![MethodType::None],
shutdown: Shutdown::default(),
}
}
}
/// Rules for how a server will shut itself down automatically
#[derive(Copy, Clone, Debug, Display, PartialEq, Eq, Serialize, Deserialize)]
pub enum Shutdown {

Loading…
Cancel
Save