mirror of
https://gitee.com/pnoker/iot-dc3.git
synced 2026-09-17 16:26:23 +08:00
fix: address code review — security, thread safety, performance, and null safety
Security (CRITICAL): - KeyUtil: read JWT signing key from DC3_SECURITY_KEY env/property - UserPasswordServiceImpl: read default password from DC3_SECURITY_DEFAULT_PASSWORD env - KeyLoader: read OPC-UA keystore password from OPCUA_KEYSTORE_PASSWORD env - WebFilterConfig: return 401 on malformed X-Auth-User header - AlgorithmConstant: document deprecated hardcoded constants Thread safety (HIGH): - Fix TOCTOU races in 4 driver connectors (computeIfAbsent) - Fix PlcS7 lock leak, OpcUa connect timeout (5s) - CoapClientManager: synchronize setURI to prevent URI race - PointValueJob, MqttScheduleJob: add @DisallowConcurrentExecution - SystemHealthServiceImpl: preserve interrupt flag - WindowSampleBuffer: local AtomicInteger → int Performance (MEDIUM): - EntityStateExpiryScanner: batch alarm saves (saveBatch) - ImportDeviceServiceImpl: batch config saves - ResourceRegistrySyncServiceImpl: batch-load nodes, eliminate N+1 COUNTs - DriverSenderServiceImpl: debug-gate hot-path logging - PointServiceImpl: stream().count() → size() Null safety (LOW): - RegexUtil: null guards on isName/isPhone/isMail/isPassword/isHost - HostUtil: null-check getNetworkInterfaces() return - TimeUtil: log parse failures instead of silent null Infrastructure: - Add spring-boot-starter-cache + @EnableCaching CacheConfig - Replace embedded modbus4j/plc-s7 jars with external Maven dependencies - Add dc3-driver-modbus-rtu module
This commit is contained in:
@@ -77,8 +77,26 @@
|
||||
<mockito.javaagent.argLine>
|
||||
-javaagent:${settings.localRepository}/org/mockito/mockito-core/${mockito.version}/mockito-core-${mockito.version}.jar
|
||||
</mockito.javaagent.argLine>
|
||||
|
||||
<!-- Modbus -->
|
||||
<modbus4j.version>3.0.3</modbus4j.version>
|
||||
<jserialcomm.version>2.11.0</jserialcomm.version>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
<id>ias-releases</id>
|
||||
<name>Infinite Automation Release Repository</name>
|
||||
<url>https://maven.mangoautomation.net/repository/ias-release/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<modules>
|
||||
<module>dc3-api</module>
|
||||
<module>dc3-common</module>
|
||||
@@ -255,6 +273,20 @@
|
||||
<artifactId>dc3-common-web</artifactId>
|
||||
<version>${dc3.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Modbus Related -->
|
||||
<dependency>
|
||||
<groupId>com.infiniteautomation</groupId>
|
||||
<artifactId>modbus4j</artifactId>
|
||||
<version>${modbus4j.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Serial Communication -->
|
||||
<dependency>
|
||||
<groupId>com.fazecast</groupId>
|
||||
<artifactId>jSerialComm</artifactId>
|
||||
<version>${jserialcomm.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user