38 Commits
Author SHA1 Message Date
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
pnoker 66aab58f20 build: standardize repository tooling and quality gates 2026-09-02 20:51:10 +08:00
pnoker eae86b58fc refactor(storage)!: unify platform persistence on reactive postgresql
- migrate auth, manager, data, and agentic persistence to R2DBC
- hard cut pagination, facade, gateway, web, and CLI contracts
- remove legacy database and TSDB adapters and document validation gates

BREAKING CHANGE: platform persistence now requires PostgreSQL 18 with TimescaleDB and the new reactive API contracts.
2026-09-01 22:03:16 +08:00
pnoker 769d1cb977 style: apply repository-wide formatting
- 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
2026-08-25 13:35:00 +08:00
pnoker 0ec9a636b1 docs(backend): complete the Javadoc and comment sweep
- fill the missing Javadoc on public methods, records, and types across the dc3-common, dc3-mq, and dc3-tsdb core modules
- document about 350 public constants and enum constants in dc3-common-constant, including the MCP, RabbitMQ, agentic, manager, auth, and data surfaces
- document exception constructors and replace the lombok @RequiredArgsConstructor with explicit documented constructors in ThreadPoolConfig and QuartzService
- translate the remaining non-English section comments in the TSDB store adapters
- verified: check_documentation.py passes, javadoc doclint=all reports zero warnings across all aggregators, and the touched modules compile
2026-08-25 13:29:16 +08:00
pnoker 51f0efd2d9 style(javadoc): document non-override public methods 2026-08-19 00:05:58 +08:00
pnoker 03e6ddb0b3 docs(model): fix base builder param types and document mcp tool dto
- BaseBuilder: correct param/return type names (EntityVO -> BaseVO, etc.)
  across 8 conversion methods
- McpToolDefinitionDTO: document fields and the nested Annotations hints
  and Metadata (tool id, permission code, risk level)
- ExceptionUtil: fill placeholder param/return for
  getNotAvailableServiceMessage
2026-07-09 19:16:30 +08:00
Vickey d2c897846c refactor(common): split ResponseEnum into SuccessCode/ErrorCode and align body code with HTTP status
Replace the mixed-purpose ResponseEnum with a ResponseCode interface implemented
by SuccessCode (OK/ADD/DELETE/UPDATE) and ErrorCode (NOT_FOUND/UNAUTHORIZED/
TOKEN_INVALID/IP_INVALID/FORBIDDEN/PASSWORD_*/VALIDATION/OUT_OF_RANGE/FAILURE),
each carrying its HTTP status so the envelope body code and transport status no
longer diverge.

- Introduce abstract BusinessException carrying an ErrorCode; all 23 business
  exceptions extend it and bind a fixed code. ExceptionConfig reads the carried
  code to set both body code and HTTP status (404->R404, 401->R401, 422->R422).
- Add GrpcRFactory (ok/fail/notFound) and remove the hand-written GrpcR builder
  boilerplate across 19 gRPC servers.
- Drop the dead @EnumValue index and ofIndex/ofCode/ofName lookups; OUT_OF_RANGE
  is now carried by OutRangeException.
- Update R factory methods to accept ResponseCode; migrate 90+ controllers,
  11 gRPC facades, OpenAPI specs and README to the split enums.

Also fix several pre-existing red tests surfaced by the full suite:
- OAuthMcpRuntimeServiceImplTest: setUp set @Value fields refactored into
  OAuthProperties; inject the properties object instead.
- DriverReadServiceImplTest: reset leaked ConnectionBackoff static state via a
  new clear() in @BeforeEach.
- modbus-rtu/tcp: make the static modbusFactory non-final so tests can swap it.
- ble: override no-arg health() to report OFFLINE before initialization.
- PlcS7/facade-local tests: expect the thrown exception / use the single-arg
  overload matching production behaviour.
- Remove a duplicate dc3-common-constant dependency in dc3-common-data/pom.xml.
2026-06-18 23:53:41 +08:00
Vickey a94b2464a4 feat(mcp): authorize high-risk tool calls and harden auth lifecycle
Tool authorization (HIGH-risk confirmation):
- add AuthorizeToolCall RPC; the gateway calls it before tool execution
- sign/consume confirmation tickets with idempotency-key dedup
- propagate x-dc3-ai metadata (riskLevel/destructive/openWorld/idempotent) from the scan through the registry to the tool catalog

OAuth hardening:
- rotate refresh tokens and revoke the authorization on replay via previous_refresh_token_hash

Password lifecycle:
- require password change on login when flagged or expired (R20303/R20304)
- expose a public POST /token/change_password endpoint

OpenAPI aggregation:
- switch McpOpenApiAggregator to classpath static snapshots, dropping the runtime fetch and McpAggregatorProperties
2026-06-18 14:08:05 +08:00
pnoker aaf90f203b security(auth): implement endpoint-level RBAC permission enforcement
Add a role-based access control system that enforces permissions at the
endpoint level across all backend services.

New infrastructure:
- RequirePermission annotation: declare required resource codes on endpoints
- PublicEndpoint annotation: mark endpoints as publicly accessible
- PermissionProvider SPI: pluggable permission check with default allow-all
  fallback for backward compatibility
- AuthorizationWebFilter: rejects unauthenticated requests to non-public
  paths by verifying UserHeader presence in Reactor context
- AuthPermissionProvider: production implementation backed by role-resource
  bindings with 5-minute in-memory cache
