Stage 3: leeres DTRACK_PERMISSIONS = nicht gesetzt (Compose-sicher)
CI / test (push) Has been cancelled
CI / test (push) Has been cancelled
This commit is contained in:
@@ -27,9 +27,12 @@ pub enum Gate {
|
||||
|
||||
impl Gate {
|
||||
/// `DTRACK_PERMISSIONS` (Policy-Datei) hat Vorrang, sonst flache Liste aus
|
||||
/// `DTRACK_HTTP_TOKENS`.
|
||||
/// `DTRACK_HTTP_TOKENS`. Ein leeres `DTRACK_PERMISSIONS` zaehlt als "nicht
|
||||
/// gesetzt" (Compose reicht leere Variablen durch).
|
||||
pub fn from_env() -> anyhow::Result<Self> {
|
||||
if let Ok(path) = std::env::var("DTRACK_PERMISSIONS") {
|
||||
if let Ok(path) = std::env::var("DTRACK_PERMISSIONS")
|
||||
&& !path.trim().is_empty()
|
||||
{
|
||||
let policy = Policy::load(&path)?;
|
||||
tracing::info!("RBAC aktiv: {} Client(s) aus {path}", policy.client_count());
|
||||
return Ok(Self::Rbac(Arc::new(policy)));
|
||||
|
||||
Reference in New Issue
Block a user