-allow setting channel_id

This commit is contained in:
twistedddx committed 2020-08-14 23:26:42 +09:30
1 parent 9f3181e2cd
commit e4f67ef3c2
3 files changed
+11 -3

No files matched your search

+8
View File
@@ -71,6 +71,10 @@ pub struct CameraConfig {
pub stream: String,
pub permitted_users: Option<Vec<String>>,
#[validate(range(min = 0, max = 31, message = "Invalid channel", code = "channel_id"))]
#[serde(default = "default_channel_id")]
pub channel_id: u32,
}
#[derive(Debug, Deserialize, Validate, Clone)]
@@ -107,6 +111,10 @@ fn default_tls_client_auth() -> String {
"none".to_string()
}
fn default_channel_id() -> u32 {
0
}
pub static RESERVED_NAMES: &[&str] = &["anyone", "anonymous"];
fn validate_username(name: &str) -> Result<(), ValidationError> {
if name.trim().is_empty() {