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 Gateway
Overview
dc3-common-gateway is the shared gateway module of the IoT DC3 platform. It provides the Authentic gateway filter
factory and supporting services that validate tokens with the Auth Center before forwarding requests in the
dc3-gateway.
Module Information
- Group ID: io.github.pnoker
- Artifact ID: dc3-common-gateway
Key Components
| Component | Purpose |
|---|---|
AuthenticGatewayFilterFactory |
Spring Cloud Gateway GatewayFilterFactory that intercepts requests and validates tokens |
AuthenticGatewayFilter |
Applies token validation logic; injects principal headers downstream |
FilterServiceImpl |
Calls Auth Center via gRPC to validate the Bearer token |
GatewayInitRunner |
Startup runner for gateway-specific initialization |
McpGatewayController |
OAuth2 authorization-server and MCP discovery endpoints exposed at the gateway |
McpGatewayProperties |
Binds MCP gateway settings from YAML |
Filter Flow
Incoming HTTP request with Authorization: Bearer {token}
→ AuthenticGatewayFilter
→ FilterServiceImpl
→ TokenFacade.checkValid()
→ distributed mode: gRPC TokenApi.CheckValid
← token valid: inject signed X-Auth-Principal header
← token invalid: return 401 Unauthorized
→ Forward to backend service
Build Instructions
mvn -s .mvn/settings.xml -pl dc3-common/dc3-common-gateway -am package
Testing
Run the module tests from the repository root:
mvn -s .mvn/settings.xml -pl dc3-common/dc3-common-gateway -am test
Related Modules
dc3-gateway— Bootstraps this moduledc3-api-auth— gRPC contract for token validationdc3-center-auth— Token validation backend