How dbcdk/publizon-adapter works
Main Components
a) Client Layer:
• Browser/Client Applications
• Support for both anonymous and authenticated requests
b) Adapter Layer (Core):
• Token Validation & Authentication Handler
• Credential Management
• Request Proxy
• Headers Transformation
c) External Services:
• Smaug (Authentication/Configuration Service)
• UserInfo Service
• PubHub API (Publizon)
Key Relationships to Highlight
• Client → Adapter (with DÅP token)
• Adapter → Smaug (for configuration/validation)
• Adapter → UserInfo (for municipalityAgencyId)
• Adapter → PubHub API (proxied requests with transformed headers)
Specific Implementation Details
• Blue: Client-facing components
• Green: Core adapter components
• Yellow: External services
• Red: Security/authentication components
Component Breakdown
[Client Applications] → [Adapter Layer]
• ↓
• ┌────────────────────┼────────────────────┐
• ↓ ↓ ↓
• [Smaug Service] [UserInfo Service] [PubHub API]
Processes
a) Authentication Flow:
• Token validation
• Credential mapping
• Header transformation
b) Request Processing:
• Anonymous vs. Authenticated paths
• Required headers for different endpoints
• Error handling scenarios
Technical Details
• Environment configuration points
• HTTP endpoints mapping
• Error response scenarios
• Credential management flow
Implementation Notes
• The stateless nature of the adapter
• Security token transformation
• Header manipulation
• Error handling paths
Additional Elements
• Different request types (anonymous vs. authenticated)
• Header transformation rules
• Error scenarios
• Configuration requirements
External Services Layer (Bottom)
• Request flow
• Data transformation points
• Authentication/validation checkpoints
• Error response paths
Remember to include important configuration points:
• LOG_LEVEL
• SMAUG_URL
• PUBLIZON_URL
• USERINFO_URL
• PUBLIZON_CREDENTIALS