use ahash::HashMap;
use lasso2::{Rodeo, Spur};
pub type ScopeId = Spur;
pub type ScopeInterner = Rodeo;
#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ScopeAndGroup(pub Vec<ScopeId>);
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RequiredScopes(pub Vec<ScopeAndGroup>);
#[derive(Debug, Clone)]
pub enum AuthorizationRule {
Authenticated,
RequiresScopes(RequiredScopes),
}
pub type TypeRulesMap = HashMap<String, AuthorizationRule>;
pub type FieldRulesMap = HashMap<String, AuthorizationRule>;
pub type TypeFieldRulesMap = HashMap<String, FieldRulesMap>;
#[derive(Debug)]
pub struct AuthorizationMetadata {
pub type_rules: TypeRulesMap,
pub field_rules: TypeFieldRulesMap,
pub scopes: ScopeInterner,
pub type_has_any_auth: HashMap<String, bool>,
}