Class TestAccessControllerObserverCoverage

java.lang.Object
org.apache.hadoop.hbase.security.access.TestAccessControllerObserverCoverage

@Tag("org.apache.hadoop.hbase.testclassification.SecurityTests") @Tag("org.apache.hadoop.hbase.testclassification.SmallTests") public class TestAccessControllerObserverCoverage extends Object
Verifies that AccessController implements every security-relevant method declared in the five observer interfaces it claims to implement: MasterObserver, RegionObserver, RegionServerObserver, EndpointObserver, BulkLoadObserver.

If a new hook is added to any of these interfaces and AccessController does not override it, the default no-op implementation will silently skip the permission check — a potential privilege escalation. This test catches that at build time.

Skipped methods are determined by two mechanisms:

  • Pattern rules — methods matching these patterns are always safe to skip:
    • post* — post-operation notifications; the operation has already been authorized and executed.
    • pre*Action — procedure-level action hooks; authorization happens at the RPC layer in the corresponding pre* hook.
  • Explicit whitelist — methods that don't match the above rules but are still safe to skip (internal lifecycle hooks, deprecated overloads with default delegation, read-only queries). Each entry has a justification comment.