Commit Graph
60 Commits
Author SHA1 Message Date
pnoker d228f4e252 chore: align license headers to AGPL across maven wrapper, docs and web assets 2026-07-10 00:02:18 +08:00
pnokerandClaude 838749b94b style: apply indentation and formatting fixes
- OAuthMcpRuntimeServiceImpl: fix indentation of authorize() method body
- TenantLineHandlerImpl: align IGNORE_TABLES and error message formatting
- TenantLineHandlerImplTest, TenantContextHolderTest: fix indentation

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-09 12:51:21 +08:00
pnoker 0d8390db51 fix(tenant): bind tenant context on gRPC server paths
D-1's fail-closed TenantLineHandler rejects unscoped queries, but gRPC
server threads bypass BaseController.async so no tenant was ever bound —
every query against a tenant-scoped table silently failed.

- proto: add tenant_id to manager/driver single & batch query messages
- facade: drop single-param abstract + default matchesTenant filter,
  promote the tenantId-bearing overload (all callers already pass it)
- GrpcFacade/LocalFacade: carry tenant into request / onto ThreadLocal
- 9 manager+driver servers (27 RPCs): setTenantId + finally clear
- data servers: setTenantId on tenant-bearing RPCs; runIgnore for
  getByRecordId (record_id globally unique, no tenant in payload)
- TokenServer.checkValid: runIgnore (dc3_tenant_membership, pre-login)
- driver clients (Device/Driver/Point): set tenant on getById queries
- alarm: drop tenant reverse-resolve (D-1 leftover the fail-closed
  interceptor forbids); tenant now required from upstream, else drop
- add TenantLineInterceptorIntegrationTest (H2) covering scoped filter,
  fail-closed, and runIgnore through the real MyBatis-Plus pipeline
2026-07-03 12:40:10 +08:00
pnoker 0157e9d939 style(tenant): polish runIgnore indentation + javadoc + whitelist test coverage
M1: OAuthMcpRuntimeServiceImpl.registerClient runIgnore lambda body
    re-indented from 8-space to 12-space base to match jwks/token/
    authorize/revoke/introspect blocks (cosmetic, no logic change).

M2: TenantLineHandlerImpl Javadoc + inline comments now mention both
    TenantContextHolder.runIgnore (returning) and runIgnoreAction (void),
    since OAuth/MCP callers predominantly use runIgnore.

M3: TenantLineHandlerImplTest.ignoreTableTrueForWhitelistedTables now
    asserts all 11 IGNORE_TABLES entries (was 3/11) — guards the
    tenant-line whitelist against silent removal.
2026-07-02 13:16:36 +08:00
pnoker 9c50831f5f feat(tenant): register TenantLineInnerInterceptor + agentic BO implements TenantOwned 2026-07-02 11:48:00 +08:00
pnoker 478eeae54b feat(tenant): add TenantLineHandlerImpl with fail-closed + whitelist 2026-07-02 11:05:26 +08:00
pnoker ef7a4057c1 feat(tenant): add TenantNotScopedException + runIgnoreAction + 500 mapping 2026-07-02 10:25:35 +08:00
Vickey c084fa4bd0 feat(common): add thread-bound TenantContextHolder for tenant-line integration
- introduce TenantContextHolder holding tenantId with a runIgnore closure
- bind/clear the holder in BaseController.async from the reactive security context
- add unit tests for set/get and runIgnore semantics
2026-06-18 14:05:41 +08:00
Vickey 918b3d5e8e feat: update pom version to 2026.5.22 2026-05-26 00:30:11 +08:00
pnoker 7f5da1a0f8 chore: bump version to 2026.5.18 across all modules 2026-05-18 00:24:22 +08:00
pnoker 994ccba991 docs: update READMEs and project documentation
Refresh module READMEs, AGENTS.md, CONTRIBUTING.md, and dc3/doc/
guides to reflect the unified Dockerfile, consolidated compose stacks,
and updated build instructions.
2026-05-17 19:03:21 +08:00
pnoker 996518186a build: bump version to 2026.5.17
Update parent version and dc3.version from 2026.5.5 to 2026.5.17
across all Maven modules.
2026-05-17 19:01:44 +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 9437934cab refactor(common): improve postgres and repository modules 2026-05-15 19:54:45 +08:00
pnoker dc8f3de062 refactor(common): consolidate EnvironmentPostProcessor registration
Each common module previously declared its EnvironmentPostProcessor
classes twice — via the new META-INF/spring/...EnvironmentPostProcessor.imports
file *and* via the legacy spring.factories — and decorated the classes
with @Configuration even though Spring Boot loads them through
SpringFactoriesLoader, not through the application context.

