Skip to content

Commit

Permalink
feat: Repo提取到common-metadata TencentBlueKing#2571
Browse files Browse the repository at this point in the history
* feat: Repo提取到common-metadata TencentBlueKing#2571

* feat: Repo提取到common-metadata TencentBlueKing#2571

* feat: Repo提取到common-metadata TencentBlueKing#2571

* feat: Repo提取到common-metadata TencentBlueKing#2571
  • Loading branch information
yaoxuwan authored Sep 29, 2024
1 parent 2067622 commit 61f2460
Show file tree
Hide file tree
Showing 82 changed files with 1,590 additions and 655 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import com.tencent.bkrepo.common.artifact.cns.CnsConfiguration
import com.tencent.bkrepo.common.artifact.event.ArtifactEventConfiguration
import com.tencent.bkrepo.common.artifact.exception.ArtifactExceptionConfiguration
import com.tencent.bkrepo.common.artifact.health.ArtifactHealthConfiguration
import com.tencent.bkrepo.common.artifact.interceptor.ArtifactDownloadInterceptorConfiguration
import com.tencent.bkrepo.common.artifact.manager.ArtifactManagerConfiguration
import com.tencent.bkrepo.common.artifact.metrics.ArtifactMetricsConfiguration
import com.tencent.bkrepo.common.artifact.permission.ArtifactPermissionConfiguration
Expand Down Expand Up @@ -68,7 +67,6 @@ import org.springframework.context.annotation.PropertySource
ArtifactResolverConfiguration::class,
ArtifactViewModelConfiguration::class,
ArtifactHealthConfiguration::class,
ArtifactDownloadInterceptorConfiguration::class,
ArtifactClusterConfiguration::class,
CnsConfiguration::class,
ArtifactRouterControllerConfiguration::class,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.tencent.bkrepo.common.artifact.cluster

import com.tencent.bkrepo.common.artifact.interceptor.EdgeNodeUploadInterceptor
import com.tencent.bkrepo.common.service.cluster.properties.ClusterProperties
import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.context.annotation.Bean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tencent.bkrepo.common.artifact.interceptor
package com.tencent.bkrepo.common.artifact.cluster

import com.tencent.bkrepo.common.api.constant.HttpStatus
import com.tencent.bkrepo.common.api.pojo.ClusterArchitecture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import com.tencent.bkrepo.common.api.constant.StringPool
import com.tencent.bkrepo.common.artifact.api.ArtifactInfo
import com.tencent.bkrepo.common.artifact.constant.DownloadInterceptorType
import com.tencent.bkrepo.common.artifact.constant.REPO_KEY
import com.tencent.bkrepo.common.artifact.interceptor.DownloadInterceptor
import com.tencent.bkrepo.common.artifact.interceptor.DownloadInterceptorFactory
import com.tencent.bkrepo.common.metadata.interceptor.DownloadInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.DownloadInterceptorFactory
import com.tencent.bkrepo.common.security.util.SecurityUtils
import com.tencent.bkrepo.repository.pojo.node.NodeDetail
import com.tencent.bkrepo.repository.pojo.packages.PackageVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

package com.tencent.bkrepo.common.artifact.util

import com.tencent.bkrepo.common.artifact.interceptor.DownloadInterceptorFactory
import com.tencent.bkrepo.common.metadata.interceptor.DownloadInterceptorFactory
import com.tencent.bkrepo.common.artifact.metrics.TransferUserAgent
import com.tencent.bkrepo.common.security.util.SecurityUtils
import com.tencent.bkrepo.common.service.util.HttpContextHolder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ package com.tencent.bkrepo.interceptor
import com.tencent.bkrepo.common.artifact.constant.DownloadInterceptorType.PACKAGE_FORBID
import com.tencent.bkrepo.common.artifact.constant.FORBID_STATUS
import com.tencent.bkrepo.common.artifact.exception.ArtifactDownloadForbiddenException
import com.tencent.bkrepo.common.artifact.interceptor.DownloadInterceptorFactory
import com.tencent.bkrepo.common.artifact.interceptor.impl.FilenameInterceptor
import com.tencent.bkrepo.common.artifact.interceptor.impl.NodeMetadataInterceptor
import com.tencent.bkrepo.common.artifact.interceptor.impl.WebInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.DownloadInterceptorFactory
import com.tencent.bkrepo.common.metadata.interceptor.impl.FilenameInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.impl.NodeMetadataInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.impl.WebInterceptor
import com.tencent.bkrepo.repository.pojo.metadata.MetadataModel
import com.tencent.bkrepo.repository.pojo.node.NodeDetail
import com.tencent.bkrepo.repository.pojo.node.NodeInfo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies {
exclude(module = "service-servlet")
}
api(project(":common:common-service:service-base"))
api(project(":common:common-stream"))

