Files
pnoker 372d75b0c9 refactor(core): rename find/query/fetch methods to get per crud law
sweep every module to satisfy the new method-name rule, renaming
about 40 methods together with their interface, implementation, test
and cli call sites: store find() lookups become get(), analytics
queryLatest/queryHistory become getLatest/getHistory, sql helper
query() becomes spec()/sql(), jwks fetch() becomes load(), and the
cursor record component queryDigest becomes requestDigest

no behavior changes; full unit suite (5278 tests) and both quality
gates stay green
2026-09-18 09:53:51 +08:00
..

DC3 Common Resource

Overview

dc3-common-resource discovers a service's HTTP API endpoints at startup and registers them as authorization resources with the Auth Center. This keeps the RBAC resource catalog in sync with the controllers that are actually deployed, so permissions can be granted against real endpoints.

Module Information

  • Group ID: io.github.pnoker
  • Artifact ID: dc3-common-resource

Key Components

Component Purpose
ApiEndpointScanner Scans annotated controllers and collects their API endpoints
ControllerAnnotationGate Decides which controllers/endpoints are eligible for registration
ApiAnnotationValidator Validates the API annotations on scanned endpoints
ResourceRegistrar Submits the collected endpoints to the Auth Center on startup
ResourceRegistrarProperties Binds registrar configuration from YAML
ResourceRegistrarAutoConfiguration Wires the registrar into any service that includes this module

Registration is performed through ResourceRegistryFacade (from dc3-common-facade-api), so it works over either the gRPC or in-process facade transport.

Dependencies

  • dc3-common-web — controller/annotation infrastructure
  • dc3-common-facade-api — ResourceRegistryFacade used to submit resources

Build Instructions

mvn -s .mvn/settings.xml -pl dc3-common/dc3-common-resource -am package

Testing

Run the module tests from the repository root:

mvn -s .mvn/settings.xml -pl dc3-common/dc3-common-resource -am test
  • dc3-center-* — include this module to register their API resources
  • dc3-common-auth — owns the resource registry on the receiving side