NOSSLETTER.techLIVE
back to archive

matcher: let data inputs declare when their data is available

Language: C+++217 -4feature
concepts demonstrated
Virtual functions and method overridingFactory design patternEnum classes for state representationUnit testing with mocks and integration tests
The Issue & Context

Previously, HTTP and network RBAC filters only accepted a fixed set of built-in matcher input types, preventing custom inputs from being used in RBAC matchers.

Root Cause Analysis

The filters relied on a hardcoded list of input type URLs and had no mechanism to determine when a custom input's data would be available during request processing, blocking their integration.

Solution Strategy & Architectural Pattern

Introduced a DataInputStage enum and an availableAt() method in DataInputFactory to let inputs declare their data availability stage. RBAC filters then check this stage to accept inputs whose data is ready by the filter's processing point, enabling extension inputs beyond the built-in list.

Key Takeaway for Contributors

Designing extensible systems often requires explicit lifecycle or data availability contracts so that custom components can integrate safely without assumptions about timing or availability.