compileOnly(project(":common:common-mongo-reactive"))
compileOnly(project(":common:common-mongo"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ interface RAuthClient {
@RequestBody request: CheckPermissionRequest
): Mono<Response<Boolean>>

@GetMapping("/permission/repo/list")
fun listPermissionRepo(
@ApiParam(value = "项目ID")
@RequestParam projectId: String,
@ApiParam(value = "用户ID")
@RequestParam userId: String,
@ApiParam(value = "应用ID")
@RequestParam appId: String?
): Mono<Response<List<String>>>

@GetMapping("/user/detail/{uid}")
fun detail(
@PathVariable uid: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* SOFTWARE.
*/

package com.tencent.bkrepo.repository.job.base
package com.tencent.bkrepo.common.metadata.config

/**
* 仓库后台任务配置
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* SOFTWARE.
*/

package com.tencent.bkrepo.repository.config
package com.tencent.bkrepo.common.metadata.config

import com.tencent.bkrepo.common.artifact.pojo.RepositoryType

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@
* SOFTWARE.
*/

package com.tencent.bkrepo.repository.config
package com.tencent.bkrepo.common.metadata.config

import com.tencent.bkrepo.repository.job.base.RepoJobProperties
import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.boot.context.properties.NestedConfigurationProperty
import org.springframework.context.annotation.Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ package com.tencent.bkrepo.common.metadata.dao.repo

import com.tencent.bkrepo.common.metadata.condition.ReactiveCondition
import com.tencent.bkrepo.common.metadata.model.TRepository
import com.tencent.bkrepo.common.metadata.util.RepoQueryHelper.buildSingleQuery
import com.tencent.bkrepo.common.metadata.util.RepositoryServiceHelper.Companion.buildSingleQuery
import com.tencent.bkrepo.common.mongo.reactive.dao.SimpleMongoReactiveDao
import org.springframework.context.annotation.Conditional
import org.springframework.data.mongodb.core.query.Query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ package com.tencent.bkrepo.common.metadata.dao.repo

import com.tencent.bkrepo.common.metadata.condition.SyncCondition
import com.tencent.bkrepo.common.metadata.model.TRepository
import com.tencent.bkrepo.common.metadata.util.RepoQueryHelper.buildSingleQuery
import com.tencent.bkrepo.common.metadata.util.RepositoryServiceHelper.Companion.buildSingleQuery
import com.tencent.bkrepo.common.mongo.dao.simple.SimpleMongoDao
import org.springframework.context.annotation.Conditional
import org.springframework.data.mongodb.core.query.Query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.common.artifact.interceptor
package com.tencent.bkrepo.common.metadata.interceptor

/**
* 组合下载拦截器
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.common.artifact.interceptor
package com.tencent.bkrepo.common.metadata.interceptor

import com.tencent.bkrepo.common.artifact.exception.ArtifactDownloadForbiddenException
import org.slf4j.LoggerFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.common.artifact.interceptor
package com.tencent.bkrepo.common.metadata.interceptor

import com.tencent.bkrepo.common.artifact.interceptor.config.DownloadInterceptorProperties
import com.tencent.bkrepo.common.metadata.interceptor.config.DownloadInterceptorProperties
import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
@EnableConfigurationProperties(DownloadInterceptorProperties::class)
class ArtifactDownloadInterceptorConfiguration {
class DownloadInterceptorConfiguration {

@Bean
fun downloadInterceptorFactory(properties: DownloadInterceptorProperties): DownloadInterceptorFactory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.common.artifact.interceptor
package com.tencent.bkrepo.common.metadata.interceptor

import com.tencent.bkrepo.common.api.constant.DOWNLOAD_SOURCE
import com.tencent.bkrepo.common.api.constant.HttpHeaders
import com.tencent.bkrepo.common.artifact.constant.DownloadInterceptorType
import com.tencent.bkrepo.common.artifact.constant.FORBID_STATUS
import com.tencent.bkrepo.common.artifact.interceptor.config.DownloadInterceptorProperties
import com.tencent.bkrepo.common.artifact.interceptor.impl.FilenameInterceptor
import com.tencent.bkrepo.common.artifact.interceptor.impl.IpSegmentInterceptor
import com.tencent.bkrepo.common.artifact.interceptor.impl.MetadataInterceptor
import com.tencent.bkrepo.common.artifact.interceptor.impl.MobileInterceptor
import com.tencent.bkrepo.common.artifact.interceptor.impl.NodeMetadataInterceptor
import com.tencent.bkrepo.common.artifact.interceptor.impl.OfficeNetworkInterceptor
import com.tencent.bkrepo.common.artifact.interceptor.impl.PackageMetadataInterceptor
import com.tencent.bkrepo.common.artifact.interceptor.impl.WebInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.config.DownloadInterceptorProperties
import com.tencent.bkrepo.common.metadata.interceptor.impl.FilenameInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.impl.IpSegmentInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.impl.MetadataInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.impl.MobileInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.impl.NodeMetadataInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.impl.OfficeNetworkInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.impl.PackageMetadataInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.impl.WebInterceptor
import com.tencent.bkrepo.common.service.util.HeaderUtils
import com.tencent.bkrepo.common.service.util.HttpContextHolder
import com.tencent.bkrepo.repository.pojo.node.NodeDetail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.common.artifact.interceptor.config
package com.tencent.bkrepo.common.metadata.interceptor.config

import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.boot.context.properties.NestedConfigurationProperty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.common.artifact.interceptor.config
package com.tencent.bkrepo.common.metadata.interceptor.config

/**
* 办公网下载拦截配置项
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.common.artifact.interceptor.impl
package com.tencent.bkrepo.common.metadata.interceptor.impl

import com.tencent.bkrepo.common.artifact.interceptor.DownloadInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.DownloadInterceptor
import com.tencent.bkrepo.repository.pojo.node.NodeDetail
import org.springframework.util.AntPathMatcher

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.common.artifact.interceptor.impl
package com.tencent.bkrepo.common.metadata.interceptor.impl

import com.tencent.bkrepo.common.api.exception.ErrorCodeException
import com.tencent.bkrepo.common.artifact.constant.FORBID_STATUS
import com.tencent.bkrepo.common.artifact.interceptor.DownloadInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.DownloadInterceptor
import com.tencent.bkrepo.common.artifact.message.ArtifactMessageCode

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.common.artifact.interceptor.impl
package com.tencent.bkrepo.common.metadata.interceptor.impl

import com.tencent.bkrepo.common.api.util.IpUtils
import com.tencent.bkrepo.common.artifact.interceptor.DownloadInterceptor
import com.tencent.bkrepo.common.artifact.interceptor.config.DownloadInterceptorProperties
import com.tencent.bkrepo.common.metadata.interceptor.DownloadInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.config.DownloadInterceptorProperties
import com.tencent.bkrepo.common.security.util.SecurityUtils
import com.tencent.bkrepo.common.service.util.HttpContextHolder
import com.tencent.bkrepo.repository.pojo.node.NodeDetail
Expand All @@ -43,7 +43,7 @@ import com.tencent.bkrepo.repository.pojo.node.NodeDetail
class IpSegmentInterceptor(
rules: Map<String, Any>,
private val properties: DownloadInterceptorProperties
): DownloadInterceptor<Map<String,Any>, NodeDetail>(
): DownloadInterceptor<Map<String, Any>, NodeDetail>(
rules
) {
override fun parseRule(): Map<String, Any> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.common.artifact.interceptor.impl
package com.tencent.bkrepo.common.metadata.interceptor.impl

import com.tencent.bkrepo.common.api.constant.StringPool
import com.tencent.bkrepo.common.artifact.interceptor.DownloadInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.DownloadInterceptor

/**
* 元数据下载拦截器
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.common.artifact.interceptor.impl
package com.tencent.bkrepo.common.metadata.interceptor.impl

import com.tencent.bkrepo.common.artifact.interceptor.CompositeDownloadInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.CompositeDownloadInterceptor
import com.tencent.bkrepo.repository.pojo.node.NodeDetail

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.common.artifact.interceptor.impl
package com.tencent.bkrepo.common.metadata.interceptor.impl

import com.tencent.bkrepo.repository.pojo.node.NodeDetail

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.common.artifact.interceptor.impl
package com.tencent.bkrepo.common.metadata.interceptor.impl

import com.tencent.bkrepo.common.api.util.IpUtils
import com.tencent.bkrepo.common.artifact.interceptor.DownloadInterceptor
import com.tencent.bkrepo.common.artifact.interceptor.config.DownloadInterceptorProperties
import com.tencent.bkrepo.common.metadata.interceptor.DownloadInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.config.DownloadInterceptorProperties
import com.tencent.bkrepo.common.service.util.HttpContextHolder

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.common.artifact.interceptor.impl
package com.tencent.bkrepo.common.metadata.interceptor.impl

import com.tencent.bkrepo.repository.pojo.packages.PackageVersion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.bkrepo.common.artifact.interceptor.impl
package com.tencent.bkrepo.common.metadata.interceptor.impl

import com.tencent.bkrepo.common.artifact.interceptor.CompositeDownloadInterceptor
import com.tencent.bkrepo.common.metadata.interceptor.CompositeDownloadInterceptor
import com.tencent.bkrepo.repository.pojo.node.NodeDetail

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* SOFTWARE.
*/

package com.tencent.bkrepo.repository.service.repo
package com.tencent.bkrepo.common.metadata.service.repo

import com.tencent.bkrepo.repository.pojo.repo.RepoQuotaInfo

Expand Down
Loading

0 comments on commit 61f2460

Please sign in to comment.