System Architecture
Bedrock is a modular authorization engine with three main layers:Core Components
BedrockEngine
The central authorization engine that:- Manages all authorization entities (scopes, subjects, roles, permissions, resources)
- Evaluates permission checks
- Handles inheritance and overrides
- Processes resource policies and collections
BedrockStorage
The storage interface that abstracts data persistence:| Implementation | Use Case |
|---|---|
PostgresStorage | Production deployments |
InMemoryStorage | Testing and development |
| Custom | Your own database |
REST API
Optional HTTP layer for language-agnostic access:Data Model
Evaluation Flow
Whenengine.evaluate() is called:
ID Format
All Bedrock entities use prefixed UUIDv7 IDs:| Entity | Prefix | Example |
|---|---|---|
| Scope | scope_ | scope_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b |
| Subject | subject_ | subject_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b |
| Role | role_ | role_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b |
| Permission | perm_ | perm_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b |
| Resource | resource_ | resource_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b |
| Collection | collection_ | collection_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b |
| Policy | policy_ | policy_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b |
| Scope Link | rsl_ | rsl_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b |
Deployment Options
Embedded Library
Use Bedrock directly in your application:Standalone Service
Deploy as a separate authorization service:Next Steps
Quickstart
Set up Bedrock in your application
Core Concepts
Deep dive into authorization concepts