Skip to content

Commit 56bf79d

Browse files
mjabascal10CopilotAlexSanchez-bitylladaKbayero
authored
Release/v11.0.2 (#1481)
* fix(alert): remove debug logs from ngOnInit method in alert entity display Signed-off-by: Manuel Abascal <[email protected]> * feat(agent): add TLS connection option and update command generation for syslog integrations Signed-off-by: Manuel Abascal <[email protected]> * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * Update frontend/src/app/app-management/api-keys/shared/components/api-key-modal/api-key-modal.component.ts Co-authored-by: Copilot <[email protected]> * Update backend/src/main/java/com/park/utmstack/security/api_key/ApiKeyFilter.java Co-authored-by: Copilot <[email protected]> * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): enhance clipboard functionality with fallback support and feedback Signed-off-by: Manuel Abascal <[email protected]> * feat(api_key): enhance ApiKeyFilter with improved logging and validation checks * feat(api_key): enhance ApiKeyFilter with improved logging and validation checks * fix[frontend](web_console): sanitized password parameter to admit all utf8 characters even url structure ones * feat[backend](api-keys): added api keys dto, controllers and entities * feat[backend](api_keys): added api keys * feat(api_keys): create api_keys table with user_id and add foreign key constraint * feat(api_keys): implement API key management with CRUD operations and validation * refactor(api_keys): simplify API key management by removing user ID dependency in service methods * feat(api_keys): implement API key filtering and usage logging for enhanced security * feat[frontend](api_key): added api key list/creation components * refactor(api_keys): remove unused ApplicationEventService from ApiKeyFilter * refactor(api_keys): update API key table schema and change ID type to BIGINT * feat(api_keys): enhance API key management UI Signed-off-by: Manuel Abascal <[email protected]> * feat(api_keys): enhance API key management UI Signed-off-by: Manuel Abascal <[email protected]> * feat(api_keys): implement API key filtering and usage logging for enhanced security * feat(api_keys): enhance API key management with new fields and logging improvements * feat(api_keys): enhance IP address management with validation and error handling Signed-off-by: Manuel Abascal <[email protected]> * feat(api_keys): add API key generation and expiration handling with user feedback Signed-off-by: Manuel Abascal <[email protected]> * feat(api_keys): update API key modal for editing and improved deletion confirmation Signed-off-by: Manuel Abascal <[email protected]> * refactor(api_keys): change API key identifier type from UUID to Long for consistency * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): improve API key listing with pagination, loading states, and expiration indicators Signed-off-by: Manuel Abascal <[email protected]> * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * Update frontend/src/app/app-management/api-keys/shared/components/api-key-modal/api-key-modal.component.ts Co-authored-by: Copilot <[email protected]> * Update backend/src/main/java/com/park/utmstack/security/api_key/ApiKeyFilter.java Co-authored-by: Copilot <[email protected]> * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): enhance clipboard functionality with fallback support and feedback Signed-off-by: Manuel Abascal <[email protected]> * feat(api_key): enhance ApiKeyFilter with improved logging and validation checks * feat(api_key): enhance ApiKeyFilter with improved logging and validation checks * feat(api_key): enhance ApiKeyFilter with improved logging and validation checks * refactor(agent): remove unused TLS certificate validation and related functions; * Update frontend/src/app/core/auth/account.service.ts Co-authored-by: Copilot <[email protected]> * feat(agent): validate TLS certificates before enabling TLS for integrations * feat(agent): add TLS support for syslog command generation and update argument handling Signed-off-by: Manuel Abascal <[email protected]> * feat(agent): add TLS support for syslog command generation and update argument handling Signed-off-by: Manuel Abascal <[email protected]> * refactor(agent): remove unused TLS certificate validation and related functions; * fix[frontend](web_console): sanitized password parameter to admit all utf8 characters even url structure ones * Update frontend/src/app/core/auth/account.service.ts Co-authored-by: Copilot <[email protected]> * fix[frontend](app_settings): added GMT+12 and daylight saving options on date settings * feat(agent): validate TLS certificates before enabling TLS for integrations * fix[frontend](web_console): sanitized password parameter to admit all utf8 characters even url structure ones * feat[backend](api-keys): added api keys dto, controllers and entities * feat[backend](api_keys): added api keys * feat(api_keys): create api_keys table with user_id and add foreign key constraint * feat(api_keys): implement API key management with CRUD operations and validation * refactor(api_keys): simplify API key management by removing user ID dependency in service methods * feat(api_keys): implement API key filtering and usage logging for enhanced security * feat[frontend](api_key): added api key list/creation components * refactor(api_keys): remove unused ApplicationEventService from ApiKeyFilter * refactor(api_keys): update API key table schema and change ID type to BIGINT * feat(api_keys): enhance API key management UI Signed-off-by: Manuel Abascal <[email protected]> * feat(api_keys): enhance API key management UI Signed-off-by: Manuel Abascal <[email protected]> * feat(api_keys): implement API key filtering and usage logging for enhanced security * feat(api_keys): enhance API key management with new fields and logging improvements * feat(api_keys): enhance IP address management with validation and error handling Signed-off-by: Manuel Abascal <[email protected]> * feat(api_keys): add API key generation and expiration handling with user feedback Signed-off-by: Manuel Abascal <[email protected]> * feat(api_keys): update API key modal for editing and improved deletion confirmation Signed-off-by: Manuel Abascal <[email protected]> * refactor(api_keys): change API key identifier type from UUID to Long for consistency * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): improve API key listing with pagination, loading states, and expiration indicators Signed-off-by: Manuel Abascal <[email protected]> * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * Update frontend/src/app/app-management/api-keys/shared/components/api-key-modal/api-key-modal.component.ts Co-authored-by: Copilot <[email protected]> * Update backend/src/main/java/com/park/utmstack/security/api_key/ApiKeyFilter.java Co-authored-by: Copilot <[email protected]> * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): enhance clipboard functionality with fallback support and feedback Signed-off-by: Manuel Abascal <[email protected]> * feat(api_key): enhance ApiKeyFilter with improved logging and validation checks * feat(api_key): enhance ApiKeyFilter with improved logging and validation checks * feat(api_key): enhance ApiKeyFilter with improved logging and validation checks * feat[backend](api-keys): added api keys dto, controllers and entities * feat[backend](api_keys): added api keys * feat(api_keys): create api_keys table with user_id and add foreign key constraint * feat(api_keys): implement API key management with CRUD operations and validation * feat[frontend](api_key): added api key list/creation components * refactor(api_keys): remove unused ApplicationEventService from ApiKeyFilter * refactor(api_keys): update API key table schema and change ID type to BIGINT * feat(api_keys): enhance API key management UI Signed-off-by: Manuel Abascal <[email protected]> * feat(api_keys): implement API key filtering and usage logging for enhanced security * feat(api_keys): enhance API key management with new fields and logging improvements * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * feat(api_keys): simplify API key listing endpoint and enhance expiration handling * Update backend/src/main/java/com/park/utmstack/security/api_key/ApiKeyFilter.java Co-authored-by: Copilot <[email protected]> * feat: improve asset source sorting and display in assets view Signed-off-by: Manuel Abascal <[email protected]> * feat: enhance loading state handling in chart and view components Signed-off-by: Manuel Abascal <[email protected]> * feat: enhance alert rule modal presentation and improve alert completion messaging Signed-off-by: Manuel Abascal <[email protected]> * feat: enhance asset detail interaction and add trackBy function for performance Signed-off-by: Manuel Abascal <[email protected]> * feat: add isEcho input to data field render for conditional rendering of alert status and action components Signed-off-by: Manuel Abascal <[email protected]> * feat: add adversary field rendering to alert view detail component Signed-off-by: Manuel Abascal <[email protected]> * feat: add adversary field rendering to alert view detail component Signed-off-by: Manuel Abascal <[email protected]> * feat: rename UtmLogstashFilterResource to UtmFilterResource and update API endpoints * feat: enhance logstash filters component with loading state and quick create functionality Signed-off-by: Manuel Abascal <[email protected]> * feat(agent): update TLS command generation for syslog integrations to use concatenation Signed-off-by: Manuel Abascal <[email protected]> * feat: update database schema and properties for v11 release * feat: update database schema and properties for v11 release * feat: refactor constants for log event data and update Elasticsearch query * feat: refactor event handling to use Event type and update related components Signed-off-by: Manuel Abascal <[email protected]> * feat: enhance agent console UI and improve password input handling Signed-off-by: Manuel Abascal <[email protected]> * feat: refactor layout and styling for active directory components Signed-off-by: Manuel Abascal <[email protected]> * feat: enhance add rule component with after events section and modal styling Signed-off-by: Manuel Abascal <[email protected]> * feat: improve layout and styling for active directory event component Signed-off-by: Manuel Abascal <[email protected]> * feat: add changelogs to hide compliance menu items and update filters visualization * feat: filter compliance standards by ID in the HTTP response Signed-off-by: Manuel Abascal <[email protected]> * feat: implement search functionality for fields in condition item component Signed-off-by: Manuel Abascal <[email protected]> * feat: remove duplicate alert badge fields and clean up HTML structure Signed-off-by: Manuel Abascal <[email protected]> * feat: remove loading spinner from visualization preview tooltip Signed-off-by: Manuel Abascal <[email protected]> * feat: update aggregation field mappings in filters visualization * feat: comment out documentation alert in logstash filter create component Signed-off-by: Manuel Abascal <[email protected]> * feat: add changelog to disable correlation rules with regex * feat: update placement attribute to support multiple positions in alert action select component Signed-off-by: Manuel Abascal <[email protected]> * feat: condition builder visibility based on fields availability Signed-off-by: Manuel Abascal <[email protected]> * feat: add system owner field to alert response rules and update related logic * feat: add systemOwner filter to playbooks component Signed-off-by: Manuel Abascal <[email protected]> * feat: add system owner field to alert response rules and update related logic * feat: enhance playbook component with improved layout and functionality Signed-off-by: Manuel Abascal <[email protected]> * feat: enhance playbook component with improved layout and functionality Signed-off-by: Manuel Abascal <[email protected]> * feat: enhance playbook component with improved layout and functionality Signed-off-by: Manuel Abascal <[email protected]> * feat: add system owner field to alert response rules and update related logic * feat: enhance playbook component with improved layout and functionality Signed-off-by: Manuel Abascal <[email protected]> * feat: update agent handling strategy description for clarity and context Signed-off-by: Manuel Abascal <[email protected]> * feat: update agent handling strategy description for clarity and context Signed-off-by: Manuel Abascal <[email protected]> * fix: change PostgreSQL logger level from WARN to ERROR * feat: update log handling and display logic for improved clarity and consistency Signed-off-by: Manuel Abascal <[email protected]> * feat: update log filter selection to improve user experience Signed-off-by: Manuel Abascal <[email protected]> * fix: handle potential null value in audits length check Signed-off-by: Manuel Abascal <[email protected]> * fix: update filterBySelect method to accept a generic field type Signed-off-by: Manuel Abascal <[email protected]> * feat: update workflows and send to new cm in gcp * feat: include script to compile installer * fix: resolve workflow errors and improve cross-platform compatibility * fix problem with agent SIGN KEY * feat: implement service to automatically assign asset groups to alerts * feat: add asset group fields to alert constants and configuration Signed-off-by: Manuel Abascal <[email protected]> * feat(agent/syslog): add RFC 5424 octet counting framing support and improve message handling * fix: always update pending versions * improve v11 changelog * feat: enhance playbook UI and loading behavior, add new alert fields Signed-off-by: Manuel Abascal <[email protected]> * feat: add CrowdStrike plugin core implementation * feat: add gRPC configuration management for CrowdStrike * refactor: update version info handling and clean up community module display Signed-off-by: Manuel Abascal <[email protected]> * refactor: remove deprecated standalone plugin architecture * feat: enhance timezone handling by dynamically generating timezone list Signed-off-by: Manuel Abascal <[email protected]> * feat: enhance timezone handling by dynamically generating timezone list Signed-off-by: Manuel Abascal <[email protected]> * fix[bitdefender-plugin]: make StartServer blocking and remove retry loop * update macos guide * fix: adjust TFA expiration time to use configurable constant * feat: conditionally render module card based on module name Signed-off-by: Manuel Abascal <[email protected]> * feat: add application version info retrieval functionality * feat: add application version info retrieval functionality Signed-off-by: Manuel Abascal <[email protected]> * feat: add application version info retrieval functionality * fix: remove conditional rendering for AS_400 module and filter out in module retrieval Signed-off-by: Manuel Abascal <[email protected]> * feat(o365-plugin): add multi-cloud environment support for Microsoft Cloud (Commercial, GCC, GCC High, DoD) * feat: add exception handling for MethodArgumentNotValidException and update UtmModuleConfigValidator logic * fix(o365-plugin): Remove invalid field check and add multi-cloud support - Implement cloud-aware connection checking per authority - Use correct endpoints and scopes for each cloud environment * feat(o365-plugin): add Office 365 cloud environment configuration options * Update backend/src/main/resources/config/liquibase/changelog/20251125001_add_environment_o365_integration.xml Co-authored-by: Copilot <[email protected]> * Update backend/src/main/java/com/park/utmstack/domain/application_modules/factory/impl/ModuleO365.java Co-authored-by: Copilot <[email protected]> * Update backend/src/main/java/com/park/utmstack/domain/application_modules/UtmModuleGroupConfiguration.java Co-authored-by: Copilot <[email protected]> * fix: update file permissions from 777 to 755 for security improvements * feat(azure plugin): enhance Azure cloud detection and connection validation * feat(o365_validation-modules-config): add Management API validation and multi-cloud endpoint support * feat(header): integrate version info display and update logic Signed-off-by: Manuel Abascal <[email protected]> * refactor: rename UtmStackConnectionService to ModuleConfigurationValidationService and enhance validation logic * feat(exception-handling): add ApiException class and global exception handler * feat(int-generic-group-config): improve searchable option based on config options length Signed-off-by: Manuel Abascal <[email protected]> * feat(int-generic-group-config): improve searchable option based on config options length Signed-off-by: Manuel Abascal <[email protected]> * fix(modules-config): disable CROWDSTRIKE module not implemented in backend. * refactor(plugins): standardize logging with catcher * style(dashboard): adjust padding and layout for improved UI consistency Signed-off-by: Manuel Abascal <[email protected]> * fix: optimize cloud detection logic in connection string parsing * feat(elastic-filter-time): enhance time filter functionality and update UI interactions Signed-off-by: Manuel Abascal <[email protected]> * feat(azure): extract individual records from Azure Event Hub logs Parse Azure logs with 'records' array structure and send each record as a separate log entry for better indexing and security analysis. Maintains backward compatibility for logs without records array. * fix(modules-config): remove gin default logger middleware to eliminate non-standardized HTTP logs while maintaining catcher logging standard and panic protection. * refactor(azure-filter): deleted 'Expand log.records' data to improve parsing * refactor(gcp-filter): deleted 'Expand jsonPayload.structuredRdata' data to improve parsing * update the version of the Azure and GCP filters * fix(totp): prevent potential error by checking subscription before unsubscribe Signed-off-by: Manuel Abascal <[email protected]> * style(totp): comment out unused email resend container for cleaner code Signed-off-by: Manuel Abascal <[email protected]> * style(utm-code-view): add word-break class to code element for better text handling Signed-off-by: Manuel Abascal <[email protected]> * feat(filters): add Azure and GCP filters with updated field mappings and severity handling * refactor(ModuleSocAi): remove unused getName method for cleaner code * fix(deployment-pipeline): update tag pattern for v10 to support semantic versioning * chore(changelog): update release notes for UTMStack v11.0.3 with fixed issues and performance improvements * chore(changelog): update release notes for UTMStack v11.0.3 with fixed issues and performance improvements --------- Signed-off-by: Manuel Abascal <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: AlexSanchez-bit <[email protected]> Co-authored-by: Yadian Llada Lopez <[email protected]> Co-authored-by: Yorjander Hernandez Vergara <[email protected]> Co-authored-by: JocLRojas <[email protected]> Co-authored-by: Osmany Montero <[email protected]>
1 parent b41e4be commit 56bf79d

