mirror of
https://gitee.com/pnoker/iot-dc3.git
synced 2026-11-03 03:32:08 +08:00
- expand single-line Javadocs to multi-line blocks, rewrap Markdown prose, and reflow POM, YAML, and TypeScript formatting - formatting only: no Java code lines changed, no build-file semantics changed - verified: backend compile and check_documentation.py pass, pnpm check and pnpm lint:check pass, and the dc3 YAML files parse
2.4 KiB
2.4 KiB
DC3 Common Auth
Overview
dc3-common-auth is the shared authentication business module of the IoT DC3 platform. It contains all controllers,
service implementations, gRPC servers, mappers, and DAL classes that implement the authentication center's
functionality. It is wired directly into dc3-center-auth.
Module Information
- Group ID: io.github.pnoker
- Artifact ID: dc3-common-auth
Key Components
| Layer | Contents |
|---|---|
| Controllers | REST controllers for user, tenant, token, dictionary endpoints |
| Services | TokenService, UserService, TenantService, DictionaryForAuthService |
| gRPC Servers | Spring @Service beans extending generated *ImplBase server classes |
| DAL | MyBatis-Plus mappers and DAL managers for auth tables |
| Init | AuthInitRunner for startup checks |
gRPC Services Exposed
| Service | Purpose |
|---|---|
TokenApi |
Validate login and token material for gateway authentication |
TenantApi |
Resolve tenant metadata by code |
UserApi |
Resolve users by ID or principal ID |
LocalCredentialApi |
Resolve local credentials by login name |
PermissionApi |
List effective permission codes |
ResourceRegistryApi |
Synchronize discovered API and menu resources |
McpRuntimeApi |
Introspect, authorize, resolve, and audit MCP tool calls |
Distributed callers use the corresponding facade interfaces; they should not construct gRPC channels in business code.
Build Instructions
mvn -s .mvn/settings.xml -pl dc3-common/dc3-common-auth -am package
Testing
Run the module tests from the repository root:
mvn -s .mvn/settings.xml -pl dc3-common/dc3-common-auth -am test
Related Modules
dc3-center-auth— Bootstraps this module as a Spring Boot servicedc3-api-auth— gRPC contract implemented by this moduledc3-common-model— Entity, BO, VO, DTO definitions