Network access restriction for api user (#728)

* Network access restriction for api user
* Fixed strm provider:// url bug
This commit is contained in:
euzu
2026-04-23 21:15:59 +02:00
committed by GitHub
parent 60cabc71fc
commit eb2a017fa3
50 changed files with 3054 additions and 935 deletions
@@ -3992,6 +3992,7 @@ mod tests {
soft_connections,
soft_priority: 0,
t_is_api_user: false,
network_access: None,
}
}
@@ -16,6 +16,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};
use shared::model::PlaylistItemType;
use std::{fmt, net::SocketAddr, str::FromStr, sync::Arc};
use tokio_util::sync::CancellationToken;
use shared::error::TuliproxError;
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
pub enum CustomVideoStreamType {
@@ -42,7 +43,7 @@ impl fmt::Display for CustomVideoStreamType {
}
impl FromStr for CustomVideoStreamType {
type Err = String;
type Err = TuliproxError;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s.to_lowercase().as_str() {
@@ -52,7 +53,7 @@ impl FromStr for CustomVideoStreamType {
"low_priority_preempted" => Ok(Self::LowPriorityPreempted),
"user_account_expired" => Ok(Self::UserAccountExpired),
"provisioning" => Ok(Self::Provisioning),
_ => Err(format!("Unknown stream type: {s}")),
_ => Err(TuliproxError::Config(format!("Unknown stream type: {s}"))),
}
}
}