File tree

63 files changed

+1992
-409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1992
-409
lines changed

.github/workflows/v11-deployment-pipeline.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ jobs:
193193
curl -sSL "https://storage.googleapis.com/utmstack-updates/dependencies/agent/utmstack_agent_dependencies_linux.zip" -o ./dependencies/agent/utmstack_agent_dependencies_linux.zip
194194
curl -sSL "https://storage.googleapis.com/utmstack-updates/dependencies/agent/utmstack_agent_dependencies_windows.zip" -o ./dependencies/agent/utmstack_agent_dependencies_windows.zip
195195
curl -sSL "https://storage.googleapis.com/utmstack-updates/dependencies/agent/utmstack_agent_dependencies_windows_arm64.zip" -o ./dependencies/agent/utmstack_agent_dependencies_windows_arm64.zip
196+
curl -sSL "https://storage.googleapis.com/utmstack-updates/dependencies/agent/utmstack-macos-agent-v10.pkg" -o ./dependencies/agent/utmstack-macos-agent.pkg
196197
197198
cp "${{ github.workspace }}/agent/utmstack_agent_service" ./dependencies/agent/
198199
cp "${{ github.workspace }}/agent/utmstack_agent_service.exe" ./dependencies/agent/

CHANGELOG.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
# UTMStack 11.0.1 Release Notes
1+
# UTMStack 11.0.3
22