- AccessDeniedException: dedicated exception for permission failures

BaseController gains a requireAnyPermission() helper that controllers can
use to enforce granular resource-code checks inline.

TokenController's generateSalt and generateToken are annotated with
@PublicEndpoint as the anonymous authentication entry points.
2026-06-05 22:36:08 +08:00
pnoker 604786b495 docs(exception): add missing class-level Javadoc 2026-05-21 01:25:46 +08:00
pnoker 7c853ac8bc chore: correct @since tag to project inception date
Update @since from 2022.1.0 to 2016.10.1 and @version from 2026.5.5
to 2026.5.17 across all Java source files to reflect the actual
project start date.
2026-05-17 19:01:28 +08:00
pnoker 8268dcea8e refactor(common): standardize constants and quartz config 2026-05-15 19:12:16 +08:00
pnoker db683533b2 refactor(common): preserve exception causes 2026-05-15 17:27:04 +08:00
pnoker d82bea91ac test: add common exception coverage 2026-05-13 15:06:43 +08:00
Vickey c017780989 style(java): unify null checks and add Javadoc in resource-registrar, exception, and utils
- Use Objects.isNull/nonNull in ExceptionMessageFormatter, TreeUtil,
  and TimeRangeKeyEnum for consistency
- Add Javadoc to ResourceRegistrar constructor and key methods
- Add Javadoc to ResourceRegistrarAutoConfiguration
- Improve ApiEndpointScanner documentation
2026-05-10 10:48:42 +08:00
pnoker 88614fd79a style(java): expand wildcard imports to explicit imports 2026-05-09 23:50:48 +08:00
pnoker 3020129d52 fix(exception,auth): support placeholders and reset password once 2026-05-09 18:49:51 +08:00
pnoker 1c9cc2cda6 docs(common-public): simplify verbose class-level Javadocs to concise one-liners
Remove redundant <p> paragraphs that restate the class name.
Keep @author/@version/@since tags consistent across all classes.
2026-05-08 00:51:12 +08:00
pnoker e47299a327 chore: remove format and format-check targets from Makefile 2026-05-07 23:55:32 +08:00
pnoker db456d61fe style: apply spring-javaformat 0.0.47 and fix checkstyle violations
- Apply Spring Java Format to all 1087 Java source files
- Fix star imports (java.lang.annotation, org.quartz, java.util.concurrent, etc.)
- Fix missing trailing newlines across codebase
- Fix redundant public modifiers on interface methods
- Fix multiple variable declarations
- Fix if-statements missing braces in JsonUtil, RegexUtil, RequestUtil
2026-05-07 16:53:16 +08:00
Vickey 78a612c4ac feat: add JavaDoc comments and enhance field naming consistency across project 2026-01-07 17:07:46 +08:00
zzi666 0a19027c70 docs(utils): translate javadoc to english for FileUtil, JsonUtil, TimeUtil, and related classes 2025-12-31 14:41:52 +08:00
Vickey a9e8d05631 feat: update version 2025-10-05 17:16:37 +08:00
Vickey 2051d42847 refactor(common): remove hutool dependency and replace usages with native utilities 2025-09-11 14:57:02 +08:00
Vickey a39d2fb533 chore: migrate license headers from Apache 2.0 to AGPL-3.0 across all source files 2025-08-26 22:01:24 +08:00
Vickey 31a6a275ed build: bump project version to 2025.6.4 across all modules 2025-07-15 12:01:43 +08:00
Vickey 886b212793 build: bump project version to 2025.6.1 across all modules 2025-06-21 16:21:18 +08:00
Vickey 877be41317 build: bump project version to 2025.6.0 and remove unused job/register dependencies 2025-06-09 15:48:22 +08:00
Vickey 78573e9bb1 refactor(dc3-common-auth): simplify TokenService and remove UserLimit rate-limit logic 2025-05-12 15:44:38 +08:00
pnoker d99e0408f2 chore: update version to 2025.2.5 across multiple files
Updated the version from 2025.2.4 to 2025.2.5 in pom.xml files and various Java classes to reflect the latest release. This change ensures consistency across the codebase and aligns with the new version of the IoT DC3 Platform.
2025-04-25 16:22:39 +08:00
pnoker a49def0595 chore: update project version to 2025.2.4 across all modules
Updated the version from 2025.2.2 to 2025.2.4 in all pom.xml files, Java classes, and CI/CD configurations to reflect the latest release version. This change ensures consistency across the entire project.
2025-04-24 19:46:54 +08:00
pnoker af044ecc83 chore: bump all module versions to 2025.2.2 and update CI gateway image tag 2025-04-21 22:12:44 +08:00
Vickey 1d3b363b8c build: bump project version to 2025.2.1 across all pom.xml and source files 2025-03-04 22:21:29 +08:00
Vickey 2b33914016 build: bump project version from 2024.3.10 to 2025.2.0 across all pom.xml and source files 2025-02-20 19:59:16 +08:00
zzi666 eb5b98fdcf feat: version 2024.3.10 2025-01-18 17:45:09 +08:00
pnoker d85f3dfa9a refactor(web): add version annotation to BaseController and remove hardcoded getTenantId2 stub 2024-12-29 15:50:06 +08:00
pnoker eca5457dad feat: merge dc3-common and dc3-api subprojects into main repo 2024-07-02 23:05:25 +08:00