mirror of
https://gitee.com/pnoker/iot-dc3.git
synced 2026-11-01 18:51:53 +08:00
* fix(api): correct inverted enable_flag comment and document time unit - tenant.proto enable_flag comment said "1 enabled, 0 disabled" but the actual EnableFlagEnum is ENABLE=0, DISABLE=1 — callers reading the comment would invert the flag. Correct it. - base.proto create_time/operate_time are epoch milliseconds (LocalDateTimeUtil/Instant.toEpochMilli); document the unit so callers don't guess seconds vs millis. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(api): carry timestamp in point-value history; explicit bool presence #5 Point-value history: the whole chain (proto -> gRPC server -> PointValueService -> repository -> facades -> controller -> agentic tool) returned List<String> and dropped create_time even though the DB row already carried it. Switch to PointValueBO / FacadePointValueBO end to end so callers receive each value with its timestamp. #6 Field presence: GrpcR.ok and McpIntrospectDTO.active are now optional bool, so "unset" is distinguishable from false on the wire. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(auth): unify JWT signing key, drop salt/password from token contract The JWT signing key was per-principal — securityKey + ":" + salt, where salt was the credential salt also carried through the gateway and the token RPC. That makes the JWT key weak and widens salt exposure to every gateway hop. Sign with the single configured securityKey (HS256) instead and remove salt from the JWT path entirely: - KeyUtil.generateToken/parserToken drop the salt parameter; the HMAC key is now just securityKey (must be >= 32 bytes for HS256). - TokenService.generateToken/checkValid drop the salt parameter. - token.proto GrpcLoginQuery drops salt and password — CheckValid only ever needed tenant, name and token. - gateway FilterService, TokenGrpcFacade, TokenController adapted; the request header no longer feeds salt into validation. The login-handshake salt (POST /token/salt, used to salt the password client-side before verifyPassword) is unchanged — only the JWT signing salt is removed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * refactor(api): type MCP authorize decision as proto enum The authorize-tool-call decision was a free-form string, so callers could only compare it against literals with no compile-time check. Introduce GrpcMcpDecision (MCP_DECISION_UNSPECIFIED / AUTHORIZED / CONFIRM_REQUIRED / REJECTED) and type GrpcMcpToolAuthorizeDTO.decision with it. Enum names match the existing auth-side literals, so the mapping is a direct valueOf / name(). - McpRuntimeServer builds the enum via toGrpcDecision (unknown -> UNSPECIFIED). - McpRuntimeGrpcFacade maps enum -> BO string via name(). - gateway unchanged: it receives the BO (string decision) through the facade. The other string MCP fields (risk_level, status, grant_type, principal_type) stay strings for now — their value sets are wider and partly lowercase (OAuth grant_type), so they are a follow-up. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(facade): align TokenLocalFacade with 3-arg checkValid (CI compile fix) TokenLocalFacade (local impl) was missed when TokenFacade.checkValid dropped salt; CI compiles facade-local-auth independently and caught it. Align it + its test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
DC3 Common API
Overview
dc3-common-api provides shared gRPC utility classes used across all services in the IoT DC3 platform. It contains
builder utilities for constructing gRPC request/response objects
from domain model entities.
Module Information
- Group ID: io.github.pnoker
- Artifact ID: dc3-common-api
- Version: 2026.5.22
Key Components
GrpcBuilderUtil— Utility class for building common gRPC DTOs from BO/DO entities (e.g., setting pagination, building result wrappers)
Dependencies
This module is included in any service that imports a dc3-api-* module. It bridges domain model objects with generated
protobuf classes.
Build Instructions
mvn -s ../../.mvn/settings.xml clean package
Related Modules
dc3-api-auth/dc3-api-data/dc3-api-driver/dc3-api-manager— gRPC API contracts that use these utilities
License
Copyright 2016-present the IoT DC3 original author or authors.
Licensed under the GNU Affero General Public License v3.0 (AGPL 3.0)