Drop the @Configuration noise on every Active*ProfileConfig and on the
Driver / Mqtt / Rabbitmq EnvironmentConfig classes, and delete the
duplicate .imports files in agentic, auth, data, driver, gateway,
manager, mqtt, postgres, quartz, rabbitmq, repository, thread, and web.
The remaining META-INF/spring.factories in each module is the single
registration entry point.
2026-05-15 16:10:53 +08:00
Vickey ca45788d50 style(java): sort imports and remove unused imports across modules 2026-05-10 21:43:57 +08:00
pnoker f5045c7392 fix(config): restore spring.factories for EnvironmentPostProcessor loading
Spring Boot 4.0.6 still loads EnvironmentPostProcessor implementations
via SpringFactoriesLoader from META-INF/spring.factories, not from the
new .imports file. The .imports mechanism only applies to
AutoConfiguration classes.

The previous commit incorrectly deleted all spring.factories files,
which broke profile activation for every service (auth, data, manager,
gateway, etc.). Restore them with only the EnvironmentPostProcessor
entries (EnableAutoConfiguration entries remain removed since those
use AutoConfiguration.imports).
2026-05-10 11:33:04 +08:00
Vickey 50cf4dad62 fix(config): align auto-configuration classes and fix resource leaks for Spring Boot 4.x
Auto-configuration:
- Replace @Configuration with @AutoConfiguration on 21 classes listed
  in AutoConfiguration.imports (InitRunners, topic configs, DalConfig,
  MqttConfig, ThreadPoolConfig, RabbitConfig, ExchangeConfig, etc.)
- Add @AutoConfiguration to ExceptionConfig alongside @RestControllerAdvice

WebFlux fixes:
- Replace getServlet().getContextPath() with getReactive().getContextPath()
  in WebFilterConfig (servlet API in reactive context)
- Remove redundant @EnableWebFlux and @Slf4j from WebFluxConfig
- Replace deprecated customCodecs().registerWithDefaultConfig() with
  defaultCodecs().jacksonJsonEncoder/Decoder()

Driver lifecycle:
- Replace System.exit(1) in DriverRegisterServiceImpl with
  ServiceException to allow Spring graceful shutdown

Resource leaks:
- Wrap FileOutputStream in try-with-resources in DeviceServiceImpl
- Wrap BufferedWriter in try-with-resources in CmdUtil
- Rewrite X509Util.loadCertificateWithPassword with try-with-resources
  and remove dead if/else branches
2026-05-10 11:22:50 +08:00
Vickey 014eaad0fd style(java): unify null checks to Objects.isNull/nonNull across dc3-common
Standardize on Objects.isNull() and Objects.nonNull() for null checks
across agentic, auth, data, facade, manager, postgres, public, and web
modules for consistency with the project's established convention.
2026-05-10 10:47:43 +08:00
Vickey ef49880871 refactor(config): migrate from spring.factories to Boot 4.x auto-config and EnvironmentPostProcessor imports
Spring Boot 4.x removed the spring.factories mechanism entirely. The
EnableAutoConfiguration entries were already migrated to
AutoConfiguration.imports, but the EnvironmentPostProcessor
registrations were only in the now-defunct spring.factories, meaning
all profile activation and environment configuration was broken.

- Delete all 15 spring.factories files (dead code in Boot 4.x)
- Create EnvironmentPostProcessor.imports for 12 modules, registering
  16 EnvironmentPostProcessor implementations that were previously
  unreachable
2026-05-10 10:36:49 +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 1bc0b74d4d style: reorganize POM dependencies with consistent category comments
Group dependencies in each module POM using a standard category order:
Spring Boot → Spring Cloud → gRPC → Data Access → Messaging → IoT → AI
→ Serialization → Utility → Security → Observability → DC3 API → DC3 Common

