Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename save-cloud-common module to common #2951

Merged
merged 9 commits into from
Apr 25, 2024
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion api-gateway/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

dependencies {
api(projects.saveCloudCommon)
api(projects.common)
implementation(libs.spring.cloud.starter.gateway)
implementation(libs.spring.boot.starter.security)
implementation(libs.spring.boot.starter.oauth2.client)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.saveourtool.save.gateway.controller

import com.saveourtool.save.info.OauthProviderInfo
import com.saveourtool.common.info.OauthProviderInfo
import org.springframework.security.oauth2.client.registration.InMemoryReactiveClientRegistrationRepository
import org.springframework.web.bind.annotation.*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

package com.saveourtool.save.gateway.security

import com.saveourtool.common.info.UserStatus
import com.saveourtool.common.v1
import com.saveourtool.save.gateway.config.ConfigurationProperties
import com.saveourtool.save.gateway.service.BackendService
import com.saveourtool.save.gateway.utils.StoringServerAuthenticationSuccessHandler
import com.saveourtool.save.info.UserStatus
import com.saveourtool.save.v1

import org.springframework.context.annotation.Bean
import org.springframework.core.annotation.Order
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.saveourtool.save.gateway.service

import com.saveourtool.common.entities.User
import com.saveourtool.common.utils.SAVE_USER_ID_ATTRIBUTE
import com.saveourtool.common.utils.orNotFound
import com.saveourtool.common.utils.switchIfEmptyToResponseException
import com.saveourtool.save.authservice.utils.SaveUserDetails
import com.saveourtool.save.entities.User
import com.saveourtool.save.gateway.config.ConfigurationProperties
import com.saveourtool.save.utils.SAVE_USER_ID_ATTRIBUTE
import com.saveourtool.save.utils.orNotFound
import com.saveourtool.save.utils.switchIfEmptyToResponseException
import org.springframework.http.HttpStatus

import org.springframework.http.HttpStatus
import org.springframework.http.MediaType
import org.springframework.security.authentication.BadCredentialsException
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken
Expand All @@ -21,6 +21,7 @@ import org.springframework.web.server.WebSession
import reactor.core.publisher.Mono
import reactor.kotlin.core.publisher.switchIfEmpty
import reactor.kotlin.core.publisher.toMono

import java.security.Principal

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.saveourtool.save.gateway.utils

import com.saveourtool.common.utils.SAVE_USER_ID_ATTRIBUTE
import com.saveourtool.save.gateway.service.BackendService
import com.saveourtool.save.utils.SAVE_USER_ID_ATTRIBUTE

import org.slf4j.LoggerFactory
import org.springframework.security.authentication.BadCredentialsException
Expand Down
2 changes: 1 addition & 1 deletion authentication-service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ kotlin {
}

dependencies {
implementation(projects.saveCloudCommon)
implementation(projects.common)
implementation(libs.spring.boot.starter.security)
implementation(libs.spring.security.core)
implementation("org.springframework:spring-jdbc")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

package com.saveourtool.save.authservice.config

import com.saveourtool.common.v1
import com.saveourtool.save.authservice.utils.SaveUserDetails.Companion.toSaveUserDetails
import com.saveourtool.save.authservice.utils.roleHierarchy
import com.saveourtool.save.v1

import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Profile
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.saveourtool.save.authservice.utils

import com.saveourtool.save.entities.User
import com.saveourtool.save.utils.*
import com.saveourtool.common.entities.User
import com.saveourtool.common.utils.*

import com.fasterxml.jackson.annotation.JsonIgnore
import org.springframework.http.HttpHeaders
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

package com.saveourtool.save.authservice.utils

import com.saveourtool.save.domain.Role
import com.saveourtool.save.info.UserStatus
import com.saveourtool.common.domain.Role
import com.saveourtool.common.info.UserStatus
import org.springframework.security.access.hierarchicalroles.RoleHierarchy
import org.springframework.security.access.hierarchicalroles.RoleHierarchyImpl
import org.springframework.security.access.hierarchicalroles.RoleHierarchyUtils
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.saveourtool.save.authservice.utils

import com.saveourtool.save.authservice.utils.SaveUserDetails.Companion.toSaveUserDetails
import com.saveourtool.save.utils.AUTHORIZATION_ID
import com.saveourtool.save.utils.AUTHORIZATION_NAME
import com.saveourtool.save.utils.AUTHORIZATION_ROLES
import com.saveourtool.save.utils.AUTHORIZATION_STATUS
import com.saveourtool.common.utils.AUTHORIZATION_ID
import com.saveourtool.common.utils.AUTHORIZATION_NAME
import com.saveourtool.common.utils.AUTHORIZATION_ROLES
import com.saveourtool.common.utils.AUTHORIZATION_STATUS
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@file:Suppress("VARIABLE_NAME_INCORRECT", "CONSTANT_UPPERCASE", "TopLevelPropertyNaming")
@file:JsExport

package com.saveourtool.save
package com.saveourtool.common

import kotlin.js.JsExport

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

/**
* Env names which agent supports and expects
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import com.saveourtool.save.utils.DEFAULT_SETUP_SH_TIMEOUT_MILLIS
import com.saveourtool.common.utils.DEFAULT_SETUP_SH_TIMEOUT_MILLIS
import kotlinx.serialization.Serializable

/**
Expand All @@ -15,6 +15,6 @@ data class AgentInitConfig(
val saveCliUrl: String,
val testSuitesSourceSnapshotUrl: String,
val additionalFileNameToUrl: Map<String, String>,
val saveCliOverrides: SaveCliOverrides,
val saveCliOverrides: com.saveourtool.common.agent.SaveCliOverrides,
val setupShTimeoutMillis: Long = DEFAULT_SETUP_SH_TIMEOUT_MILLIS,
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import com.saveourtool.save.domain.TestResultDebugInfo
import com.saveourtool.common.domain.TestResultDebugInfo
import kotlinx.serialization.Serializable

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Model classes for heartbeating between save agent and the orchestrator
*/

package com.saveourtool.save.agent
package com.saveourtool.common.agent

import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import com.saveourtool.save.domain.TestResultStatus
import com.saveourtool.save.entities.DtoWithId
import com.saveourtool.save.test.analysis.metrics.NoDataAvailable
import com.saveourtool.save.test.analysis.metrics.TestMetrics
import com.saveourtool.save.test.analysis.results.AnalysisResult
import com.saveourtool.common.domain.TestResultStatus
import com.saveourtool.common.entities.DtoWithId
import com.saveourtool.common.test.analysis.metrics.NoDataAvailable
import com.saveourtool.common.test.analysis.metrics.TestMetrics
import com.saveourtool.common.test.analysis.results.AnalysisResult

import kotlinx.serialization.Serializable

Expand Down Expand Up @@ -53,8 +53,8 @@ data class TestExecutionDto(
hasDebugInfo: Boolean? = null,
testMetrics: TestMetrics = NoDataAvailable.instance,
analysisResults: List<AnalysisResult> = emptyList(),
): TestExecutionExtDto =
TestExecutionExtDto(
): com.saveourtool.common.agent.TestExecutionExtDto =
com.saveourtool.common.agent.TestExecutionExtDto(
this,
hasDebugInfo,
testMetrics,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import com.saveourtool.save.test.analysis.metrics.NoDataAvailable
import com.saveourtool.save.test.analysis.metrics.TestMetrics
import com.saveourtool.save.test.analysis.results.AnalysisResult
import com.saveourtool.common.test.analysis.metrics.NoDataAvailable
import com.saveourtool.common.test.analysis.metrics.TestMetrics
import com.saveourtool.common.test.analysis.results.AnalysisResult
import kotlinx.serialization.Serializable

/**
Expand All @@ -19,7 +19,7 @@ import kotlinx.serialization.Serializable
*/
@Serializable
data class TestExecutionExtDto(
val testExecution: TestExecutionDto,
val testExecution: com.saveourtool.common.agent.TestExecutionDto,
val hasDebugInfo: Boolean? = null,
val testMetrics: TestMetrics = NoDataAvailable.instance,
val analysisResults: List<AnalysisResult> = emptyList(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import com.saveourtool.save.domain.TestResultStatus
import com.saveourtool.common.domain.TestResultStatus
import kotlinx.serialization.Serializable

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.saveourtool.save.agent
package com.saveourtool.common.agent

import com.saveourtool.save.domain.TestResultStatus
import com.saveourtool.common.domain.TestResultStatus

import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@file:JvmName("Flow")
@file:Suppress("HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE")

package com.saveourtool.save.coroutines.flow
package com.saveourtool.common.coroutines.flow

import okio.Buffer
import kotlin.jvm.JvmName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.saveourtool.save.cvsscalculator
package com.saveourtool.common.cvsscalculator

import kotlin.math.roundToInt

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.saveourtool.save.cvsscalculator
package com.saveourtool.common.cvsscalculator

import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("FILE_NAME_INCORRECT")

package com.saveourtool.save.cvsscalculator
package com.saveourtool.common.cvsscalculator

/**
* Base interface for all BaseMetrics classes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("FILE_NAME_INCORRECT")

package com.saveourtool.save.cvsscalculator
package com.saveourtool.common.cvsscalculator

/**
* Base interface for CvssVector classes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE",
)

package com.saveourtool.save.cvsscalculator
package com.saveourtool.common.cvsscalculator

import com.saveourtool.save.cvsscalculator.v2.*
import com.saveourtool.save.cvsscalculator.v3.*
import com.saveourtool.common.cvsscalculator.v2.*
import com.saveourtool.common.cvsscalculator.v3.*

const val CVSS_VERSION = "CVSS"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@file:Suppress("HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE")

package com.saveourtool.save.cvsscalculator.v2
package com.saveourtool.common.cvsscalculator.v2

import com.saveourtool.save.cvsscalculator.*
import com.saveourtool.save.cvsscalculator.v3.*
import com.saveourtool.common.cvsscalculator.*
import com.saveourtool.common.cvsscalculator.v3.*
import kotlinx.serialization.Serializable

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.saveourtool.save.cvsscalculator.v2
package com.saveourtool.common.cvsscalculator.v2

import com.saveourtool.save.cvsscalculator.CvssVectorAbstract
import com.saveourtool.save.cvsscalculator.CvssVersion
import com.saveourtool.save.cvsscalculator.findOrElseThrow
import com.saveourtool.save.cvsscalculator.v3.*
import com.saveourtool.common.cvsscalculator.CvssVectorAbstract
import com.saveourtool.common.cvsscalculator.CvssVersion
import com.saveourtool.common.cvsscalculator.findOrElseThrow
import com.saveourtool.common.cvsscalculator.v3.*
import kotlinx.serialization.Serializable

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE")

package com.saveourtool.save.cvsscalculator.v2
package com.saveourtool.common.cvsscalculator.v2

import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"MagicNumber",
)

package com.saveourtool.save.cvsscalculator.v2
package com.saveourtool.common.cvsscalculator.v2

@Suppress("VARIABLE_NAME_INCORRECT_FORMAT")
val accessV = mapOf(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@file:Suppress("HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE")

package com.saveourtool.save.cvsscalculator.v3
package com.saveourtool.common.cvsscalculator.v3

import com.saveourtool.save.cvsscalculator.*
import com.saveourtool.common.cvsscalculator.*
import kotlinx.serialization.Serializable

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.saveourtool.save.cvsscalculator.v3
package com.saveourtool.common.cvsscalculator.v3

import com.saveourtool.save.cvsscalculator.CvssVectorAbstract
import com.saveourtool.save.cvsscalculator.CvssVersion
import com.saveourtool.save.cvsscalculator.findOrElseThrow
import com.saveourtool.save.cvsscalculator.v2.BaseMetricsV2Names
import com.saveourtool.common.cvsscalculator.CvssVectorAbstract
import com.saveourtool.common.cvsscalculator.CvssVersion
import com.saveourtool.common.cvsscalculator.findOrElseThrow
import com.saveourtool.common.cvsscalculator.v2.BaseMetricsV2Names

import kotlin.math.min
import kotlin.math.pow
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE")

package com.saveourtool.save.cvsscalculator.v3
package com.saveourtool.common.cvsscalculator.v3

import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"MagicNumber",
)

package com.saveourtool.save.cvsscalculator.v3
package com.saveourtool.common.cvsscalculator.v3

val av = mapOf(
AttackVectorType.NETWORK.value to 0.85f,
Expand Down
Loading
Loading