3-
- Enriched the TIMEZONES constant to include additional IANA zones for broader coverage.
4-
- Support for additional syslog framing methods (RFC 5424 octet counting).
3+
This is the release notes for **UTMStack v11.0.3**, a minor update focused on bug fixes and performance improvements.
4+
5+
## Fixed Issues
6+
7+
- Fixed a bug in the SOC-AI integration that caused occasional failures when generating insights.
8+
- Fixed a bug when trying to enroll and authenticate by TFA.
9+
10+
## Enhancements
11+
12+
- SIEM configuration now adapts to the Sovereign Cloud Model implemented by the provider in each region for Azure and Microsoft 365 integrations.

backend/src/main/java/com/park/utmstack/advice/GlobalExceptionHandler.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.springframework.http.HttpStatus;
1111
import org.springframework.http.ResponseEntity;
1212
import org.springframework.security.authentication.BadCredentialsException;
13+
import org.springframework.web.bind.MethodArgumentNotValidException;
1314
import org.springframework.web.bind.annotation.ExceptionHandler;
1415
import org.springframework.web.bind.annotation.RestControllerAdvice;
1516

@@ -60,6 +61,16 @@ public ResponseEntity<?> handleConflict(Exception e, HttpServletRequest request)
6061
return ResponseUtil.buildErrorResponse(HttpStatus.CONFLICT, e.getMessage());
6162
}
6263

