use chrono::{DateTime, Utc};
use crate::scope::ScopeSet;
#[derive(Debug, Clone)]
pub struct Principal {
pub subject: String,
pub issuer: String,
pub tenant_id: Option<String>,
pub scopes: ScopeSet,
pub jti: Option<String>,
pub expires_at: DateTime<Utc>,
pub custom_claims: serde_json::Map<String, serde_json::Value>,
}
impl Principal {
pub fn subject(&self) -> &str {
&self.subject
}
pub fn issuer(&self) -> &str {
&self.issuer
}
pub fn tenant_id(&self) -> Option<&str> {
self.tenant_id.as_deref()
}
}