diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index aca2f0de0f..c917cb8792 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -25,7 +25,7 @@ jobs: save-api-cli: ${{ steps.calculate-dependencies.outputs.save-api-cli }} save-backend: ${{ steps.calculate-dependencies.outputs.save-backend }} save-cloud-common: ${{ steps.calculate-dependencies.outputs.save-cloud-common }} - save-cosv: ${{ steps.calculate-dependencies.outputs.save-cosv }} + cosv-backend: ${{ steps.calculate-dependencies.outputs.cosv-backend }} cosv-frontend: ${{ steps.calculate-dependencies.outputs.cosv-frontend }} save-demo: ${{ steps.calculate-dependencies.outputs.save-demo }} save-demo-agent: ${{ steps.calculate-dependencies.outputs.save-demo-agent }} @@ -66,8 +66,8 @@ jobs: - save-backend/** save-cloud-common: - save-cloud-common/** - save-cosv: - - save-cosv/** + cosv-backend: + - cosv-backend/** cosv-frontend: - cosv-frontend/** save-demo: @@ -100,14 +100,14 @@ jobs: authentication_service=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.authentication-service_all_changed_files_count }} )) save_api=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.save-api_all_changed_files_count }} )) - save_cosv=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.save-cosv_all_changed_files_count }} )) + cosv_backend=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.cosv-backend_all_changed_files_count }} )) test_analysis_core=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.test-analysis-core_all_changed_files_count }} )) test_utils=$(( ${{ steps.git-changed-files.outputs.test-utils_all_changed_files_count }} )) api_gateway=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.api-gateway_all_changed_files_count }} )) save_agent=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.save-agent_all_changed_files_count }} )) save_api_cli=$(( $save_cloud_common + $save_api + ${{ steps.git-changed-files.outputs.save-api-cli_all_changed_files_count }} )) - save_backend=$(( $save_cloud_common + $authentication_service + $test_analysis_core + $save_cosv + $test_utils + ${{ steps.git-changed-files.outputs.save-backend_all_changed_files_count }} )) + save_backend=$(( $save_cloud_common + $authentication_service + $test_analysis_core + $cosv_backend + $test_utils + ${{ steps.git-changed-files.outputs.save-backend_all_changed_files_count }} )) cosv_frontend=$(( $save_cloud_common + $save_frontend_common + ${{ steps.git-changed-files.outputs.cosv-frontend_all_changed_files_count }} )) save_demo=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.save-demo_all_changed_files_count }} )) save_demo_agent=$(( $save_cloud_common + ${{ steps.git-changed-files.outputs.save-demo-agent_all_changed_files_count }} )) @@ -123,7 +123,7 @@ jobs: echo "save-api-cli=$save_api_cli" >> "$GITHUB_OUTPUT" echo "save-backend=$save_backend" >> "$GITHUB_OUTPUT" echo "save-cloud-common=$save_cloud_common" >> "$GITHUB_OUTPUT" - echo "save-cosv=$save_cosv" >> "$GITHUB_OUTPUT" + echo "cosv-backend=$cosv_backend" >> "$GITHUB_OUTPUT" echo "cosv-frontend=$cosv_frontend" >> "$GITHUB_OUTPUT" echo "save-demo=$save_demo" >> "$GITHUB_OUTPUT" echo "save-demo-agent=$save_demo_agent" >> "$GITHUB_OUTPUT" @@ -172,7 +172,7 @@ jobs: 'save-api', 'save-api-cli', 'save-backend', - 'save-cosv', + 'cosv-backend', 'cosv-frontend', 'save-demo', 'save-demo-agent', @@ -198,8 +198,8 @@ jobs: do-build: ${{ github.event_name == 'push' || needs.calculate_build_flags.outputs.save-demo-cpg > 0 }} - module: save-backend do-build: ${{ github.event_name == 'push' || needs.calculate_build_flags.outputs.save-backend > 0 }} - - module: save-cosv - do-build: ${{ github.event_name == 'push' || needs.calculate_build_flags.outputs.save-cosv > 0 }} + - module: cosv-backend + do-build: ${{ github.event_name == 'push' || needs.calculate_build_flags.outputs.cosv-backend > 0 }} - module: cosv-frontend do-build: ${{ github.event_name == 'push' || needs.calculate_build_flags.outputs.cosv-frontend > 0 }} - module: save-demo diff --git a/.github/workflows/deploy_images.yml b/.github/workflows/deploy_images.yml index fe1c673cdd..12accb1e6b 100644 --- a/.github/workflows/deploy_images.yml +++ b/.github/workflows/deploy_images.yml @@ -89,7 +89,7 @@ jobs: fail-fast: false matrix: module: [ - 'save-cosv', + 'cosv-backend', 'api-gateway', 'save-frontend', 'cosv-frontend', @@ -98,7 +98,7 @@ jobs: 'save-demo-cpg', ] include: - - module: save-cosv + - module: cosv-backend do-build: ${{ inputs.backend }} - module: api-gateway do-build: ${{ inputs.gateway }} diff --git a/buildSrc/src/main/kotlin/com/saveourtool/save/buildutils/DockerStackConfiguration.kt b/buildSrc/src/main/kotlin/com/saveourtool/save/buildutils/DockerStackConfiguration.kt index 1e9d7832f3..a74a42bf8f 100644 --- a/buildSrc/src/main/kotlin/com/saveourtool/save/buildutils/DockerStackConfiguration.kt +++ b/buildSrc/src/main/kotlin/com/saveourtool/save/buildutils/DockerStackConfiguration.kt @@ -28,18 +28,22 @@ fun Project.registerLiquibaseTask(profile: String) { val registerLiquibaseTaskBackend = registerLiquibaseTask( projectName = "save-backend", relativeChangeLogFile = "db/db.changelog-master.xml", - profile = profile + profile = profile, + mustRunAfterTask = null, ) val registerLiquibaseTaskDemo = registerLiquibaseTask( projectName = "save-demo", relativeChangeLogFile = "save-demo/db/db.changelog-demo.xml", - profile = profile + profile = profile, + mustRunAfterTask = "save-backend", ) + val registerLiquibaseTaskCosv = registerLiquibaseTask( - projectName = "save-cosv", - relativeChangeLogFile = "save-cosv/db/db.changelog-cosv.xml", - profile = profile + projectName = "cosv-backend", + relativeChangeLogFile = "cosv-backend/db/db.changelog-cosv.xml", + profile = profile, + mustRunAfterTask = "save-backend", ) tasks.register("liquibaseUpdate") { dependsOn( @@ -50,11 +54,16 @@ fun Project.registerLiquibaseTask(profile: String) { } } -private fun Project.registerLiquibaseTask(projectName: String, relativeChangeLogFile: String, profile: String): TaskProvider { +private fun Project.registerLiquibaseTask(projectName: String, relativeChangeLogFile: String, profile: String, mustRunAfterTask: String?): TaskProvider { val taskName = "liquibaseUpdate" + projectName.split("-").map { it.capitalized() }.joinToString("") val credentials = getDatabaseCredentials(projectName, profile) return tasks.register(taskName) { + + mustRunAfterTask?.let { + mustRunAfter("liquibaseUpdate" + it.split("-").map { it.capitalized() }.joinToString("")) + } + val contexts = when (profile) { "prod" -> "prod" "dev" -> "dev" diff --git a/save-cosv/build.gradle.kts b/cosv-backend/build.gradle.kts similarity index 100% rename from save-cosv/build.gradle.kts rename to cosv-backend/build.gradle.kts diff --git a/save-cosv/db/db.changelog-cosv.xml b/cosv-backend/db/db.changelog-cosv.xml similarity index 100% rename from save-cosv/db/db.changelog-cosv.xml rename to cosv-backend/db/db.changelog-cosv.xml diff --git a/save-cosv/db/tables/_all_changelogs.xml b/cosv-backend/db/tables/_all_changelogs.xml similarity index 100% rename from save-cosv/db/tables/_all_changelogs.xml rename to cosv-backend/db/tables/_all_changelogs.xml diff --git a/save-cosv/db/tables/cosv-file.xml b/cosv-backend/db/tables/cosv-file.xml similarity index 100% rename from save-cosv/db/tables/cosv-file.xml rename to cosv-backend/db/tables/cosv-file.xml diff --git a/save-cosv/db/tables/cosv-generated-id.xml b/cosv-backend/db/tables/cosv-generated-id.xml similarity index 100% rename from save-cosv/db/tables/cosv-generated-id.xml rename to cosv-backend/db/tables/cosv-generated-id.xml diff --git a/save-cosv/db/tables/lnk-vulnerability-metadata-tag.xml b/cosv-backend/db/tables/lnk-vulnerability-metadata-tag.xml similarity index 100% rename from save-cosv/db/tables/lnk-vulnerability-metadata-tag.xml rename to cosv-backend/db/tables/lnk-vulnerability-metadata-tag.xml diff --git a/save-cosv/db/tables/lnk-vulnerability-metadata-user.xml b/cosv-backend/db/tables/lnk-vulnerability-metadata-user.xml similarity index 100% rename from save-cosv/db/tables/lnk-vulnerability-metadata-user.xml rename to cosv-backend/db/tables/lnk-vulnerability-metadata-user.xml diff --git a/save-cosv/db/tables/raw-cosv-file.xml b/cosv-backend/db/tables/raw-cosv-file.xml similarity index 100% rename from save-cosv/db/tables/raw-cosv-file.xml rename to cosv-backend/db/tables/raw-cosv-file.xml diff --git a/save-cosv/db/tables/vulnerability-metadata-project.xml b/cosv-backend/db/tables/vulnerability-metadata-project.xml similarity index 100% rename from save-cosv/db/tables/vulnerability-metadata-project.xml rename to cosv-backend/db/tables/vulnerability-metadata-project.xml diff --git a/save-cosv/db/tables/vulnerability-metadata.xml b/cosv-backend/db/tables/vulnerability-metadata.xml similarity index 100% rename from save-cosv/db/tables/vulnerability-metadata.xml rename to cosv-backend/db/tables/vulnerability-metadata.xml diff --git a/save-cosv/db/test-data/cosv-file-insert.xml b/cosv-backend/db/test-data/cosv-file-insert.xml similarity index 87% rename from save-cosv/db/test-data/cosv-file-insert.xml rename to cosv-backend/db/test-data/cosv-file-insert.xml index 165fee195e..1286fe6662 100644 --- a/save-cosv/db/test-data/cosv-file-insert.xml +++ b/cosv-backend/db/test-data/cosv-file-insert.xml @@ -6,7 +6,7 @@ http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd"> - + diff --git a/save-cosv/db/test-data/db.changelog-insert.xml b/cosv-backend/db/test-data/db.changelog-insert.xml similarity index 100% rename from save-cosv/db/test-data/db.changelog-insert.xml rename to cosv-backend/db/test-data/db.changelog-insert.xml diff --git a/save-cosv/db/test-data/lnk-vulnerability-metadata-user-insert.xml b/cosv-backend/db/test-data/lnk-vulnerability-metadata-user-insert.xml similarity index 85% rename from save-cosv/db/test-data/lnk-vulnerability-metadata-user-insert.xml rename to cosv-backend/db/test-data/lnk-vulnerability-metadata-user-insert.xml index 517b4bd170..04e6829305 100644 --- a/save-cosv/db/test-data/lnk-vulnerability-metadata-user-insert.xml +++ b/cosv-backend/db/test-data/lnk-vulnerability-metadata-user-insert.xml @@ -7,7 +7,7 @@ - + diff --git a/save-cosv/db/test-data/sqlRequests/cosv-file.csv b/cosv-backend/db/test-data/sqlRequests/cosv-file.csv similarity index 100% rename from save-cosv/db/test-data/sqlRequests/cosv-file.csv rename to cosv-backend/db/test-data/sqlRequests/cosv-file.csv diff --git a/save-cosv/db/test-data/sqlRequests/lnk-vulnerability-metadata-user.csv b/cosv-backend/db/test-data/sqlRequests/lnk-vulnerability-metadata-user.csv similarity index 100% rename from save-cosv/db/test-data/sqlRequests/lnk-vulnerability-metadata-user.csv rename to cosv-backend/db/test-data/sqlRequests/lnk-vulnerability-metadata-user.csv diff --git a/save-cosv/db/test-data/sqlRequests/vulnerability-metadata-project.csv b/cosv-backend/db/test-data/sqlRequests/vulnerability-metadata-project.csv similarity index 100% rename from save-cosv/db/test-data/sqlRequests/vulnerability-metadata-project.csv rename to cosv-backend/db/test-data/sqlRequests/vulnerability-metadata-project.csv diff --git a/save-cosv/db/test-data/sqlRequests/vulnerability-metadata.csv b/cosv-backend/db/test-data/sqlRequests/vulnerability-metadata.csv similarity index 100% rename from save-cosv/db/test-data/sqlRequests/vulnerability-metadata.csv rename to cosv-backend/db/test-data/sqlRequests/vulnerability-metadata.csv diff --git a/save-cosv/db/test-data/vulnerability-metadata-insert.xml b/cosv-backend/db/test-data/vulnerability-metadata-insert.xml similarity index 95% rename from save-cosv/db/test-data/vulnerability-metadata-insert.xml rename to cosv-backend/db/test-data/vulnerability-metadata-insert.xml index f871a07ec3..9b88a3fa0b 100644 --- a/save-cosv/db/test-data/vulnerability-metadata-insert.xml +++ b/cosv-backend/db/test-data/vulnerability-metadata-insert.xml @@ -6,7 +6,7 @@ http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd"> - + diff --git a/save-cosv/db/test-data/vulnerability-metadata-project-insert.xml b/cosv-backend/db/test-data/vulnerability-metadata-project-insert.xml similarity index 88% rename from save-cosv/db/test-data/vulnerability-metadata-project-insert.xml rename to cosv-backend/db/test-data/vulnerability-metadata-project-insert.xml index 47b6ecf799..3377dd0993 100644 --- a/save-cosv/db/test-data/vulnerability-metadata-project-insert.xml +++ b/cosv-backend/db/test-data/vulnerability-metadata-project-insert.xml @@ -6,7 +6,7 @@ http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd"> - + diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/CosvApplication.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/CosvApplication.kt similarity index 59% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/CosvApplication.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/CosvApplication.kt index 43a7bcfff7..2c140233b4 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/CosvApplication.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/CosvApplication.kt @@ -1,6 +1,6 @@ -package com.saveourtool.save.cosv +package com.saveourtool.cosv.backend -import com.saveourtool.save.cosv.configs.ConfigProperties +import com.saveourtool.cosv.backend.configs.ConfigProperties import com.saveourtool.save.s3.DefaultS3Configuration import org.springframework.boot.SpringApplication import org.springframework.boot.autoconfigure.SpringBootApplication @@ -9,9 +9,18 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.context.annotation.Import /** - * An entrypoint for spring for save-cosv + * An entrypoint for spring for cosv-backend */ -@SpringBootApplication(scanBasePackages = ["com.saveourtool.save.utils", "com.saveourtool.save"]) +@SpringBootApplication(scanBasePackages = [ + "com.saveourtool.save.configs", + "com.saveourtool.cosv.backend", + "com.saveourtool.save.service", + "com.saveourtool.save.storage", + "com.saveourtool.save.security", + "com.saveourtool.save.utils", + "com.saveourtool.save.repository", + "com.saveourtool.save.authservice", +]) @EnableConfigurationProperties(ConfigProperties::class) @Import( DefaultS3Configuration::class, diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/CosvConfiguration.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/CosvConfiguration.kt similarity index 94% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/CosvConfiguration.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/CosvConfiguration.kt index 7e6ccf3ec9..9855667f80 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/CosvConfiguration.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/CosvConfiguration.kt @@ -1,4 +1,4 @@ -package com.saveourtool.save.cosv +package com.saveourtool.cosv.backend import com.zaxxer.hikari.HikariDataSource import org.springframework.beans.factory.annotation.Qualifier @@ -21,7 +21,7 @@ import javax.sql.DataSource */ @Configuration @ComponentScan -@EnableJpaRepositories(basePackages = ["com.saveourtool.save.cosv.repository"]) +@EnableJpaRepositories(basePackages = ["com.saveourtool.cosv.backend.repository"]) class CosvConfiguration { /** * @param properties diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/configs/ConfigProperties.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/configs/ConfigProperties.kt similarity index 93% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/configs/ConfigProperties.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/configs/ConfigProperties.kt index df8b367a05..518cc843ea 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/configs/ConfigProperties.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/configs/ConfigProperties.kt @@ -1,4 +1,4 @@ -package com.saveourtool.save.cosv.configs +package com.saveourtool.cosv.backend.configs import com.saveourtool.save.s3.S3OperationsProperties import org.springframework.boot.context.properties.ConfigurationProperties diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/configs/PersistenceSaveAutoConfiguration.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/configs/PersistenceSaveAutoConfiguration.kt similarity index 97% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/configs/PersistenceSaveAutoConfiguration.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/configs/PersistenceSaveAutoConfiguration.kt index b70849ce4f..db7ab0ab21 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/configs/PersistenceSaveAutoConfiguration.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/configs/PersistenceSaveAutoConfiguration.kt @@ -1,4 +1,4 @@ -package com.saveourtool.save.cosv.configs +package com.saveourtool.cosv.backend.configs import org.springframework.beans.factory.annotation.Qualifier import org.springframework.boot.context.properties.ConfigurationProperties diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/CommentController.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/CommentController.kt similarity index 98% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/CommentController.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/CommentController.kt index a78b03497b..b8d83fa394 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/CommentController.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/CommentController.kt @@ -1,4 +1,4 @@ -package com.saveourtool.save.cosv.controllers +package com.saveourtool.cosv.backend.controllers import com.saveourtool.save.configs.ApiSwaggerSupport import com.saveourtool.save.entities.Comment diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/CosvController.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/CosvController.kt similarity index 96% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/CosvController.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/CosvController.kt index 6eed5a064c..85c0543588 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/CosvController.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/CosvController.kt @@ -1,8 +1,8 @@ -package com.saveourtool.save.cosv.controllers +package com.saveourtool.cosv.backend.controllers +import com.saveourtool.cosv.backend.service.CosvService import com.saveourtool.save.configs.ApiSwaggerSupport import com.saveourtool.save.configs.RequiresAuthorizationSourceHeader -import com.saveourtool.save.cosv.service.CosvService import com.saveourtool.save.entities.cosv.CosvFileDto import com.saveourtool.save.entities.cosv.VulnerabilityMetadataDto import com.saveourtool.save.entities.cosv.VulnerabilityMetadataDtoWithUserAndOrganization @@ -10,9 +10,9 @@ import com.saveourtool.save.service.OrganizationService import com.saveourtool.save.service.UserService import com.saveourtool.save.utils.* import com.saveourtool.save.v1 + import org.springframework.http.HttpStatus import org.springframework.security.core.Authentication - import org.springframework.web.bind.annotation.* import reactor.core.publisher.Flux import reactor.core.publisher.Mono diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/OrganizationController.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/OrganizationController.kt similarity index 99% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/OrganizationController.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/OrganizationController.kt index 44bbea27db..f399cdcfa5 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/OrganizationController.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/OrganizationController.kt @@ -1,9 +1,9 @@ -package com.saveourtool.save.cosv.controllers +package com.saveourtool.cosv.backend.controllers +import com.saveourtool.cosv.backend.configs.ConfigProperties import com.saveourtool.save.authservice.utils.userId import com.saveourtool.save.configs.ApiSwaggerSupport import com.saveourtool.save.configs.RequiresAuthorizationSourceHeader -import com.saveourtool.save.cosv.configs.ConfigProperties import com.saveourtool.save.domain.OrganizationSaveStatus import com.saveourtool.save.domain.Role import com.saveourtool.save.entities.* diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/RawCosvFileController.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/RawCosvFileController.kt similarity index 98% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/RawCosvFileController.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/RawCosvFileController.kt index 6be16d40ef..6e184e28f4 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/RawCosvFileController.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/RawCosvFileController.kt @@ -1,11 +1,11 @@ -package com.saveourtool.save.cosv.controllers +package com.saveourtool.cosv.backend.controllers +import com.saveourtool.cosv.backend.configs.ConfigProperties +import com.saveourtool.cosv.backend.service.CosvService +import com.saveourtool.cosv.backend.storage.RawCosvFileStorage import com.saveourtool.save.authservice.utils.userId import com.saveourtool.save.configs.ApiSwaggerSupport import com.saveourtool.save.configs.RequiresAuthorizationSourceHeader -import com.saveourtool.save.cosv.configs.ConfigProperties -import com.saveourtool.save.cosv.service.CosvService -import com.saveourtool.save.cosv.storage.RawCosvFileStorage import com.saveourtool.save.entities.cosv.* import com.saveourtool.save.entities.cosv.RawCosvFileDto.Companion.isDuplicate import com.saveourtool.save.entities.cosv.RawCosvFileDto.Companion.isUploadedJsonFile @@ -15,6 +15,7 @@ import com.saveourtool.save.service.UserService import com.saveourtool.save.storage.concatS3Key import com.saveourtool.save.utils.* import com.saveourtool.save.v1 + import org.reactivestreams.Publisher import org.springframework.dao.DataIntegrityViolationException import org.springframework.data.domain.PageRequest @@ -31,9 +32,11 @@ import reactor.core.publisher.Flux import reactor.core.publisher.Mono import reactor.core.scheduler.Schedulers import reactor.kotlin.core.publisher.toFlux + import java.nio.ByteBuffer import java.nio.file.Files import java.nio.file.Path + import kotlin.io.path.* typealias RawCosvFileDtoFlux = Flux diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/TagController.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/TagController.kt similarity index 95% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/TagController.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/TagController.kt index 8bdcff891b..e27b0e7008 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/TagController.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/TagController.kt @@ -1,9 +1,10 @@ -package com.saveourtool.save.cosv.controllers +package com.saveourtool.cosv.backend.controllers +import com.saveourtool.cosv.backend.service.TagService import com.saveourtool.save.configs.ApiSwaggerSupport -import com.saveourtool.save.cosv.service.TagService import com.saveourtool.save.utils.blockingToMono import com.saveourtool.save.v1 + import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.Parameter import io.swagger.v3.oas.annotations.Parameters diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/UsersDetailsController.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/UsersDetailsController.kt similarity index 99% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/UsersDetailsController.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/UsersDetailsController.kt index 0021e11b21..8a4d2536a0 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/UsersDetailsController.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/UsersDetailsController.kt @@ -1,9 +1,9 @@ -package com.saveourtool.save.cosv.controllers +package com.saveourtool.cosv.backend.controllers +import com.saveourtool.cosv.backend.configs.ConfigProperties import com.saveourtool.save.authservice.utils.SaveUserDetails import com.saveourtool.save.authservice.utils.userId import com.saveourtool.save.configs.RequiresAuthorizationSourceHeader -import com.saveourtool.save.cosv.configs.ConfigProperties import com.saveourtool.save.domain.UserSaveStatus import com.saveourtool.save.entities.User import com.saveourtool.save.info.UserInfo @@ -13,6 +13,7 @@ import com.saveourtool.save.service.UserService import com.saveourtool.save.utils.* import com.saveourtool.save.v1 import com.saveourtool.save.validation.isValidLengthName + import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.Parameter import io.swagger.v3.oas.annotations.Parameters @@ -21,7 +22,6 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse import org.springframework.boot.web.reactive.function.client.WebClientCustomizer import org.springframework.data.domain.Pageable import org.springframework.data.repository.findByIdOrNull - import org.springframework.http.HttpStatus import org.springframework.http.ResponseEntity import org.springframework.security.access.prepost.PreAuthorize diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/VulnerabilityController.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/VulnerabilityController.kt similarity index 97% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/VulnerabilityController.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/VulnerabilityController.kt index f3a3d6f573..023bba1cca 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/controllers/VulnerabilityController.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/controllers/VulnerabilityController.kt @@ -1,13 +1,13 @@ -package com.saveourtool.save.cosv.controllers +package com.saveourtool.cosv.backend.controllers +import com.saveourtool.cosv.backend.security.VulnerabilityPermissionEvaluator +import com.saveourtool.cosv.backend.service.CosvService +import com.saveourtool.cosv.backend.service.VulnerabilityMetadataDtoList +import com.saveourtool.cosv.backend.service.VulnerabilityService +import com.saveourtool.cosv.backend.utils.hasRole import com.saveourtool.save.authservice.utils.username import com.saveourtool.save.configs.ApiSwaggerSupport import com.saveourtool.save.configs.RequiresAuthorizationSourceHeader -import com.saveourtool.save.cosv.security.VulnerabilityPermissionEvaluator -import com.saveourtool.save.cosv.service.CosvService -import com.saveourtool.save.cosv.service.VulnerabilityMetadataDtoList -import com.saveourtool.save.cosv.service.VulnerabilityService -import com.saveourtool.save.cosv.utils.hasRole import com.saveourtool.save.domain.Role import com.saveourtool.save.entities.cosv.VulnerabilityExt import com.saveourtool.save.entities.cosv.VulnerabilityMetadataDto @@ -20,6 +20,7 @@ import com.saveourtool.save.permission.Permission import com.saveourtool.save.service.UserService import com.saveourtool.save.utils.* import com.saveourtool.save.v1 + import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.responses.ApiResponse import io.swagger.v3.oas.annotations.tags.Tag diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/event/CommentListener.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/event/CommentListener.kt similarity index 92% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/event/CommentListener.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/event/CommentListener.kt index ebaa671e62..2ee5979a1d 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/event/CommentListener.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/event/CommentListener.kt @@ -1,7 +1,7 @@ -package com.saveourtool.save.cosv.event +package com.saveourtool.cosv.backend.event -import com.saveourtool.save.cosv.repository.LnkVulnerabilityMetadataUserRepository -import com.saveourtool.save.cosv.service.VulnerabilityMetadataService +import com.saveourtool.cosv.backend.repository.LnkVulnerabilityMetadataUserRepository +import com.saveourtool.cosv.backend.service.VulnerabilityMetadataService import com.saveourtool.save.entities.Notification import com.saveourtool.save.entities.User import com.saveourtool.save.evententities.CommentEvent diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/processor/CosvProcessor.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/processor/CosvProcessor.kt similarity index 90% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/processor/CosvProcessor.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/processor/CosvProcessor.kt index 30c54c1084..4bf92ead80 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/processor/CosvProcessor.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/processor/CosvProcessor.kt @@ -1,7 +1,7 @@ -package com.saveourtool.save.cosv.processor +package com.saveourtool.cosv.backend.processor +import com.saveourtool.cosv.backend.utils.toJsonArrayOrSingle import com.saveourtool.osv4k.RawOsvSchema as RawCosvSchema -import com.saveourtool.save.cosv.utils.toJsonArrayOrSingle import org.springframework.stereotype.Component diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/CosvFileRepository.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/CosvFileRepository.kt similarity index 93% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/CosvFileRepository.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/CosvFileRepository.kt index 6e6bf163f9..5cd908fbd4 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/CosvFileRepository.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/CosvFileRepository.kt @@ -1,4 +1,4 @@ -package com.saveourtool.save.cosv.repository +package com.saveourtool.cosv.backend.repository import com.saveourtool.save.entitiescosv.CosvFile import com.saveourtool.save.spring.repository.BaseEntityRepository diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/CosvGeneratedIdRepository.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/CosvGeneratedIdRepository.kt similarity index 86% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/CosvGeneratedIdRepository.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/CosvGeneratedIdRepository.kt index ac4bc8e633..41ddc6a5af 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/CosvGeneratedIdRepository.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/CosvGeneratedIdRepository.kt @@ -1,4 +1,4 @@ -package com.saveourtool.save.cosv.repository +package com.saveourtool.cosv.backend.repository import com.saveourtool.save.entitiescosv.CosvGeneratedId import com.saveourtool.save.spring.repository.BaseEntityRepository diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/CosvRepository.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/CosvRepository.kt similarity index 98% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/CosvRepository.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/CosvRepository.kt index 8417762b7a..df2020495e 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/CosvRepository.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/CosvRepository.kt @@ -1,4 +1,4 @@ -package com.saveourtool.save.cosv.repository +package com.saveourtool.cosv.backend.repository import com.saveourtool.osv4k.OsvSchema import com.saveourtool.save.entities.cosv.CosvFileDto diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/CosvRepositoryInStorage.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/CosvRepositoryInStorage.kt similarity index 93% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/CosvRepositoryInStorage.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/CosvRepositoryInStorage.kt index 4e06eff6a6..fb96149267 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/CosvRepositoryInStorage.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/CosvRepositoryInStorage.kt @@ -1,7 +1,7 @@ -package com.saveourtool.save.cosv.repository +package com.saveourtool.cosv.backend.repository -import com.saveourtool.save.cosv.storage.CosvFileS3KeyManager -import com.saveourtool.save.cosv.storage.CosvFileStorage +import com.saveourtool.cosv.backend.storage.CosvFileS3KeyManager +import com.saveourtool.cosv.backend.storage.CosvFileStorage import com.saveourtool.save.entities.cosv.CosvFileDto import com.saveourtool.save.entitiescosv.CosvFile import com.saveourtool.save.utils.* diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/LnkVulnerabilityMetadataTagRepository.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/LnkVulnerabilityMetadataTagRepository.kt similarity index 97% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/LnkVulnerabilityMetadataTagRepository.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/LnkVulnerabilityMetadataTagRepository.kt index 857053fe3e..ed316d3c7d 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/LnkVulnerabilityMetadataTagRepository.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/LnkVulnerabilityMetadataTagRepository.kt @@ -1,4 +1,4 @@ -package com.saveourtool.save.cosv.repository +package com.saveourtool.cosv.backend.repository import com.saveourtool.save.entitiescosv.LnkVulnerabilityMetadataTag import com.saveourtool.save.spring.repository.BaseEntityRepository diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/LnkVulnerabilityMetadataUserRepository.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/LnkVulnerabilityMetadataUserRepository.kt similarity index 94% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/LnkVulnerabilityMetadataUserRepository.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/LnkVulnerabilityMetadataUserRepository.kt index c5de995715..b0b8d7d79a 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/LnkVulnerabilityMetadataUserRepository.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/LnkVulnerabilityMetadataUserRepository.kt @@ -1,4 +1,4 @@ -package com.saveourtool.save.cosv.repository +package com.saveourtool.cosv.backend.repository import com.saveourtool.save.entitiescosv.LnkVulnerabilityMetadataUser import com.saveourtool.save.spring.repository.BaseEntityRepository diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/RawCosvFileRepository.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/RawCosvFileRepository.kt similarity index 96% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/RawCosvFileRepository.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/RawCosvFileRepository.kt index 4faaef05dd..7001a15604 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/RawCosvFileRepository.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/RawCosvFileRepository.kt @@ -1,4 +1,4 @@ -package com.saveourtool.save.cosv.repository +package com.saveourtool.cosv.backend.repository import com.saveourtool.save.entitiescosv.RawCosvFile import com.saveourtool.save.spring.repository.BaseEntityRepository diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/VulnerabilityMetadataProjectRepository.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/VulnerabilityMetadataProjectRepository.kt similarity index 91% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/VulnerabilityMetadataProjectRepository.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/VulnerabilityMetadataProjectRepository.kt index d6680c5b26..eaabc8a40b 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/VulnerabilityMetadataProjectRepository.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/VulnerabilityMetadataProjectRepository.kt @@ -1,4 +1,4 @@ -package com.saveourtool.save.cosv.repository +package com.saveourtool.cosv.backend.repository import com.saveourtool.save.entitiescosv.VulnerabilityMetadataProject import com.saveourtool.save.spring.repository.BaseEntityRepository diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/VulnerabilityMetadataRepository.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/VulnerabilityMetadataRepository.kt similarity index 95% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/VulnerabilityMetadataRepository.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/VulnerabilityMetadataRepository.kt index ca8a3da57d..405e18e6b3 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/repository/VulnerabilityMetadataRepository.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/repository/VulnerabilityMetadataRepository.kt @@ -1,4 +1,4 @@ -package com.saveourtool.save.cosv.repository +package com.saveourtool.cosv.backend.repository import com.saveourtool.save.entities.vulnerability.VulnerabilityStatus import com.saveourtool.save.entitiescosv.VulnerabilityMetadata diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/security/VulnerabilityPermissionEvaluator.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/security/VulnerabilityPermissionEvaluator.kt similarity index 93% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/security/VulnerabilityPermissionEvaluator.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/security/VulnerabilityPermissionEvaluator.kt index fc0864ed78..bd4526fc78 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/security/VulnerabilityPermissionEvaluator.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/security/VulnerabilityPermissionEvaluator.kt @@ -1,14 +1,14 @@ -package com.saveourtool.save.cosv.security +package com.saveourtool.cosv.backend.security +import com.saveourtool.cosv.backend.service.VulnerabilityService +import com.saveourtool.cosv.backend.utils.hasRole import com.saveourtool.save.authservice.utils.userId -import com.saveourtool.save.cosv.service.VulnerabilityService -import com.saveourtool.save.cosv.utils.hasRole import com.saveourtool.save.domain.Role import com.saveourtool.save.entities.cosv.VulnerabilityMetadataDto import com.saveourtool.save.entities.vulnerability.VulnerabilityStatus - import com.saveourtool.save.permission.Permission import com.saveourtool.save.utils.orNotFound + import org.springframework.security.core.Authentication import org.springframework.stereotype.Component diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/service/CosvService.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/service/CosvService.kt similarity index 96% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/service/CosvService.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/service/CosvService.kt index f60085d341..25046539fc 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/service/CosvService.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/service/CosvService.kt @@ -1,13 +1,13 @@ -package com.saveourtool.save.cosv.service +package com.saveourtool.cosv.backend.service +import com.saveourtool.cosv.backend.processor.CosvProcessor +import com.saveourtool.cosv.backend.repository.CosvGeneratedIdRepository +import com.saveourtool.cosv.backend.repository.CosvRepository +import com.saveourtool.cosv.backend.repository.CosvSchema +import com.saveourtool.cosv.backend.repository.LnkVulnerabilityMetadataTagRepository +import com.saveourtool.cosv.backend.storage.RawCosvFileStorage import com.saveourtool.osv4k.* import com.saveourtool.osv4k.RawOsvSchema as RawCosvSchema -import com.saveourtool.save.cosv.processor.CosvProcessor -import com.saveourtool.save.cosv.repository.CosvGeneratedIdRepository -import com.saveourtool.save.cosv.repository.CosvRepository -import com.saveourtool.save.cosv.repository.CosvSchema -import com.saveourtool.save.cosv.repository.LnkVulnerabilityMetadataTagRepository -import com.saveourtool.save.cosv.storage.RawCosvFileStorage import com.saveourtool.save.entities.Organization import com.saveourtool.save.entities.User import com.saveourtool.save.entities.cosv.* diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/service/TagService.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/service/TagService.kt similarity index 95% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/service/TagService.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/service/TagService.kt index c06199b0da..214de5f94a 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/service/TagService.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/service/TagService.kt @@ -1,7 +1,7 @@ -package com.saveourtool.save.cosv.service +package com.saveourtool.cosv.backend.service -import com.saveourtool.save.cosv.repository.LnkVulnerabilityMetadataTagRepository -import com.saveourtool.save.cosv.repository.VulnerabilityMetadataRepository +import com.saveourtool.cosv.backend.repository.LnkVulnerabilityMetadataTagRepository +import com.saveourtool.cosv.backend.repository.VulnerabilityMetadataRepository import com.saveourtool.save.entities.Tag import com.saveourtool.save.entitiescosv.LnkVulnerabilityMetadataTag import com.saveourtool.save.repository.TagRepository diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/service/VulnerabilityMetadataService.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/service/VulnerabilityMetadataService.kt similarity index 96% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/service/VulnerabilityMetadataService.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/service/VulnerabilityMetadataService.kt index fe19ab1786..36c42dc01c 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/service/VulnerabilityMetadataService.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/service/VulnerabilityMetadataService.kt @@ -1,11 +1,11 @@ -package com.saveourtool.save.cosv.service +package com.saveourtool.cosv.backend.service +import com.saveourtool.cosv.backend.repository.AnyCosvSchema +import com.saveourtool.cosv.backend.repository.CosvSchema +import com.saveourtool.cosv.backend.repository.VulnerabilityMetadataRepository +import com.saveourtool.cosv.backend.storage.CosvFileS3KeyManager import com.saveourtool.osv4k.Severity import com.saveourtool.osv4k.SeverityType -import com.saveourtool.save.cosv.repository.AnyCosvSchema -import com.saveourtool.save.cosv.repository.CosvSchema -import com.saveourtool.save.cosv.repository.VulnerabilityMetadataRepository -import com.saveourtool.save.cosv.storage.CosvFileS3KeyManager import com.saveourtool.save.cvsscalculator.calculateBaseScore import com.saveourtool.save.entities.Organization import com.saveourtool.save.entities.User diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/service/VulnerabilityRatingService.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/service/VulnerabilityRatingService.kt similarity index 98% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/service/VulnerabilityRatingService.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/service/VulnerabilityRatingService.kt index da7afbc053..442e81fffb 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/service/VulnerabilityRatingService.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/service/VulnerabilityRatingService.kt @@ -1,4 +1,4 @@ -package com.saveourtool.save.cosv.service +package com.saveourtool.cosv.backend.service import com.saveourtool.save.entities.Organization import com.saveourtool.save.entities.User diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/service/VulnerabilityService.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/service/VulnerabilityService.kt similarity index 99% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/service/VulnerabilityService.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/service/VulnerabilityService.kt index 4045572cd2..12d6b81bdd 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/service/VulnerabilityService.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/service/VulnerabilityService.kt @@ -1,8 +1,8 @@ -package com.saveourtool.save.cosv.service +package com.saveourtool.cosv.backend.service +import com.saveourtool.cosv.backend.repository.* +import com.saveourtool.cosv.backend.utils.hasRole import com.saveourtool.save.authservice.utils.userId -import com.saveourtool.save.cosv.repository.* -import com.saveourtool.save.cosv.utils.hasRole import com.saveourtool.save.domain.Role import com.saveourtool.save.entities.Organization import com.saveourtool.save.entities.Tag diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/storage/CosvFileS3KeyManager.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/storage/CosvFileS3KeyManager.kt similarity index 93% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/storage/CosvFileS3KeyManager.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/storage/CosvFileS3KeyManager.kt index 7a7b6d138f..93d5a9a7f7 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/storage/CosvFileS3KeyManager.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/storage/CosvFileS3KeyManager.kt @@ -1,6 +1,6 @@ -package com.saveourtool.save.cosv.storage +package com.saveourtool.cosv.backend.storage -import com.saveourtool.save.cosv.repository.CosvFileRepository +import com.saveourtool.cosv.backend.repository.CosvFileRepository import com.saveourtool.save.entitiescosv.CosvFile import com.saveourtool.save.entitiescosv.VulnerabilityMetadata import com.saveourtool.save.s3.S3OperationsProperties diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/storage/CosvFileStorage.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/storage/CosvFileStorage.kt similarity index 97% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/storage/CosvFileStorage.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/storage/CosvFileStorage.kt index ad0533b35a..9b5a7eec9b 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/storage/CosvFileStorage.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/storage/CosvFileStorage.kt @@ -1,4 +1,4 @@ -package com.saveourtool.save.cosv.storage +package com.saveourtool.cosv.backend.storage import com.saveourtool.save.entitiescosv.CosvFile import com.saveourtool.save.s3.S3Operations diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/storage/RawCosvFileS3KeyManager.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/storage/RawCosvFileS3KeyManager.kt similarity index 97% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/storage/RawCosvFileS3KeyManager.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/storage/RawCosvFileS3KeyManager.kt index ab4da2274d..6043f145b3 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/storage/RawCosvFileS3KeyManager.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/storage/RawCosvFileS3KeyManager.kt @@ -1,6 +1,6 @@ -package com.saveourtool.save.cosv.storage +package com.saveourtool.cosv.backend.storage -import com.saveourtool.save.cosv.repository.RawCosvFileRepository +import com.saveourtool.cosv.backend.repository.RawCosvFileRepository import com.saveourtool.save.entities.cosv.RawCosvFileDto import com.saveourtool.save.entities.cosv.RawCosvFileStatus import com.saveourtool.save.entitiescosv.RawCosvFile diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/storage/RawCosvFileStorage.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/storage/RawCosvFileStorage.kt similarity index 99% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/storage/RawCosvFileStorage.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/storage/RawCosvFileStorage.kt index 43c11fc3f2..7929924e5f 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/storage/RawCosvFileStorage.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/storage/RawCosvFileStorage.kt @@ -1,4 +1,4 @@ -package com.saveourtool.save.cosv.storage +package com.saveourtool.cosv.backend.storage import com.saveourtool.save.entities.Organization import com.saveourtool.save.entities.User diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/utils/AuthenticationUtils.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/utils/AuthenticationUtils.kt similarity index 90% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/utils/AuthenticationUtils.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/utils/AuthenticationUtils.kt index 231523271c..6efe7ccfc5 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/utils/AuthenticationUtils.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/utils/AuthenticationUtils.kt @@ -1,6 +1,6 @@ @file:Suppress("HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE") -package com.saveourtool.save.cosv.utils +package com.saveourtool.cosv.backend.utils import com.saveourtool.save.domain.Role import org.springframework.security.core.Authentication diff --git a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/utils/JsonUtils.kt b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/utils/JsonUtils.kt similarity index 87% rename from save-cosv/src/main/kotlin/com/saveourtool/save/cosv/utils/JsonUtils.kt rename to cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/utils/JsonUtils.kt index a9e1419638..5076ec9679 100644 --- a/save-cosv/src/main/kotlin/com/saveourtool/save/cosv/utils/JsonUtils.kt +++ b/cosv-backend/src/main/kotlin/com/saveourtool/cosv/backend/utils/JsonUtils.kt @@ -2,7 +2,7 @@ * File contains util methods for Json */ -package com.saveourtool.save.cosv.utils +package com.saveourtool.cosv.backend.utils import kotlinx.serialization.json.* diff --git a/save-cosv/src/main/resources/application-dev.properties b/cosv-backend/src/main/resources/application-dev.properties similarity index 100% rename from save-cosv/src/main/resources/application-dev.properties rename to cosv-backend/src/main/resources/application-dev.properties diff --git a/save-cosv/src/main/resources/application-kubernetes.properties b/cosv-backend/src/main/resources/application-kubernetes.properties similarity index 100% rename from save-cosv/src/main/resources/application-kubernetes.properties rename to cosv-backend/src/main/resources/application-kubernetes.properties diff --git a/save-cosv/src/main/resources/application-prod.properties b/cosv-backend/src/main/resources/application-prod.properties similarity index 100% rename from save-cosv/src/main/resources/application-prod.properties rename to cosv-backend/src/main/resources/application-prod.properties diff --git a/save-cosv/src/main/resources/application.properties b/cosv-backend/src/main/resources/application.properties similarity index 100% rename from save-cosv/src/main/resources/application.properties rename to cosv-backend/src/main/resources/application.properties diff --git a/save-cosv/src/main/resources/bootstrap.yml b/cosv-backend/src/main/resources/bootstrap.yml similarity index 100% rename from save-cosv/src/main/resources/bootstrap.yml rename to cosv-backend/src/main/resources/bootstrap.yml diff --git a/save-cosv/src/main/resources/error.html b/cosv-backend/src/main/resources/error.html similarity index 100% rename from save-cosv/src/main/resources/error.html rename to cosv-backend/src/main/resources/error.html diff --git a/save-cosv/src/main/resources/logback.xml b/cosv-backend/src/main/resources/logback.xml similarity index 100% rename from save-cosv/src/main/resources/logback.xml rename to cosv-backend/src/main/resources/logback.xml diff --git a/gradle/plugins/src/main/kotlin/com/saveourtool/save/buildutils/spring-boot-app-configuration.gradle.kts b/gradle/plugins/src/main/kotlin/com/saveourtool/save/buildutils/spring-boot-app-configuration.gradle.kts index 8569d9f873..1d03cad972 100644 --- a/gradle/plugins/src/main/kotlin/com/saveourtool/save/buildutils/spring-boot-app-configuration.gradle.kts +++ b/gradle/plugins/src/main/kotlin/com/saveourtool/save/buildutils/spring-boot-app-configuration.gradle.kts @@ -33,7 +33,7 @@ tasks.withType().configureEach { os.isWindows -> append(",win") os.isMacOsX -> append(",mac") } - if (listOf("save-backend", "save-cosv").any { project.path.contains(it) }) { + if (listOf("save-backend", "cosv-backend").any { project.path.contains(it) }) { append(",secure") } } diff --git a/save-cloud-charts/save-cloud/values.yaml b/save-cloud-charts/save-cloud/values.yaml index 2f20213444..85145181dd 100644 --- a/save-cloud-charts/save-cloud/values.yaml +++ b/save-cloud-charts/save-cloud/values.yaml @@ -23,7 +23,7 @@ backend: backend_cosv: name: backend-cosv profile: dev,secure,kubernetes - imageName: save-cosv + imageName: cosv-backend containerPort: 5700 managementPort: 5701 clusterIP: null diff --git a/settings.gradle.kts b/settings.gradle.kts index 369f134879..ee0f061bda 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -52,7 +52,7 @@ include("save-demo") include("save-demo-cpg") include("test-analysis-core") include("save-demo-agent") -include("save-cosv") +include("cosv-backend") include("save-frontend-common") enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")