64+
@ExceptionHandler(MethodArgumentNotValidException.class)
65+
public ResponseEntity<?> handleMethodArgumentNotValid(MethodArgumentNotValidException e, HttpServletRequest request) {
66+
return ResponseUtil.buildBadRequestResponse(e.getBindingResult().getAllErrors().get(0).getDefaultMessage());
67+
}
68+
69+
@ExceptionHandler(ApiException.class)
70+
public ResponseEntity<?> handleApiException(ApiException ex) {
71+
return ResponseUtil.buildErrorResponse(ex.getStatus(), ex.getMessage());
72+
}
73+
6374
@ExceptionHandler(Exception.class)
6475
public ResponseEntity<?> handleGenericException(Exception e, HttpServletRequest request) {
6576
return ResponseUtil.buildInternalServerErrorResponse(e.getMessage());

backend/src/main/java/com/park/utmstack/aop/logging/NoLogException.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package com.park.utmstack.aop.logging;
22

3-
import java.lang.annotation.ElementType;
4-
import java.lang.annotation.Retention;
5-
import java.lang.annotation.RetentionPolicy;
6-
import java.lang.annotation.Target;
3+
import java.lang.annotation.*;
74

5+
@Inherited
86
@Target(ElementType.TYPE)
97
@Retention(RetentionPolicy.RUNTIME)
108
public @interface NoLogException {}

backend/src/main/java/com/park/utmstack/config/Constants.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ public final class Constants {
162162
public static final String API_KEY_HEADER = "Utm-Api-Key";
163163
public static final List<String> API_ENDPOINT_IGNORE = Collections.emptyList();
164164

165+
// Application version file
166+
public static final String APP_VERSION_FILE = "/updates/version.json";
167+
165168
private Constants() {
166169
}
167170
}

backend/src/main/java/com/park/utmstack/domain/application_modules/UtmModuleGroupConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ public UtmModuleGroupConfiguration(ModuleConfigurationKey key) {
7171
this.confDataType = key.getConfDataType();
7272
this.confRequired = key.getConfRequired();
7373
this.confOptions = key.getConfOptions();
74-
this.confVisibility = key.getConfOptions();
74+
this.confValue = key.getConfValue();
75+
this.confVisibility = key.getConfVisibility();
7576
}
7677

7778
}

