How bhatti/plexauthz works
High-Level Architecture Components
a) Client Layer:
• gRPC Clients
• REST API Clients
• Direct Database Clients
b) API Layer:
• gRPC Services (shown in api/v1/services/)
• REST Controllers
• Protocol Buffer Definitions
c) Core Services:
• Authorization Service
• Principal Service
• Resource Service
• Permission Service
• Relationship Service
• Service
• Role Service
• Organization Service
d) Domain Layer:
• Authorization Logic
• Policy Evaluation
• Template Processing
• Dynamic Condition Evaluation
e) Data Layer:
• Redis Store
• DynamoDB Store
• Repository Implementations
Component Relationships and Data Flow
a) External Interactions:
• Client requests → API Layer
• API Layer → Core Services
• Core Services → Domain Layer
• Domain Layer → Data Layer
b) Internal Flows:
• Authorization flow paths
• Data persistence paths
• Policy evaluation paths
Detailed Component Breakdown
a) Authorization Flow:
Client → AuthZService → Authorizer → PolicyEvaluator → RepositoryLayer
b) Data Model Relationships:
Organization → Principal → Resources
• ↓ ↓ ↓
• Groups Permissions Instances
• ↓ ↓
• Roles Relationships
Implementation Details
Technical aspects:
a) Service Implementations:
• GRPC Services (internal/server/)
• HTTP Services (internal/service/http/)
• Database Services (internal/service/db/)
b) Repository Layer:
• Base Repository
• Specific Entity Repositories
• Data Store Implementations
Cross-Cutting Concerns
Aspects:
• Metrics Collection
• Logging
• Error Handling
• Configuration Management
Deployment View
How the system can be deployed:
• Containerized deployment (Dockerfile present)
• Service boundaries
• Database instances
• Load balancers
Integration points
Remember to maintain a balance between detail and clarity, focusing on the architectural decisions that make PlexAuthZ unique, such as its hybrid approach to authorization and its flexible policy evaluation system.