DC3 Common dependencies sorted alphabetically within their group.
2026-05-08 00:28:44 +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
pnoker 95c40b2387 chore: bump version to 2026.5.5
Roll every pom, per-module README, Spring banner, and @version /
@since javadoc tag from 2026.4.30 to the new 2026.5.5 release line.
2026-05-05 00:56:09 +08:00
Vickey 200beeaa71 chore: update version to 2026.4.30 in multiple files 2026-04-30 16:06:30 +08:00
pnoker c693efd7a9 feat: add TimestamptzLocalDateTimeTypeHandler for PostgreSQL TIMESTAMPTZ support 2026-04-29 19:02:24 +08:00
pnoker d09647c780 fix: update Mybatis and Dynamic Datasource dependencies to version 4, remove Redis exporter from docker-compose files 2026-04-29 16:01:11 +08:00
pnoker c5a9feeeb9 feat: add .env file for Docker Compose configuration and update usage instructions 2026-04-29 10:27:57 +08:00
pnoker ea17c86387 chore: update version to 2026.4.19 across all modules and adjust branch settings in codeql.yml 2026-04-19 13:45:21 +08:00
pnoker d102e18b00 chore: fix inceptionYear and scm connection in all pom.xml
- Fix <inceptionYear> from '2016-2022' to '2016' in 20 pom.xml files
- Fix <scm> connection/developerConnection to use scm:git: prefix in 22 pom.xml files
2026-04-18 01:31:07 +08:00
pnoker e57793ec5f chore: bump version to 2026.4.18.3 and optimize pom.xml dependencies
- Bump all module versions from 2025.11.1 to 2026.4.18.3
- Remove orphaned dc3-common-influx dependency and property from root pom.xml
- Standardize dependency comment style in dc3-common/pom.xml
- Merge gRPC dependency groups into single section in dc3-common-api
- Restructure Spring Integration MQTT and Eclipse Paho groups in dc3-common-mqtt
- Fix incorrect comment 'DC3 Common Exception' to 'DC3 Common Related' in dc3-common-postgres
- Add missing blank line before </dependencies> in dc3-common-driver
- Remove stray blank line in root pom.xml dependencyManagement
2026-04-18 01:05:30 +08:00
Vickey 0adff1532b refactor: replace deprecated EnvironmentPostProcessor imports and update JsonMapper references 2026-02-11 11:56:52 +08:00
zzi666 9ea3aa20f7 docs(mqtt): add javadoc comments to MQTT and PostgreSQL config and service classes 2026-01-05 15:34:01 +08:00
Vickey 0e419bab05 feat: update pom 2025-11-11 13:22:24 +08:00
zzi666 21eaa5da34 refactor: remove unused files, standardize code comments and documentation across modules 2025-10-27 10:15:25 +08:00
zzi666 73fe41091e refactor: standardize descriptions, comments, and documentation across POM files and Protobuf definitions 2025-10-24 20:07:28 +08:00
zzi666 518d2a8b7d refactor: update Java docs, README files, and Protobuf comments for consistent language and formatting 2025-10-24 16:51:40 +08:00
Vickey a9e8d05631 feat: update version 2025-10-05 17:16:37 +08:00
Vickey 7302107c56 chore: bump all module versions to 2025.9.2 2025-09-11 17:02:24 +08:00
Vickey 2051d42847 refactor(common): remove hutool dependency and replace usages with native utilities 2025-09-11 14:57:02 +08:00
Vickey 8cc7365293 build: bump all module versions to 2025.6.6 and update compose image tags 2025-08-26 22:38:53 +08:00
Vickey 022bab4fbd chore: switch license declaration from Apache-2.0 to AGPL-3.0 across all poms 2025-08-26 22:16:35 +08:00
Vickey 64c6f911fe chore: replace Apache-2.0 license headers with AGPL-3.0 in compose files and gateway config 2025-08-26 22:03:42 +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 f415207088 build: bump project version to 2025.6.5 across all modules 2025-07-15 14:58:51 +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 708148f861 feat(common-data): add DeviceEvent/DriverEvent managers, extend UserBO/VO, update postgres config 2025-05-14 17:00:50 +08:00