mirror of
https://gitee.com/pnoker/iot-dc3.git
synced 2026-10-31 18:21:58 +08:00
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
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 infrastructuredc3-common-facade-api—ResourceRegistryFacadeused 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
Related Modules
dc3-center-*— include this module to register their API resourcesdc3-common-auth— owns the resource registry on the receiving side