How permitio/opal works
Main Components
a) Core Services:
• OPAL Server
• OPAL Client(s)
• Policy Engine instances (OPA/Cedar)
• Data Sources
• Policy Sources
b) Communication Layer:
• WebSocket PubSub Channel
• REST APIs
• Data Fetch Interfaces
Architectural Layers
┌─ Data Sources Layer ─────────────────┐
• APIs │
• Databases │
• Git Repositories │
• S3/Cloud Storage │
• Third-party Services │
• ┘
• ↕ (Fetch Providers)
┌─ OPAL Server Layer ──────────────────┐
• Policy Watcher │
• Data Update Publisher │
• Authentication/Security │
• Scope Management │
• ┘
• ↕ (WebSocket/PubSub)
┌─ OPAL Client Layer ──────────────────┐
• Policy Updater │
• Data Updater │
• Policy Store Client │
• Callbacks Handler │
• ┘
• ↕ (Direct Integration)
┌─ Policy Engine Layer ────────────────┐
• OPA Instances │
• Cedar Agent Instances │
• ┘
Important Details
a) Server Components:
• Policy watcher mechanisms
• Data update publisher
• WebSocket broadcast interface
• Security layer (JWT, authentication)
b) Client Components:
• Policy store client implementations
• Data fetcher system
• Update handlers
• Health check system
c) Integration Points:
• External data source connections
• Policy engine interfaces
• Monitoring/metrics endpoints
Additional Elements
• Numbered sequence indicators for key flows
• Scalability aspects (multiple clients/engines)
• Security boundaries
• Monitoring/observability points
Technical Details to Highlight
• WebSocket-based real-time updates
• Stateless architecture
• Direct data fetching paths
• Policy/data synchronization mechanisms
• Authentication/authorization flows
• Real-time policy and data synchronization
• Distributed architecture
• Support for multiple policy engines
• Extensible data source integration
• Security and authentication mechanisms
Remember to maintain a balance between detail and clarity, focusing on the core architectural components while providing enough technical detail to understand the system's operation.