This document describes the internal architecture of prod-guard, its core components, execution flow, and design decisions.
The goal of prod-guard’s architecture is to provide:
prod-guard is a startup-time validation framework for Spring Boot applications. All checks are executed once during application startup.
There are no agents, background threads, schedulers, or network calls.
Application Startup
|
v
ProdGuardRunner
|
+-- License Verification
|
+-- Check Discovery
|
+-- License Gate (FREE / PREMIUM)
|
+-- Check Execution
|
+-- Result Aggregation
|
+-- Optional Startup Blocking
ProdGuardRunner is the orchestration engine. It is executed during application startup and controls the entire lifecycle.
Responsibilities:
prodguard.force and prodguard.enabledEach production rule is implemented as a ProdCheck.
A check is:
Each check provides:
PG-011)Checks are discovered automatically via Spring’s component scanning.
The SeverityResolver determines the effective severity of each finding.
Resolution order:
prodguard.severity.*)This allows teams to:
License validation is handled by the LicenseVerifier abstraction.
Two implementations exist:
Selection is automatic based on configuration.
prod-guard uses offline cryptographic licenses.
A license contains:
After verification, a LicenseContext is produced.
It represents the immutable result of license validation:
This context is evaluated exactly once at startup.
LicenseGate enforces licensing at the check level.
By convention:
PG-2PG-2If a PREMIUM check is encountered without a valid license:
1. Application starts
2. ProdGuardRunner invoked
3. Environment & profile detection
4. License verification
5. License expiration diagnostics
6. Check discovery
7. License gate filtering
8. Check execution
9. Result aggregation
10. Optional startup failure
All validation happens before the application begins serving traffic.
No background tasks, no polling, no memory retention after startup.
prod-guard never requires network access.
Every decision is logged explicitly and auditable.
prod-guard executes validation as part of the startup lifecycle, but not all checks run at the same moment.
To reflect this accurately, prod-guard uses a two-phase execution model.
When it runs
What runs
Examples
Characteristics
This phase applies to both FREE and PREMIUM editions.
Some production and security guarantees cannot be validated statically.
For example:
These require observing the effective runtime behavior.
When it runs
What runs
Examples
Characteristics
This phase is PREMIUM-only.
| Aspect | Traditional Monitoring | prod-guard |
|---|---|---|
| Execution time | Runtime | Startup only |
| Purpose | Observation | Prevention |
| Failure handling | Alerts | Startup blocking |
| Licensing | Subscription / SaaS | Offline signed license |