backend/src/main/java/com/park/utmstack/domain/application_modules/factory/impl/ModuleO365.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,22 @@ public List<ModuleConfigurationKey> getConfigurationKeys(Long groupId) throws Ex
7272
.withConfDataType("text")
7373
.withConfRequired(true)
7474
.build());
75+
76+
keys.add(ModuleConfigurationKey.builder()
77+
.withGroupId(groupId)
78+
.withConfKey("office365_cloud_environment")
79+
.withConfName("Cloud Environment")
80+
.withConfDescription("Select the Microsoft cloud environment for Office 365 integration.")
81+
.withConfDataType("select")
82+
.withConfRequired(false)
83+
.withConfValue("Commercial")
84+
.withConfOptions("[" +
85+
"{ \"value\": \"Commercial\", \"label\": \"Commercial - Azure commercial global (Default)\" }," +
86+
"{ \"value\": \"GCC\", \"label\": \"GCC - US Government Community Cloud\" }," +
87+
"{ \"value\": \"GCCHigh\", \"label\": \"GCC High - US Government Community Cloud High (DoD IL4)\" }," +
88+
"{ \"value\": \"DoD\", \"label\": \"DoD - US Department of Defense (DoD IL5)\" }" +
89+
"]")
90+
.build());
7591
return keys;
7692
}
7793

