diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/dml/V3.0.0_11_1__data.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/dml/V3.0.0_11_1__data.sql index 73648dcabb..73c6d83b3a 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/dml/V3.0.0_11_1__data.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/dml/V3.0.0_11_1__data.sql @@ -4,7 +4,7 @@ SET SESSION innodb_lock_wait_timeout = 7200; -- 初始化组织 INSERT INTO organization (id, num, name, description, create_user, update_user, create_time, update_time) VALUES ('100001', 100001, '默认组织', '系统默认创建的组织', 'admin', 'admin', unix_timestamp() * 1000, unix_timestamp() * 1000); -- 初始化项目 -INSERT INTO project (id, num, organization_id, name, description, create_user, update_user, create_time, update_time) VALUES ('100001100001', 100001, (SELECT id FROM organization WHERE name LIKE '默认组织'), '默认项目', '系统默认创建的项目', 'admin', 'admin', unix_timestamp() * 1000, unix_timestamp() * 1000); +INSERT INTO project (id, num, organization_id, name, description, create_user, update_user, create_time, update_time, module_setting) VALUES ('100001100001', 100001, (SELECT id FROM organization WHERE name LIKE '默认组织'), '默认项目', '系统默认创建的项目', 'admin', 'admin', unix_timestamp() * 1000, unix_timestamp() * 1000,'["workstation","loadTest","testPlan","bugManagement","caseManagement","apiTest","uiTest"]'); -- 初始化用户 insert into user(id, name, email, password, create_time, update_time, language, last_organization_id, phone, source, last_project_id, create_user, update_user,deleted) diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/dto/environment/EnvironmentConfig.java b/backend/services/project-management/src/main/java/io/metersphere/project/dto/environment/EnvironmentConfig.java index b495ea46f5..bf22bd0f9a 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/dto/environment/EnvironmentConfig.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/dto/environment/EnvironmentConfig.java @@ -8,7 +8,6 @@ import io.metersphere.project.dto.environment.host.HostConfig; import io.metersphere.project.dto.environment.http.HttpConfig; import io.metersphere.project.dto.environment.script.post.EnvironmentPostScript; import io.metersphere.project.dto.environment.script.pre.EnvironmentPreScript; -import io.metersphere.project.dto.environment.ssl.KeyStoreConfig; import io.metersphere.project.dto.environment.tcp.TCPConfig; import io.metersphere.project.dto.environment.variables.CommonVariables; import io.swagger.v3.oas.annotations.media.Schema; @@ -37,8 +36,6 @@ public class EnvironmentConfig implements Serializable { private TCPConfig tcpConfig; @Schema(description = "认证配置") private AuthConfig authConfig; - @Schema(description = "SSL配置") - private KeyStoreConfig sslConfig; @Schema(description = "全局前置脚本") private EnvironmentPreScript preScript; @Schema(description = "全局后置脚本") @@ -58,7 +55,6 @@ public class EnvironmentConfig implements Serializable { this.preScript = new EnvironmentPreScript(); this.postScript = new EnvironmentPostScript(); this.assertions = new EnvironmentAssertions(); - this.sslConfig = new KeyStoreConfig(); } } diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/dto/environment/auth/AuthConfig.java b/backend/services/project-management/src/main/java/io/metersphere/project/dto/environment/auth/AuthConfig.java index 63c4789c0d..2a8d1672d4 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/dto/environment/auth/AuthConfig.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/dto/environment/auth/AuthConfig.java @@ -1,5 +1,6 @@ package io.metersphere.project.dto.environment.auth; +import io.metersphere.project.dto.environment.ssl.KeyStoreConfig; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -13,9 +14,12 @@ public class AuthConfig implements Serializable { @Schema(description = "密码") private String password; - @Schema(description = "认证方式 No Auth、Basic Auth、Digest Auth、ssl") + @Schema(description = "认证方式 No Auth、Basic Auth、Digest Auth、ssl证书") private String verification; + @Schema(description = "SSL配置") + private KeyStoreConfig sslConfig; + @Serial private static final long serialVersionUID = 1L; } diff --git a/backend/services/project-management/src/test/java/io/metersphere/project/controller/EnvironmentControllerTests.java b/backend/services/project-management/src/test/java/io/metersphere/project/controller/EnvironmentControllerTests.java index 1f554f656a..d0872be0d3 100644 --- a/backend/services/project-management/src/test/java/io/metersphere/project/controller/EnvironmentControllerTests.java +++ b/backend/services/project-management/src/test/java/io/metersphere/project/controller/EnvironmentControllerTests.java @@ -582,7 +582,9 @@ public class EnvironmentControllerTests extends BaseTest { checkLog(response.getId(), OperationLogType.ADD); //ssl配置 - envConfig.setSslConfig(createKeyStoreConfig()); + AuthConfig authConfig = envConfig.getAuthConfig(); + authConfig.setSslConfig(createKeyStoreConfig()); + envConfig.setAuthConfig(authConfig); request.setName("sslConfig"); request.setConfig(envConfig); paramMap.set("request", JSON.toJSONString(request)); @@ -600,8 +602,8 @@ public class EnvironmentControllerTests extends BaseTest { if (StringUtils.isNotBlank(config)) { EnvironmentConfig environmentConfig = JSON.parseObject(config, EnvironmentConfig.class); Assertions.assertNotNull(environmentConfig); - Assertions.assertNotNull(environmentConfig.getSslConfig()); - Assertions.assertEquals(envConfig.getSslConfig(), environmentConfig.getSslConfig()); + Assertions.assertNotNull(environmentConfig.getAuthConfig()); + Assertions.assertEquals(envConfig.getAuthConfig().getSslConfig(), environmentConfig.getAuthConfig().getSslConfig()); } //校验日志 checkLog(response.getId(), OperationLogType.ADD);