Skip to content

feat(events): the four reference event emitters - cloud_blocked, country_blocked, geo_lookup_failed, security_headers_applied - and the send_cloud_detection_events bus port - #58

Merged
rennf93 merged 2 commits into
masterfrom
feat/event-emitters
Oct 7, 2026
Merged

rennf93 merged 2 commits into
masterfrom
feat/event-emitters

Conversation

@rennf93

@rennf93 rennf93 commented Oct 7, 2026

Copy link
Copy Markdown
Member

Summary

Closes GAP-P4 (four event constants without emitters) and V3 (the missing send_cloud_detection_events bus method) from the PHP-family feature matrix.

  • EventBus::sendCloudDetectionEvents, the reference middleware_events.py port: the cloud_blocked verdict event (handler cloud, action request_blocked or logged_only in passive mode, the provider and network metadata) plus, when a forwarded route blocks clouds, its access_control decorator_violation.
  • The cloud_provider check emits the bus cloud events on every block path and its own block_clouds decorator_violation for a route-level block - the reference check passes a null route to the bus for exactly that case.
  • The ip_security check's country stage emits country_blocked (handler ipinfo, the reference allowlist and blocklist reasons with the country and rule_type metadata) and geo_lookup_failed (a failing resolver reports the lookup failure and a miss, never a raise, mirroring get_country's internal catch).
  • security_headers_applied emits behind the reference security-headers TTL cache (TTLCache(1000, 300) semantics: one event per config+path per window keyed cfg_{id}path{sha256 prefix}, empty paths gated, oldest-first trim matching the single-TTL eviction order), at the pipeline pass (the headers the adapter applies to the pass-through response) and on blocked responses.
  • The events also close the H3 and H6 event-deferral notes and give DynamicRuleManager.matchEvent a live cloud_blocked stream to correlate against.

Tests

  • bin/test_events_parity.php (55 assertions): the bus method (hit, miss, passive, route decorator), the cloud check through the engine (global and route-level), the country events (blacklist, whitelist, pass, failing resolver), and the headers event (first emission, TTL-window dedupe, distinct paths, blocked responses, the 1001-path eviction flood, empty path, disabled headers).

Gates

  • composer validate, composer audit --locked, php -l sweep, every bin suite plus all conformance runners green (no stale xfail baseline), coverage gate PASS (every executable line covered or provably unreachable).

…try_blocked, geo_lookup_failed, security_headers_applied - and the send_cloud_detection_events bus port

cloud_blocked flows through the bus's send_cloud_detection_events port (the
cloud handler verdict with provider and network metadata, handler cloud,
request_blocked or logged_only in passive mode) plus the route block_clouds
decorator_violation from the cloud_provider check. country_blocked and
geo_lookup_failed emit from the ip_security check's country stage (handler
ipinfo, the reference reasons and rule_type metadata; a failing resolver
reports the lookup failure and a miss, never a raise).
security_headers_applied emits behind the reference security-headers TTL
cache (TTLCache(1000, 300) semantics: one event per config+path per window,
empty paths gated, oldest-first trim) at the pipeline pass and the blocked
response paths.
@rennf93 rennf93 added the no-issue Chore or dependency PR that does not need an issue label Oct 7, 2026
@github-actions github-actions Bot added area: pipeline Touches src/Pipeline/ (checks and the pipeline) area: engine Touches src/Engine/, src/Config/, or src/Routing/ tests Test suite changes ci GitHub Actions workflows labels Oct 7, 2026
…r's name lists

The sensitive-log config fields are array<string, true> membership maps and
the redactor walks list<string> names (the LogActivity convention is
array_keys): every event emission carrying a non-empty sensitive set fataled
with strtolower(true). The three pre-existing bus sites carried the same
latent bug behind empty sets; all four sites convert now, with a regression
case in the events suite (a non-empty sensitive set still emits the headers
event with the redacted path).
@rennf93
rennf93 merged commit cfbde3c into master Oct 7, 2026
27 checks passed
@rennf93
rennf93 deleted the feat/event-emitters branch October 7, 2026 23:46
@rennf93 rennf93 mentioned this pull request Oct 9, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: engine Touches src/Engine/, src/Config/, or src/Routing/ area: pipeline Touches src/Pipeline/ (checks and the pipeline) ci GitHub Actions workflows no-issue Chore or dependency PR that does not need an issue tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant