38 lines
1.3 KiB
Rust
38 lines
1.3 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>,
|
|
}
|
|
|
|
/// 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,
|
|
}
|