backend/src/main/java/com/park/utmstack/domain/application_modules/factory/impl/ModuleSocAi.java

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.park.utmstack.domain.application_modules.types.ModuleConfigurationKey;
88
import com.park.utmstack.domain.application_modules.types.ModuleRequirement;
99
import com.park.utmstack.domain.application_modules.validators.UtmModuleConfigValidator;
10+
import com.park.utmstack.repository.UtmModuleGroupConfigurationRepository;
1011
import com.park.utmstack.service.application_modules.UtmModuleService;
1112
import lombok.RequiredArgsConstructor;
1213
import org.springframework.stereotype.Component;
@@ -23,6 +24,7 @@ public class ModuleSocAi implements IModule {
2324

2425
private final UtmModuleService moduleService;
2526
private final UtmModuleConfigValidator utmStackConfigValidator;
27+
private final UtmModuleGroupConfigurationRepository moduleGroupConfigurationRepository;
2628

2729
@Override
2830
public UtmModule getDetails(Long serverId) throws Exception {
@@ -102,8 +104,49 @@ public List<ModuleConfigurationKey> getConfigurationKeys(Long groupId) throws Ex
102104
return keys;
103105
}
104106

105-
public boolean validateConfiguration(UtmModule module, List<UtmModuleGroupConfiguration> configuration) throws Exception {
106-
return utmStackConfigValidator.validate(module, configuration);
107+
public boolean validateConfiguration(UtmModule module, List<UtmModuleGroupConfiguration> configuration) {
108+
109+
if(configuration == null || configuration.isEmpty()) {
110+
throw new IllegalArgumentException("Configurations cannot be null or empty");
111+
}
112+
113+
Long groupId = configuration.get(0).getGroupId();
114+
115+
List<UtmModuleGroupConfiguration> dbConfigs = moduleGroupConfigurationRepository
116+
.findAllByGroupId(groupId);
117+
118+
UtmModuleGroupConfiguration providerConfig = configuration.stream()
119+
.filter(c -> "utmstack.socai.provider".equals(c.getConfKey()))
120+
.findFirst()
121+
.orElseGet(() -> dbConfigs.stream()
122+
.filter(c -> "utmstack.socai.provider".equals(c.getConfKey()))
123+
.findFirst()
124+
.orElse(null));
125+
126+
List<UtmModuleGroupConfiguration> configs = dbConfigs.stream()
127+
.filter(c -> !"utmstack.socai.provider".equals(c.getConfKey()))
128+
.toList();
129+
130+
List<UtmModuleGroupConfiguration> filteredConfigs = providerConfig != null && "custom".equals(providerConfig.getConfValue())
131+
? filterCustomConfigs(configs)
132+
: filterStandardConfigs(configs);
133+
134+
filteredConfigs.add(providerConfig);
135+
136+
return utmStackConfigValidator.validate(module, configuration, filteredConfigs);
137+
}
138+
139+
private List<UtmModuleGroupConfiguration> filterCustomConfigs(List<UtmModuleGroupConfiguration> configs) {
140+
return configs.stream()
141+
.filter(config -> !config.getConfKey().equals("utmstack.socai.model"))
142+
.collect(Collectors.toList());
143+
}
144+
145+
private List<UtmModuleGroupConfiguration> filterStandardConfigs(List<UtmModuleGroupConfiguration> configs) {
146+
return configs.stream()
147+
.filter(config -> !config.getConfKey().equals("utmstack.socai.custom.model") &&
148+
!config.getConfKey().equals("utmstack.socai.custom.url"))
149+
.collect(Collectors.toList());
107150
}
108151

109152
@Override

backend/src/main/java/com/park/utmstack/domain/application_modules/types/ModuleConfigurationKey.java

Lines changed: 21 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,24 @@
11
package com.park.utmstack.domain.application_modules.types;
22

3+
import lombok.Getter;
4+
import lombok.Setter;
5+
6+
@Getter
7+
@Setter
38
public class ModuleConfigurationKey {
49
private Long groupId;
510
private String confKey;
611
private String confName;
12+
private String confValue;
713
private String confDescription;
814
private String confDataType;
915
private String confOptions;
10-
16+
private String confVisibility;
1117
private Boolean confRequired;
1218

1319
private ModuleConfigurationKey() {
1420
}
1521

16-
public Long getGroupId() {
17-
return groupId;
18-
}
19-
20-
public void setGroupId(Long groupId) {
21-
this.groupId = groupId;
22-
}
23-
24-
public String getConfKey() {
25-
return confKey;
26-
}
27-
28-
public void setConfKey(String confKey) {
29-
this.confKey = confKey;
30-
}
31-
32-
public String getConfName() {
33-
return confName;
34-
}
35-
36-
public void setConfName(String confName) {
37-
this.confName = confName;
38-
}
39-
40-
public String getConfDescription() {
41-
return confDescription;
42-
}
43-
44-
public void setConfDescription(String confDescription) {
45-
this.confDescription = confDescription;
46-
}
47-
48-
public String getConfDataType() {
49-
return confDataType;
50-
}
51-
52-
public void setConfDataType(String confDataType) {
53-
this.confDataType = confDataType;
54-
}
55-
56-
public Boolean getConfRequired() {
57-
return confRequired;
58-
}
59-
60-
public void setConfRequired(Boolean confRequired) {
61-
this.confRequired = confRequired;
62-
}
63-
64-
public String getConfOptions() {
65-
return confOptions;
66-
}
67-
68-
public void setConfOptions(String confOptions) {
69-
this.confOptions = confOptions;
70-
}
71-
7222
public static Builder builder() {
7323
return new Builder();
7424
}
@@ -77,11 +27,11 @@ public static class Builder {
7727
private Long groupId;
7828
private String confKey;
7929
private String confName;
30+
private String confValue;
8031
private String confDescription;
8132
private String confDataType;
8233
private Boolean confRequired;
83-
private Boolean confVisible = true;
84-
34+
private String confVisibility;
8535
private String confOptions;
8636

8737
public Builder withGroupId(Long groupId) {
@@ -119,6 +69,16 @@ public Builder withConfOptions(String confOptions) {
11969
return this;
12070
}
12171

72+
public Builder withConfValue(String confValue) {
73+
this.confValue = confValue;
74+
return this;
75+
}
76+
77+
public Builder withConfVisibility(String confVisibility) {
78+
this.confVisibility = confVisibility;
79+
return this;
80+
}
81+
12282
public ModuleConfigurationKey build() {
12383
ModuleConfigurationKey key = new ModuleConfigurationKey();
12484
key.setGroupId(groupId);
@@ -128,6 +88,8 @@ public ModuleConfigurationKey build() {
12888
key.setConfDataType(confDataType);
12989
key.setConfRequired(confRequired);
13090
key.setConfOptions(confOptions);
91+
key.setConfValue(confValue);
92+
key.setConfVisibility(confVisibility);
13193
return key;
13294
}
13395
}

backend/src/main/java/com/park/utmstack/domain/application_modules/validators/UtmModuleConfigValidator.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,49 @@
44
import com.park.utmstack.domain.application_modules.UtmModule;
55
import com.park.utmstack.domain.application_modules.UtmModuleGroupConfiguration;
66
import com.park.utmstack.repository.UtmModuleGroupConfigurationRepository;
7-
import com.park.utmstack.service.application_modules.connectors.UtmStackConnectionService;
7+
import com.park.utmstack.service.application_modules.connectors.ModuleConfigurationValidationService;
88
import com.park.utmstack.service.dto.application_modules.UtmModuleGroupConfDTO;
99
import com.park.utmstack.service.dto.application_modules.UtmModuleGroupConfWrapperDTO;
1010
import com.park.utmstack.util.CipherUtil;
1111
import lombok.RequiredArgsConstructor;
1212
import org.springframework.stereotype.Service;
1313

1414
import java.util.List;
15-
import java.util.stream.Collectors;
1615

1716
@Service
1817
@RequiredArgsConstructor
1918
public class UtmModuleConfigValidator {
2019

2120
private final UtmModuleGroupConfigurationRepository moduleGroupConfigurationRepository;
22-
private final UtmStackConnectionService utmStackConnectionService;
21+
private final ModuleConfigurationValidationService utmStackConnectionService;
2322

24-
public boolean validate(UtmModule module, List<UtmModuleGroupConfiguration> keys) throws Exception {
23+
public boolean validate(UtmModule module, List<UtmModuleGroupConfiguration> keys) {
2524
if (keys.isEmpty()) return false;
2625

2726
List<UtmModuleGroupConfiguration> dbConfigs = moduleGroupConfigurationRepository
2827
.findAllByGroupId(keys.get(0).getGroupId());
2928

29+
return validate(module, keys, dbConfigs);
30+
}
31+
32+
public boolean validate(UtmModule module, List<UtmModuleGroupConfiguration> keys, List<UtmModuleGroupConfiguration> dbConfigs) {
33+
if (keys.isEmpty()) return false;
34+
3035
List<UtmModuleGroupConfDTO> configDTOs = dbConfigs.stream()
3136
.map(dbConf -> {
3237
UtmModuleGroupConfiguration override = findInKeys(keys, dbConf.getConfKey());
3338
UtmModuleGroupConfiguration source = override != null ? override : dbConf;
3439

3540
return new UtmModuleGroupConfDTO(
3641
source.getConfKey(),
37-
decryptIfNeeded(source.getConfDataType(), source.getConfValue())
42+
override != null ? source.getConfValue() : decryptIfNeeded(source.getConfDataType(), source.getConfValue())
3843
);
3944
})
4045
.toList();
4146

4247
UtmModuleGroupConfWrapperDTO body = new UtmModuleGroupConfWrapperDTO(configDTOs);
4348

44-
return utmStackConnectionService.testConnection(module.getModuleName().name(), body);
49+
return utmStackConnectionService.validateModuleConfiguration(module.getModuleName().name(), body);
4550
}
4651

4752
private UtmModuleGroupConfiguration findInKeys(List<UtmModuleGroupConfiguration> keys, String confKey) {

0 commit comments

Comments
 (0)