Files
pruefwerk/compliance-core/src/models/auth.rs
T
sharang 0e7a138cd4
CI / Check (push) Skipped
CI / Detect Changes (push) Successful in 4s
CI / Deploy Docs (push) Skipped
CI / Deploy Agent (push) Successful in 7m28s
CI / Deploy Dashboard (push) Successful in 5m12s
CI / Deploy MCP (push) Successful in 3m30s
feat(access): blocked workspace members are refused (portal#74) (#471)
2026-10-05 22:21:20 +00:00

47 lines
1.7 KiB
Rust

use serde::{Deserialize, Serialize};
/// Authentication state returned by the `check_auth` server function.
///
/// When no valid session exists, `authenticated` is `false` and all
/// other fields are empty strings.
#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)]
pub struct AuthInfo {
pub authenticated: bool,
pub sub: String,
pub email: String,
pub name: String,
pub avatar_url: String,
/// The link back to the platform portal (the workspace's dashboard
/// there); empty when no portal is configured.
#[serde(default)]
pub portal_url: String,
/// The docs site this deployment links to from the sidebar.
#[serde(default)]
pub docs_url: String,
/// Holds a BreakPilot support role, so may open any tenant.
#[serde(default)]
pub staff: bool,
/// The customer tenant support has opened; `None` for everyone else and
/// for support before choosing one.
#[serde(default)]
pub support_tenant: Option<SupportTenant>,
/// What the user's org roles allow in Prüfwerk; decides whether the
/// app shows at all and whether write actions show. The agent enforces
/// the same rule on every request.
#[serde(default)]
pub access: crate::ProductAccess,
/// The workspace blocked or removed this member (portal#74): the app
/// shows only that, whatever the role allows.
#[serde(default)]
pub member_blocked: bool,
}
/// A customer tenant opened by BreakPilot support.
#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq)]
pub struct SupportTenant {
/// The registry's tenant id, sent to the agent with every request.
pub id: String,
pub slug: String,
pub name: String,
}