from pydantic import BaseModel
from pydantic.fields import List, Dict, Optional, Any
[docs]class AuthObject(BaseModel):
tags: Optional[List[str]] = None
paths: Optional[List[str]] = None
[docs]class AuthContext(BaseModel):
predicate: str
object: AuthObject
metadata: Optional[Dict[str, Any]] = None
[docs]class PepContext(BaseModel):
user_agent: Optional[str] = None
authorization_atom_id: str
[docs]class AuthorizationRequest(BaseModel):
token: str
context: Optional[AuthContext] = None
pep_context: Optional[PepContext] = None
[docs]class AuthorizationRequestBatch(BaseModel):
token: str
contexts: Dict[str, AuthContext]