How navikt/utenlandsadresser works
Key Components to Include:
Core Application Components
• Main Application Service (app/)
• Address Fetching Service (hent-utenlandsadresser/)
• Audit Log Cleanup Service (sporingslogg-cleanup/)
External Systems Integration
• PDL (Person Data System)
• Skatteetaten
• Kafka Event Stream
• Maskinporten (Authentication)
Data Stores
• PostgreSQL Database (for subscriptions and audit logs)
Data Flow Representation
• Kafka event streaming from PDL
• REST API calls between components
• Database operations
• Authentication flows through Maskinporten
Component Details
a. Main Application Service:
• Subscription Management
• Feed Service
• Address Protection Handler
• API Routes
• Event Consumers
b. Address Fetching Service:
• PDL Integration
• Address Update Logic
• Audit Logging
c. Database Layer:
• Subscription Tables
• Feed Events
• Audit Logs
Security Layer
• Maskinporten authentication flow
• Address protection filtering
• Organization number verification
Background Processes
• Audit log cleanup job
• Address update processes
• Event consumers
Specific Implementation Guidelines:
Monitoring and metrics flow
Key Relationships to Highlight:
Cleanup Job → Database (Maintenance)
Important Notes:
• Subscription-based nature of the service
• Address protection filtering mechanism
• 10-year retention policy for audit logs
• Error handling and fallback paths
• Monitoring and alerting paths