From 799da8c325a223f7a7d5c5ba59163d5d8f1cf799 Mon Sep 17 00:00:00 2001 From: greysonfang Date: Thu, 19 Dec 2024 16:31:18 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E7=94=A8=E6=88=B7=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E8=A7=86=E8=A7=92=20=E6=9D=83=E9=99=90=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E4=BC=98=E5=8C=96=20#11138?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rbac/config/RbacAuthConfiguration.kt | 54 +++++++++---------- .../rbac/config/RbacServiceConfiguration.kt | 4 +- ...acCacheService.kt => RbacCommonService.kt} | 4 +- .../service/RbacPermissionApplyService.kt | 16 +++--- ...bacPermissionHandoverApplicationService.kt | 8 +-- .../RbacPermissionManageFacadeServiceImpl.kt | 14 ++--- .../service/RbacPermissionProjectService.kt | 6 +-- ...ermissionResourceGroupPermissionService.kt | 14 ++--- .../RbacPermissionResourceGroupSyncService.kt | 4 +- .../RbacPermissionResourceValidateService.kt | 6 +-- .../rbac/service/RbacPermissionService.kt | 10 ++-- .../service/migrate/AbMigratePolicyService.kt | 6 +-- .../service/migrate/MigrateResourceService.kt | 6 +-- .../service/migrate/MigrateResultService.kt | 6 +-- .../service/migrate/MigrateV0PolicyService.kt | 6 +-- .../service/migrate/MigrateV3PolicyService.kt | 6 +-- .../migrate/RbacPermissionMigrateService.kt | 4 +- .../migrate/AbMigratePolicyServiceTest.kt | 4 +- .../migrate/MigrateV0PolicyServiceTest.kt | 2 +- .../migrate/MigrateV3PolicyServiceTest.kt | 2 +- .../process/pojo/app/StartBuildContext.kt | 2 +- 21 files changed, 90 insertions(+), 94 deletions(-) rename src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/{RbacCacheService.kt => RbacCommonService.kt} (98%) diff --git a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/config/RbacAuthConfiguration.kt b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/config/RbacAuthConfiguration.kt index e06af9beddb0..8f0b51098939 100644 --- a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/config/RbacAuthConfiguration.kt +++ b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/config/RbacAuthConfiguration.kt @@ -60,7 +60,7 @@ import com.tencent.devops.auth.provider.rbac.service.AuthResourceService import com.tencent.devops.auth.provider.rbac.service.ItsmService import com.tencent.devops.auth.provider.rbac.service.PermissionGradeManagerService import com.tencent.devops.auth.provider.rbac.service.PermissionSubsetManagerService -import com.tencent.devops.auth.provider.rbac.service.RbacCacheService +import com.tencent.devops.auth.provider.rbac.service.RbacCommonService import com.tencent.devops.auth.provider.rbac.service.RbacPermissionApplyService import com.tencent.devops.auth.provider.rbac.service.RbacPermissionAuthMonitorSpaceService import com.tencent.devops.auth.provider.rbac.service.RbacPermissionAuthorizationScopesService @@ -216,7 +216,7 @@ class RbacAuthConfiguration { syncIamGroupMemberService: PermissionResourceGroupSyncService, authAuthorizationDao: AuthAuthorizationDao, permissionHandoverApplicationService: PermissionHandoverApplicationService, - rbacCacheService: RbacCacheService, + rbacCommonService: RbacCommonService, redisOperation: RedisOperation, authorizationDao: AuthAuthorizationDao, authResourceService: AuthResourceService, @@ -235,7 +235,7 @@ class RbacAuthConfiguration { syncIamGroupMemberService = syncIamGroupMemberService, authAuthorizationDao = authAuthorizationDao, permissionHandoverApplicationService = permissionHandoverApplicationService, - rbacCacheService = rbacCacheService, + rbacCommonService = rbacCommonService, redisOperation = redisOperation, authorizationDao = authorizationDao, authResourceService = authResourceService, @@ -246,7 +246,7 @@ class RbacAuthConfiguration { @Bean fun permissionResourceGroupPermissionService( v2ManagerService: V2ManagerService, - rbacCacheService: RbacCacheService, + rbacCommonService: RbacCommonService, monitorSpaceService: AuthMonitorSpaceService, authResourceGroupDao: AuthResourceGroupDao, dslContext: DSLContext, @@ -260,7 +260,7 @@ class RbacAuthConfiguration { objectMapper: ObjectMapper ) = RbacPermissionResourceGroupPermissionService( v2ManagerService = v2ManagerService, - rbacCacheService = rbacCacheService, + rbacCommonService = rbacCommonService, monitorSpaceService = monitorSpaceService, authResourceGroupDao = authResourceGroupDao, dslContext = dslContext, @@ -282,7 +282,7 @@ class RbacAuthConfiguration { authResourceGroupMemberDao: AuthResourceGroupMemberDao, dslContext: DSLContext, deptService: DeptService, - rbacCacheService: RbacCacheService + rbacCommonService: RbacCommonService ) = RbacPermissionResourceMemberService( authResourceService = authResourceService, iamV2ManagerService = iamV2ManagerService, @@ -319,7 +319,7 @@ class RbacAuthConfiguration { iamV2PolicyService: PolicyService, authResourceCodeConverter: AuthResourceCodeConverter, superManagerService: SuperManagerService, - rbacCacheService: RbacCacheService, + rbacCommonService: RbacCommonService, client: Client, authProjectUserMetricsService: AuthProjectUserMetricsService ) = RbacPermissionService( @@ -329,7 +329,7 @@ class RbacAuthConfiguration { policyService = iamV2PolicyService, authResourceCodeConverter = authResourceCodeConverter, superManagerService = superManagerService, - rbacCacheService = rbacCacheService, + rbacCommonService = rbacCommonService, client = client, authProjectUserMetricsService = authProjectUserMetricsService ) @@ -341,7 +341,7 @@ class RbacAuthConfiguration { authResourceService: AuthResourceService, authResourceGroupDao: AuthResourceGroupDao, dslContext: DSLContext, - rbacCacheService: RbacCacheService, + rbacCommonService: RbacCommonService, resourceGroupMemberService: RbacPermissionResourceMemberService, client: Client, resourceMemberService: PermissionResourceMemberService, @@ -351,7 +351,7 @@ class RbacAuthConfiguration { authResourceService = authResourceService, authResourceGroupDao = authResourceGroupDao, dslContext = dslContext, - rbacCacheService = rbacCacheService, + rbacCommonService = rbacCommonService, resourceGroupMemberService = resourceGroupMemberService, client = client, resourceMemberService = resourceMemberService, @@ -376,7 +376,7 @@ class RbacAuthConfiguration { authResourceService: AuthResourceService, authResourceGroupConfigDao: AuthResourceGroupConfigDao, authResourceGroupDao: AuthResourceGroupDao, - rbacCacheService: RbacCacheService, + rbacCommonService: RbacCommonService, config: CommonConfig, client: Client, authResourceCodeConverter: AuthResourceCodeConverter, @@ -390,7 +390,7 @@ class RbacAuthConfiguration { authResourceService = authResourceService, authResourceGroupConfigDao = authResourceGroupConfigDao, authResourceGroupDao = authResourceGroupDao, - rbacCacheService = rbacCacheService, + rbacCommonService = rbacCommonService, config = config, client = client, authResourceCodeConverter = authResourceCodeConverter, @@ -404,13 +404,13 @@ class RbacAuthConfiguration { @Primary fun rbacPermissionResourceValidateService( permissionService: PermissionService, - rbacCacheService: RbacCacheService, + rbacCommonService: RbacCommonService, client: Client, authAuthorizationDao: AuthAuthorizationDao, dslContext: DSLContext ) = RbacPermissionResourceValidateService( permissionService = permissionService, - rbacCacheService = rbacCacheService, + rbacCommonService = rbacCommonService, client = client, authAuthorizationDao = authAuthorizationDao, dslContext = dslContext @@ -426,7 +426,7 @@ class RbacAuthConfiguration { @Bean fun migrateResourceService( resourceService: ResourceService, - rbacCacheService: RbacCacheService, + rbacCommonService: RbacCommonService, rbacPermissionResourceService: RbacPermissionResourceService, migrateCreatorFixService: MigrateCreatorFixService, authResourceService: AuthResourceService, @@ -441,7 +441,7 @@ class RbacAuthConfiguration { authResourceGroupDao: AuthResourceGroupDao ) = MigrateResourceService( resourceService = resourceService, - rbacCacheService = rbacCacheService, + rbacCommonService = rbacCommonService, rbacPermissionResourceService = rbacPermissionResourceService, migrateCreatorFixService = migrateCreatorFixService, authResourceService = authResourceService, @@ -475,7 +475,7 @@ class RbacAuthConfiguration { @Bean fun migrateResultService( permissionService: PermissionService, - rbacCacheService: RbacCacheService, + rbacCommonService: RbacCommonService, migrateResourceCodeConverter: MigrateResourceCodeConverter, authVerifyRecordService: AuthVerifyRecordService, migrateResourceService: MigrateResourceService, @@ -487,7 +487,7 @@ class RbacAuthConfiguration { redisOperation: RedisOperation ) = MigrateResultService( permissionService = permissionService, - rbacCacheService = rbacCacheService, + rbacCommonService = rbacCommonService, migrateResourceCodeConverter = migrateResourceCodeConverter, authVerifyRecordService = authVerifyRecordService, migrateResourceService = migrateResourceService, @@ -510,7 +510,7 @@ class RbacAuthConfiguration { migrateIamApiService: MigrateIamApiService, authResourceCodeConverter: AuthResourceCodeConverter, permissionService: PermissionService, - rbacCacheService: RbacCacheService, + rbacCommonService: RbacCommonService, authMigrationDao: AuthMigrationDao, deptService: DeptService, permissionResourceGroupPermissionService: PermissionResourceGroupPermissionService, @@ -525,7 +525,7 @@ class RbacAuthConfiguration { migrateResourceCodeConverter = migrateResourceCodeConverter, authResourceCodeConverter = authResourceCodeConverter, permissionService = permissionService, - rbacCacheService = rbacCacheService, + rbacCommonService = rbacCommonService, authMigrationDao = authMigrationDao, deptService = deptService, permissionResourceGroupPermissionService = permissionResourceGroupPermissionService, @@ -543,7 +543,7 @@ class RbacAuthConfiguration { migrateIamApiService: MigrateIamApiService, authResourceCodeConverter: AuthResourceCodeConverter, permissionService: PermissionService, - rbacCacheService: RbacCacheService, + rbacCommonService: RbacCommonService, authMigrationDao: AuthMigrationDao, deptService: DeptService, permissionResourceGroupPermissionService: PermissionResourceGroupPermissionService, @@ -558,7 +558,7 @@ class RbacAuthConfiguration { migrateResourceCodeConverter = migrateResourceCodeConverter, authResourceCodeConverter = authResourceCodeConverter, permissionService = permissionService, - rbacCacheService = rbacCacheService, + rbacCommonService = rbacCommonService, authMigrationDao = authMigrationDao, deptService = deptService, permissionResourceGroupPermissionService = permissionResourceGroupPermissionService, @@ -581,7 +581,6 @@ class RbacAuthConfiguration { dslContext: DSLContext, authMigrationDao: AuthMigrationDao, authMonitorSpaceDao: AuthMonitorSpaceDao, - cacheService: RbacCacheService, permissionResourceMemberService: RbacPermissionResourceMemberService, migrateResourceAuthorizationService: MigrateResourceAuthorizationService, migrateResourceGroupService: MigrateResourceGroupService @@ -599,7 +598,6 @@ class RbacAuthConfiguration { dslContext = dslContext, authMigrationDao = authMigrationDao, authMonitorSpaceDao = authMonitorSpaceDao, - cacheService = cacheService, permissionResourceMemberService = permissionResourceMemberService, migrateResourceAuthorizationService = migrateResourceAuthorizationService, migrateResourceGroupService = migrateResourceGroupService @@ -631,7 +629,7 @@ class RbacAuthConfiguration { handoverDetailDao: AuthHandoverDetailDao, authorizationDao: AuthAuthorizationDao, authResourceGroupDao: AuthResourceGroupDao, - rbacCacheService: RbacCacheService, + rbacCommonService: RbacCommonService, redisOperation: RedisOperation, client: Client, config: CommonConfig, @@ -642,7 +640,7 @@ class RbacAuthConfiguration { handoverDetailDao = handoverDetailDao, authorizationDao = authorizationDao, authResourceGroupDao = authResourceGroupDao, - rbacCacheService = rbacCacheService, + rbacCommonService = rbacCommonService, redisOperation = redisOperation, client = client, config = config, @@ -685,7 +683,7 @@ class RbacAuthConfiguration { authResourceGroupDao: AuthResourceGroupDao, iamV2ManagerService: V2ManagerService, authResourceGroupMemberDao: AuthResourceGroupMemberDao, - rbacCacheService: RbacCacheService, + rbacCommonService: RbacCommonService, redisOperation: RedisOperation, authResourceSyncDao: AuthResourceSyncDao, authResourceGroupApplyDao: AuthResourceGroupApplyDao, @@ -698,7 +696,7 @@ class RbacAuthConfiguration { authResourceGroupDao = authResourceGroupDao, iamV2ManagerService = iamV2ManagerService, authResourceGroupMemberDao = authResourceGroupMemberDao, - rbacCacheService = rbacCacheService, + rbacCommonService = rbacCommonService, redisOperation = redisOperation, authResourceSyncDao = authResourceSyncDao, authResourceGroupApplyDao = authResourceGroupApplyDao, diff --git a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/config/RbacServiceConfiguration.kt b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/config/RbacServiceConfiguration.kt index 47d4f23c856b..647ab1149e8a 100644 --- a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/config/RbacServiceConfiguration.kt +++ b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/config/RbacServiceConfiguration.kt @@ -45,7 +45,7 @@ import com.tencent.devops.auth.provider.rbac.service.AuthResourceService import com.tencent.devops.auth.provider.rbac.service.ItsmService import com.tencent.devops.auth.provider.rbac.service.PermissionGradeManagerService import com.tencent.devops.auth.provider.rbac.service.PermissionSubsetManagerService -import com.tencent.devops.auth.provider.rbac.service.RbacCacheService +import com.tencent.devops.auth.provider.rbac.service.RbacCommonService import com.tencent.devops.auth.service.AuthAuthorizationScopesService import com.tencent.devops.auth.service.AuthProjectUserMetricsService import com.tencent.devops.auth.service.BkHttpRequestService @@ -72,7 +72,7 @@ class RbacServiceConfiguration { iamConfiguration: IamConfiguration, authResourceGroupConfigDao: AuthResourceGroupConfigDao, authProjectUserMetricsService: AuthProjectUserMetricsService - ) = RbacCacheService( + ) = RbacCommonService( dslContext = dslContext, authResourceTypeDao = authResourceTypeDao, authActionDao = authActionDao, diff --git a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacCacheService.kt b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacCommonService.kt similarity index 98% rename from src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacCacheService.kt rename to src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacCommonService.kt index d0e9b02ec98c..e3126357fbcd 100644 --- a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacCacheService.kt +++ b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacCommonService.kt @@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory import java.util.concurrent.TimeUnit @Suppress("MagicNumber", "LongParameterList") -class RbacCacheService constructor( +class RbacCommonService( private val dslContext: DSLContext, private val authResourceTypeDao: AuthResourceTypeDao, private val authActionDao: AuthActionDao, @@ -42,7 +42,7 @@ class RbacCacheService constructor( ) { companion object { - private val logger = LoggerFactory.getLogger(RbacCacheService::class.java) + private val logger = LoggerFactory.getLogger(RbacCommonService::class.java) } /*获取资源类型下的动作*/ diff --git a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionApplyService.kt b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionApplyService.kt index 63e94d7445bb..7be37a4a987a 100644 --- a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionApplyService.kt +++ b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionApplyService.kt @@ -60,7 +60,7 @@ class RbacPermissionApplyService @Autowired constructor( val authResourceService: AuthResourceService, val authResourceGroupConfigDao: AuthResourceGroupConfigDao, val authResourceGroupDao: AuthResourceGroupDao, - val rbacCacheService: RbacCacheService, + val rbacCommonService: RbacCommonService, val config: CommonConfig, val client: Client, val authResourceCodeConverter: AuthResourceCodeConverter, @@ -80,11 +80,11 @@ class RbacPermissionApplyService @Autowired constructor( private val codeccTaskDetailRedirectUri = "${config.devopsHostGateway}/console/codecc/%s/task/%s/detail?buildNum=latest" private val groupPermissionDetailRedirectUri = "${config.devopsHostGateway}/permission/group/detail?group_id=%s&x-devops-project-id=%s" override fun listResourceTypes(userId: String): List { - return rbacCacheService.listResourceTypes() + return rbacCommonService.listResourceTypes() } override fun listActions(userId: String, resourceType: String): List { - return rbacCacheService.listResourceType2Action(resourceType) + return rbacCommonService.listResourceType2Action(resourceType) } override fun listGroupsForApply( @@ -263,7 +263,7 @@ class RbacPermissionApplyService @Autowired constructor( return managerRoleGroupInfoList.map { gInfo -> val dbGroupRecord = dbGroupRecords.find { record -> record.relationId == gInfo.id.toString() } val resourceType = dbGroupRecord?.resourceType ?: AuthResourceType.PROJECT.value - val resourceTypeName = rbacCacheService.getResourceTypeInfo(resourceType).name + val resourceTypeName = rbacCommonService.getResourceTypeInfo(resourceType).name val resourceName = dbGroupRecord?.resourceName ?: projectName val resourceCode = dbGroupRecord?.resourceCode ?: projectId val memberJoinedResult = verifyMemberJoinedResult[gInfo.id.toInt()] @@ -326,7 +326,7 @@ class RbacPermissionApplyService @Autowired constructor( itsmService.buildGroupApplyItsmValue( ApplyJoinGroupFormDataInfo( projectName = projectInfo.projectName, - resourceTypeName = rbacCacheService.getResourceTypeInfo(resourceGroupInfo.resourceType).name, + resourceTypeName = rbacCommonService.getResourceTypeInfo(resourceGroupInfo.resourceType).name, resourceName = resourceGroupInfo.resourceName, groupName = resourceGroupInfo.groupName, validityPeriod = generateValidityPeriod(applyJoinGroupInfo.expiredAt.toLong()), @@ -487,11 +487,11 @@ class RbacPermissionApplyService @Autowired constructor( ) val groupInfoList: MutableList = mutableListOf() // 判断action是否为空 - val actionInfo = if (action != null) rbacCacheService.getActionInfo(action) else null + val actionInfo = if (action != null) rbacCommonService.getActionInfo(action) else null val iamRelatedResourceType = actionInfo?.relatedResourceType ?: resourceType val resourceTypeName = I18nUtil.getCodeLanMessage( messageCode = resourceType + AuthI18nConstants.RESOURCE_TYPE_NAME_SUFFIX, - defaultMessage = rbacCacheService.getResourceTypeInfo(resourceType).name + defaultMessage = rbacCommonService.getResourceTypeInfo(resourceType).name ) val projectInfo = authResourceService.get( @@ -578,7 +578,7 @@ class RbacPermissionApplyService @Autowired constructor( ) } else { if (isEnablePermission) { - rbacCacheService.getGroupConfigAction(finalResourceType).forEach { + rbacCommonService.getGroupConfigAction(finalResourceType).forEach { if (it.actions.contains(action)) { buildRedirectGroupInfo( groupInfoList = groupInfoList, diff --git a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionHandoverApplicationService.kt b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionHandoverApplicationService.kt index 3cf2ed7e819f..ac33d5892ab1 100644 --- a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionHandoverApplicationService.kt +++ b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionHandoverApplicationService.kt @@ -45,7 +45,7 @@ class RbacPermissionHandoverApplicationService( private val handoverDetailDao: AuthHandoverDetailDao, private val authorizationDao: AuthAuthorizationDao, private val authResourceGroupDao: AuthResourceGroupDao, - private val rbacCacheService: RbacCacheService, + private val rbacCommonService: RbacCommonService, private val redisOperation: RedisOperation, private val client: Client, private val config: CommonConfig, @@ -82,7 +82,7 @@ class RbacPermissionHandoverApplicationService( val handoverOverviewTableBuilder = StringBuilder() resourceType2CountOfHandover.forEach { handoverOverviewTableBuilder.append( - java.lang.String.format( + String.format( HANDOVER_APPLICATION_TABLE_OF_EMAIL, it.type.alias, it.resourceTypeName, it.count ) ) @@ -295,7 +295,7 @@ class RbacPermissionHandoverApplicationService( val result = mutableListOf() if (resourceType2CountWithGroup.isNotEmpty()) { result.addAll( - rbacCacheService.convertResourceType2Count( + rbacCommonService.convertResourceType2Count( resourceType2Count = resourceType2CountWithGroup, type = HandoverType.GROUP ) @@ -303,7 +303,7 @@ class RbacPermissionHandoverApplicationService( } if (resourceType2CountWithAuthorization.isNotEmpty()) { result.addAll( - rbacCacheService.convertResourceType2Count( + rbacCommonService.convertResourceType2Count( resourceType2Count = resourceType2CountWithAuthorization, type = HandoverType.AUTHORIZATION ) diff --git a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionManageFacadeServiceImpl.kt b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionManageFacadeServiceImpl.kt index 0aeb9036d918..c94142d45788 100644 --- a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionManageFacadeServiceImpl.kt +++ b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionManageFacadeServiceImpl.kt @@ -102,7 +102,7 @@ class RbacPermissionManageFacadeServiceImpl( private val syncIamGroupMemberService: PermissionResourceGroupSyncService, private val permissionAuthorizationService: PermissionAuthorizationService, private val permissionHandoverApplicationService: PermissionHandoverApplicationService, - private val rbacCacheService: RbacCacheService, + private val rbacCommonService: RbacCommonService, private val redisOperation: RedisOperation, private val authorizationDao: AuthAuthorizationDao, private val authResourceService: AuthResourceService, @@ -376,7 +376,7 @@ class RbacPermissionManageFacadeServiceImpl( maxExpiredAt = maxExpiredAt?.let { DateTimeUtil.convertTimestampToLocalDateTime(it / 1000) }, memberDeptInfos = memberDeptInfos ) - return rbacCacheService.convertResourceType2Count(memberGroupCountMap) + return rbacCommonService.convertResourceType2Count(memberGroupCountMap) } private fun getMemberTemplateIdsAndDeptInfos( @@ -1947,7 +1947,7 @@ class RbacPermissionManageFacadeServiceImpl( ) if (resourceType2CountOfGroup.isNotEmpty()) { result.addAll( - rbacCacheService.convertResourceType2Count( + rbacCommonService.convertResourceType2Count( resourceType2Count = resourceType2CountOfGroup, type = HandoverType.GROUP ) @@ -1956,7 +1956,7 @@ class RbacPermissionManageFacadeServiceImpl( } if (invalidPipelines.isNotEmpty()) { result.addAll( - rbacCacheService.convertResourceType2Count( + rbacCommonService.convertResourceType2Count( resourceType2Count = mapOf(ResourceTypeId.PIPELINE to invalidPipelines.size.toLong()), type = HandoverType.AUTHORIZATION ) @@ -1964,7 +1964,7 @@ class RbacPermissionManageFacadeServiceImpl( } if (invalidRepertoryIds.isNotEmpty()) { result.addAll( - rbacCacheService.convertResourceType2Count( + rbacCommonService.convertResourceType2Count( resourceType2Count = mapOf(ResourceTypeId.REPERTORY to invalidRepertoryIds.size.toLong()), type = HandoverType.AUTHORIZATION ) @@ -1972,7 +1972,7 @@ class RbacPermissionManageFacadeServiceImpl( } if (invalidEnvNodeIds.isNotEmpty()) { result.addAll( - rbacCacheService.convertResourceType2Count( + rbacCommonService.convertResourceType2Count( resourceType2Count = mapOf(ResourceTypeId.ENV_NODE to invalidEnvNodeIds.size.toLong()), type = HandoverType.AUTHORIZATION ) @@ -2059,7 +2059,7 @@ class RbacPermissionManageFacadeServiceImpl( userId = userId, iamTemplateIds = iamTemplateIds, memberDeptInfos = memberDeptInfos - ) || rbacCacheService.validateUserProjectPermission( + ) || rbacCommonService.validateUserProjectPermission( userId = userId, projectCode = projectCode, permission = AuthPermission.VISIT diff --git a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionProjectService.kt b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionProjectService.kt index ea9d84533537..bd382b7677c4 100644 --- a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionProjectService.kt +++ b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionProjectService.kt @@ -54,7 +54,7 @@ class RbacPermissionProjectService( private val authResourceService: AuthResourceService, private val authResourceGroupDao: AuthResourceGroupDao, private val dslContext: DSLContext, - private val rbacCacheService: RbacCacheService, + private val rbacCommonService: RbacCommonService, private val resourceGroupMemberService: RbacPermissionResourceMemberService, private val client: Client, private val resourceMemberService: PermissionResourceMemberService, @@ -139,7 +139,7 @@ class RbacPermissionProjectService( return managerPermission } - return rbacCacheService.validateUserProjectPermission( + return rbacCommonService.validateUserProjectPermission( userId = userId, projectCode = projectCode, permission = AuthPermission.VISIT @@ -176,7 +176,7 @@ class RbacPermissionProjectService( } override fun checkProjectManager(userId: String, projectCode: String): Boolean { - return rbacCacheService.checkProjectManager(userId, projectCode) + return rbacCommonService.checkProjectManager(userId, projectCode) } override fun createProjectUser(userId: String, projectCode: String, roleCode: String): Boolean { diff --git a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionResourceGroupPermissionService.kt b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionResourceGroupPermissionService.kt index 72ea798a9c0b..2d584b29ad48 100644 --- a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionResourceGroupPermissionService.kt +++ b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionResourceGroupPermissionService.kt @@ -71,7 +71,7 @@ import java.util.concurrent.Executors @Suppress("LongParameterList") class RbacPermissionResourceGroupPermissionService( private val v2ManagerService: V2ManagerService, - private val rbacCacheService: RbacCacheService, + private val rbacCommonService: RbacCommonService, private val monitorSpaceService: AuthMonitorSpaceService, private val authResourceGroupDao: AuthResourceGroupDao, private val dslContext: DSLContext, @@ -251,7 +251,7 @@ class RbacPermissionResourceGroupPermissionService( action: String? ): List { val resourceType = if (action != null) { - rbacCacheService.getActionInfo(action).relatedResourceType + rbacCommonService.getActionInfo(action).relatedResourceType } else { relatedResourceType } @@ -280,7 +280,7 @@ class RbacPermissionResourceGroupPermissionService( ): Boolean { if (filterIamGroupIds.isEmpty()) return false - val resourceType = rbacCacheService.getActionInfo(action).relatedResourceType + val resourceType = rbacCommonService.getActionInfo(action).relatedResourceType val pipelineGroupIds = listPipelineGroupIds( projectCode = projectCode, resourceType = resourceType, @@ -304,7 +304,7 @@ class RbacPermissionResourceGroupPermissionService( ): Boolean { if (filterIamGroupIds.isEmpty()) return false - val actionRelatedResourceType = rbacCacheService.getActionInfo(action).relatedResourceType + val actionRelatedResourceType = rbacCommonService.getActionInfo(action).relatedResourceType return resourceGroupPermissionDao.isGroupsHasProjectLevelPermission( dslContext = dslContext, projectCode = projectCode, @@ -322,7 +322,7 @@ class RbacPermissionResourceGroupPermissionService( ): Map> { if (filterIamGroupIds.isEmpty()) return emptyMap() - val resourceType = rbacCacheService.getActionInfo(action).relatedResourceType + val resourceType = rbacCommonService.getActionInfo(action).relatedResourceType return resourceGroupPermissionDao.listGroupResourcesWithPermission( dslContext = dslContext, projectCode = projectCode, @@ -396,7 +396,7 @@ class RbacPermissionResourceGroupPermissionService( val (actionName, actionRelatedResourceType) = if (iamSystemId == monitorSystemId) { Pair(monitorSpaceService.getMonitorActionName(action = actionId), monitorSystemId) } else { - val actionInfo = rbacCacheService.getActionInfo(action = actionId) + val actionInfo = rbacCommonService.getActionInfo(action = actionId) Pair(actionInfo.actionName, actionInfo.relatedResourceType) } GroupPermissionDetailVo( @@ -411,7 +411,7 @@ class RbacPermissionResourceGroupPermissionService( private fun buildRelatedResourceTypesName(iamSystemId: String, instancesDTO: InstancesDTO) { instancesDTO.let { val resourceTypeName = if (iamSystemId == systemId) { - rbacCacheService.getResourceTypeInfo(it.type).name + rbacCommonService.getResourceTypeInfo(it.type).name } else { I18nUtil.getCodeLanMessage(AuthI18nConstants.BK_MONITOR_SPACE) } diff --git a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionResourceGroupSyncService.kt b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionResourceGroupSyncService.kt index 13b9f4f427ed..dd986dbebbda 100644 --- a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionResourceGroupSyncService.kt +++ b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionResourceGroupSyncService.kt @@ -75,7 +75,7 @@ class RbacPermissionResourceGroupSyncService @Autowired constructor( private val authResourceGroupDao: AuthResourceGroupDao, private val iamV2ManagerService: V2ManagerService, private val authResourceGroupMemberDao: AuthResourceGroupMemberDao, - private val rbacCacheService: RbacCacheService, + private val rbacCommonService: RbacCommonService, private val redisOperation: RedisOperation, private val authResourceSyncDao: AuthResourceSyncDao, private val authResourceGroupApplyDao: AuthResourceGroupApplyDao, @@ -506,7 +506,7 @@ class RbacPermissionResourceGroupSyncService @Autowired constructor( val startEpoch = System.currentTimeMillis() logger.info("start to sync resource group member:$projectCode") try { - val resourceTypes = rbacCacheService.listResourceTypes().map { it.resourceType } + val resourceTypes = rbacCommonService.listResourceTypes().map { it.resourceType } val traceId = MDC.get(TraceTag.BIZID) val resourceTypeFuture = resourceTypes.map { resourceType -> CompletableFuture.supplyAsync( diff --git a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionResourceValidateService.kt b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionResourceValidateService.kt index 4e3d651924eb..709b1320b4a5 100644 --- a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionResourceValidateService.kt +++ b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionResourceValidateService.kt @@ -53,7 +53,7 @@ import javax.ws.rs.NotFoundException class RbacPermissionResourceValidateService( private val permissionService: PermissionService, - private val rbacCacheService: RbacCacheService, + private val rbacCommonService: RbacCommonService, private val client: Client, private val authAuthorizationDao: AuthAuthorizationDao, private val dslContext: DSLContext @@ -75,7 +75,7 @@ class RbacPermissionResourceValidateService( val resourceActionList = mutableSetOf() permissionBatchValidateDTO.actionList.forEach { action -> - val actionInfo = rbacCacheService.getActionInfo(action) + val actionInfo = rbacCommonService.getActionInfo(action) val iamRelatedResourceType = actionInfo.relatedResourceType if (iamRelatedResourceType == AuthResourceType.PROJECT.value) { projectActionList.add(action) @@ -123,7 +123,7 @@ class RbacPermissionResourceValidateService( resourceCode: String ): Boolean { checkProjectApprovalStatus(resourceType, resourceCode) - val checkProjectManage = rbacCacheService.checkProjectManager( + val checkProjectManage = rbacCommonService.checkProjectManager( userId = userId, projectCode = projectId ) diff --git a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionService.kt b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionService.kt index 457f56925f42..3523cbf55445 100644 --- a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionService.kt +++ b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/RbacPermissionService.kt @@ -63,7 +63,7 @@ class RbacPermissionService( private val policyService: PolicyService, private val authResourceCodeConverter: AuthResourceCodeConverter, private val superManagerService: SuperManagerService, - private val rbacCacheService: RbacCacheService, + private val rbacCommonService: RbacCommonService, private val client: Client, private val authProjectUserMetricsService: AuthProjectUserMetricsService ) : PermissionService { @@ -94,7 +94,7 @@ class RbacPermissionService( projectCode: String, resourceType: String? ): Boolean { - val actionInfo = rbacCacheService.getActionInfo(action) + val actionInfo = rbacCommonService.getActionInfo(action) // 如果action关联的资源是项目,则直接查询项目的权限 return if (actionInfo.relatedResourceType == AuthResourceType.PROJECT.value) { validateUserResourcePermissionByRelation( @@ -265,7 +265,7 @@ class RbacPermissionService( ) val startEpoch = System.currentTimeMillis() try { - if (rbacCacheService.checkProjectManager(userId = userId, projectCode = projectCode)) { + if (rbacCommonService.checkProjectManager(userId = userId, projectCode = projectCode)) { return actions.associateWith { true } } val actionList = actions.map { action -> @@ -457,7 +457,7 @@ class RbacPermissionService( ) val startEpoch = System.currentTimeMillis() try { - if (rbacCacheService.checkProjectManager(userId = userId, projectCode = projectCode)) { + if (rbacCommonService.checkProjectManager(userId = userId, projectCode = projectCode)) { return actions.associate { val authPermission = it.substringAfterLast("_") AuthPermission.get(authPermission) to resources.map { resource -> resource.resourceCode } @@ -614,7 +614,7 @@ class RbacPermissionService( resourceType: String, action: String ): Boolean { - return rbacCacheService.checkProjectManager( + return rbacCommonService.checkProjectManager( userId = userId, projectCode = projectCode ) || superManagerService.projectManagerCheck( diff --git a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/AbMigratePolicyService.kt b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/AbMigratePolicyService.kt index 968ea175bc3a..7311fd7c3b4c 100644 --- a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/AbMigratePolicyService.kt +++ b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/AbMigratePolicyService.kt @@ -42,7 +42,7 @@ import com.tencent.devops.auth.dao.AuthResourceGroupConfigDao import com.tencent.devops.auth.dao.AuthResourceGroupDao import com.tencent.devops.auth.pojo.enum.MemberType import com.tencent.devops.auth.provider.rbac.pojo.migrate.MigrateTaskDataResult -import com.tencent.devops.auth.provider.rbac.service.RbacCacheService +import com.tencent.devops.auth.provider.rbac.service.RbacCommonService import com.tencent.devops.auth.provider.rbac.service.migrate.MigrateIamApiService.Companion.GROUP_API_POLICY import com.tencent.devops.auth.provider.rbac.service.migrate.MigrateIamApiService.Companion.GROUP_WEB_POLICY import com.tencent.devops.auth.provider.rbac.service.migrate.MigrateIamApiService.Companion.USER_CUSTOM_POLICY @@ -75,7 +75,7 @@ abstract class AbMigratePolicyService( private val migrateIamApiService: MigrateIamApiService, private val authMigrationDao: AuthMigrationDao, private val permissionService: PermissionService, - private val rbacCacheService: RbacCacheService, + private val rbacCommonService: RbacCommonService, private val deptService: DeptService, private val permissionResourceGroupPermissionService: PermissionResourceGroupPermissionService, private val permissionResourceMemberService: PermissionResourceMemberService @@ -497,7 +497,7 @@ abstract class AbMigratePolicyService( resourceCode: String, userId: String ): Pair { - rbacCacheService.getGroupConfigAction(resourceType).forEach groupConfig@{ groupConfig -> + rbacCommonService.getGroupConfigAction(resourceType).forEach groupConfig@{ groupConfig -> if (groupConfig.actions.containsAll(actions)) { val groupId = authResourceGroupDao.get( dslContext = dslContext, diff --git a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/MigrateResourceService.kt b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/MigrateResourceService.kt index 8f931ec5e7ef..a6ddd6c98420 100644 --- a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/MigrateResourceService.kt +++ b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/MigrateResourceService.kt @@ -42,7 +42,7 @@ import com.tencent.devops.auth.dao.AuthResourceGroupDao import com.tencent.devops.auth.pojo.dto.ResourceMigrationCountDTO import com.tencent.devops.auth.provider.rbac.service.AuthResourceService import com.tencent.devops.auth.provider.rbac.service.PermissionGradeManagerService -import com.tencent.devops.auth.provider.rbac.service.RbacCacheService +import com.tencent.devops.auth.provider.rbac.service.RbacCommonService import com.tencent.devops.auth.provider.rbac.service.RbacPermissionResourceService import com.tencent.devops.auth.service.ResourceService import com.tencent.devops.auth.service.iam.MigrateCreatorFixService @@ -66,7 +66,7 @@ import java.util.concurrent.Executors @Suppress("LongParameterList", "MagicNumber") class MigrateResourceService @Autowired constructor( private val resourceService: ResourceService, - private val rbacCacheService: RbacCacheService, + private val rbacCommonService: RbacCommonService, private val rbacPermissionResourceService: RbacPermissionResourceService, private val migrateCreatorFixService: MigrateCreatorFixService, private val authResourceService: AuthResourceService, @@ -89,7 +89,7 @@ class MigrateResourceService @Autowired constructor( val startEpoch = System.currentTimeMillis() logger.info("start to migrate resource:$projectCode") try { - val resourceTypes = rbacCacheService.listResourceTypes() + val resourceTypes = rbacCommonService.listResourceTypes() .map { it.resourceType } .filterNot { noNeedToMigrateResourceType.contains(it) } diff --git a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/MigrateResultService.kt b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/MigrateResultService.kt index 3b2c76b3b23a..b97904e30853 100644 --- a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/MigrateResultService.kt +++ b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/MigrateResultService.kt @@ -33,7 +33,7 @@ import com.tencent.devops.auth.constant.AuthMessageCode import com.tencent.devops.auth.provider.rbac.service.AuthResourceService import com.tencent.devops.auth.service.AuthVerifyRecordService import com.tencent.devops.auth.service.DeptService -import com.tencent.devops.auth.provider.rbac.service.RbacCacheService +import com.tencent.devops.auth.provider.rbac.service.RbacCommonService import com.tencent.devops.auth.service.iam.PermissionService import com.tencent.devops.common.api.exception.ErrorCodeException import com.tencent.devops.common.api.util.PageUtil @@ -55,7 +55,7 @@ import java.util.concurrent.Executors @Suppress("ALL") class MigrateResultService constructor( private val permissionService: PermissionService, - private val rbacCacheService: RbacCacheService, + private val rbacCommonService: RbacCommonService, private val migrateResourceCodeConverter: MigrateResourceCodeConverter, private val authVerifyRecordService: AuthVerifyRecordService, private val migrateResourceService: MigrateResourceService, @@ -79,7 +79,7 @@ class MigrateResultService constructor( logger.info("start to compare policy|$projectCode") val startEpoch = System.currentTimeMillis() try { - val resourceTypes = rbacCacheService.listResourceTypes() + val resourceTypes = rbacCommonService.listResourceTypes() .map { it.resourceType } val traceId = MDC.get(TraceTag.BIZID) val compareFuture = resourceTypes.map { resourceType -> diff --git a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/MigrateV0PolicyService.kt b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/MigrateV0PolicyService.kt index 564063851c54..b7846c0d8dcd 100644 --- a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/MigrateV0PolicyService.kt +++ b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/MigrateV0PolicyService.kt @@ -43,7 +43,7 @@ import com.tencent.devops.auth.dao.AuthResourceGroupDao import com.tencent.devops.auth.pojo.enum.MemberType import com.tencent.devops.auth.provider.rbac.pojo.migrate.MigrateTaskDataResult import com.tencent.devops.auth.provider.rbac.service.AuthResourceCodeConverter -import com.tencent.devops.auth.provider.rbac.service.RbacCacheService +import com.tencent.devops.auth.provider.rbac.service.RbacCommonService import com.tencent.devops.auth.service.DeptService import com.tencent.devops.auth.service.iam.PermissionResourceGroupPermissionService import com.tencent.devops.auth.service.iam.PermissionResourceMemberService @@ -68,7 +68,7 @@ class MigrateV0PolicyService constructor( private val migrateIamApiService: MigrateIamApiService, private val authResourceCodeConverter: AuthResourceCodeConverter, private val permissionService: PermissionService, - private val rbacCacheService: RbacCacheService, + private val rbacCommonService: RbacCommonService, private val authMigrationDao: AuthMigrationDao, private val deptService: DeptService, private val permissionResourceGroupPermissionService: PermissionResourceGroupPermissionService, @@ -82,7 +82,7 @@ class MigrateV0PolicyService constructor( migrateIamApiService = migrateIamApiService, authMigrationDao = authMigrationDao, permissionService = permissionService, - rbacCacheService = rbacCacheService, + rbacCommonService = rbacCommonService, deptService = deptService, permissionResourceGroupPermissionService = permissionResourceGroupPermissionService, permissionResourceMemberService = permissionResourceMemberService diff --git a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/MigrateV3PolicyService.kt b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/MigrateV3PolicyService.kt index fb8abd5d7885..40900d0a9a35 100644 --- a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/MigrateV3PolicyService.kt +++ b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/MigrateV3PolicyService.kt @@ -41,7 +41,7 @@ import com.tencent.devops.auth.dao.AuthResourceGroupConfigDao import com.tencent.devops.auth.dao.AuthResourceGroupDao import com.tencent.devops.auth.provider.rbac.pojo.migrate.MigrateTaskDataResult import com.tencent.devops.auth.provider.rbac.service.AuthResourceCodeConverter -import com.tencent.devops.auth.provider.rbac.service.RbacCacheService +import com.tencent.devops.auth.provider.rbac.service.RbacCommonService import com.tencent.devops.auth.service.DeptService import com.tencent.devops.auth.service.iam.PermissionResourceGroupPermissionService import com.tencent.devops.auth.service.iam.PermissionResourceMemberService @@ -72,7 +72,7 @@ class MigrateV3PolicyService constructor( private val migrateIamApiService: MigrateIamApiService, private val authResourceCodeConverter: AuthResourceCodeConverter, private val permissionService: PermissionService, - private val rbacCacheService: RbacCacheService, + private val rbacCommonService: RbacCommonService, private val authMigrationDao: AuthMigrationDao, private val deptService: DeptService, private val permissionResourceGroupPermissionService: PermissionResourceGroupPermissionService, @@ -86,7 +86,7 @@ class MigrateV3PolicyService constructor( migrateIamApiService = migrateIamApiService, authMigrationDao = authMigrationDao, permissionService = permissionService, - rbacCacheService = rbacCacheService, + rbacCommonService = rbacCommonService, deptService = deptService, permissionResourceGroupPermissionService = permissionResourceGroupPermissionService, permissionResourceMemberService = permissionResourceMemberService diff --git a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/RbacPermissionMigrateService.kt b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/RbacPermissionMigrateService.kt index 6c6f54198f84..8f0a67ec78fc 100644 --- a/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/RbacPermissionMigrateService.kt +++ b/src/backend/ci/core/auth/biz-auth/src/main/kotlin/com/tencent/devops/auth/provider/rbac/service/migrate/RbacPermissionMigrateService.kt @@ -37,7 +37,6 @@ import com.tencent.devops.auth.pojo.dto.PermissionHandoverDTO import com.tencent.devops.auth.pojo.enum.AuthMigrateStatus import com.tencent.devops.auth.provider.rbac.service.AuthResourceService import com.tencent.devops.auth.provider.rbac.service.PermissionGradeManagerService -import com.tencent.devops.auth.provider.rbac.service.RbacCacheService import com.tencent.devops.auth.service.iam.MigrateCreatorFixService import com.tencent.devops.auth.service.iam.PermissionMigrateService import com.tencent.devops.auth.service.iam.PermissionResourceMemberService @@ -68,7 +67,7 @@ import java.util.concurrent.Executors * rbac迁移服务 */ @Suppress("LongParameterList", "ReturnCount") -class RbacPermissionMigrateService constructor( +class RbacPermissionMigrateService ( private val client: Client, private val migrateResourceService: MigrateResourceService, private val migrateV3PolicyService: MigrateV3PolicyService, @@ -82,7 +81,6 @@ class RbacPermissionMigrateService constructor( private val dslContext: DSLContext, private val authMigrationDao: AuthMigrationDao, private val authMonitorSpaceDao: AuthMonitorSpaceDao, - private val cacheService: RbacCacheService, private val permissionResourceMemberService: PermissionResourceMemberService, private val migrateResourceAuthorizationService: MigrateResourceAuthorizationService, private val migrateResourceGroupService: MigrateResourceGroupService diff --git a/src/backend/ci/core/auth/biz-auth/src/test/kotlin/com/tencent/devops/auth/rbac/service/migrate/AbMigratePolicyServiceTest.kt b/src/backend/ci/core/auth/biz-auth/src/test/kotlin/com/tencent/devops/auth/rbac/service/migrate/AbMigratePolicyServiceTest.kt index c8cc6766af6c..ac077b5ea459 100644 --- a/src/backend/ci/core/auth/biz-auth/src/test/kotlin/com/tencent/devops/auth/rbac/service/migrate/AbMigratePolicyServiceTest.kt +++ b/src/backend/ci/core/auth/biz-auth/src/test/kotlin/com/tencent/devops/auth/rbac/service/migrate/AbMigratePolicyServiceTest.kt @@ -37,7 +37,7 @@ import com.tencent.devops.auth.dao.AuthResourceGroupConfigDao import com.tencent.devops.auth.dao.AuthResourceGroupDao import com.tencent.devops.auth.provider.rbac.pojo.migrate.MigrateTaskDataResult import com.tencent.devops.auth.provider.rbac.service.AuthResourceCodeConverter -import com.tencent.devops.auth.provider.rbac.service.RbacCacheService +import com.tencent.devops.auth.provider.rbac.service.RbacCommonService import com.tencent.devops.auth.provider.rbac.service.migrate.AbMigratePolicyService import com.tencent.devops.auth.provider.rbac.service.migrate.MigrateIamApiService import com.tencent.devops.auth.provider.rbac.service.migrate.MigrateResourceCodeConverter @@ -63,7 +63,7 @@ open class AbMigratePolicyServiceTest : BkCiAbstractTest() { val migrateIamApiService: MigrateIamApiService = mockk() val authMigrationDao: AuthMigrationDao = mockk() val permissionService: PermissionService = mockk() - val rbacCacheService: RbacCacheService = mockk() + val rbacCommonService: RbacCommonService = mockk() val migrateResourceCodeConverter: MigrateResourceCodeConverter = mockk() val authResourceCodeConverter: AuthResourceCodeConverter = mockk() val deptService: DeptService = mockk() diff --git a/src/backend/ci/core/auth/biz-auth/src/test/kotlin/com/tencent/devops/auth/rbac/service/migrate/MigrateV0PolicyServiceTest.kt b/src/backend/ci/core/auth/biz-auth/src/test/kotlin/com/tencent/devops/auth/rbac/service/migrate/MigrateV0PolicyServiceTest.kt index 5564b1b2d8dc..96221ec2e6d4 100644 --- a/src/backend/ci/core/auth/biz-auth/src/test/kotlin/com/tencent/devops/auth/rbac/service/migrate/MigrateV0PolicyServiceTest.kt +++ b/src/backend/ci/core/auth/biz-auth/src/test/kotlin/com/tencent/devops/auth/rbac/service/migrate/MigrateV0PolicyServiceTest.kt @@ -56,7 +56,7 @@ class MigrateV0PolicyServiceTest : AbMigratePolicyServiceTest() { migrateIamApiService = migrateIamApiService, authResourceCodeConverter = authResourceCodeConverter, permissionService = permissionService, - rbacCacheService = rbacCacheService, + rbacCommonService = rbacCommonService, authMigrationDao = authMigrationDao, deptService = deptService, permissionResourceGroupPermissionService = permissionResourceGroupPermissionService, diff --git a/src/backend/ci/core/auth/biz-auth/src/test/kotlin/com/tencent/devops/auth/rbac/service/migrate/MigrateV3PolicyServiceTest.kt b/src/backend/ci/core/auth/biz-auth/src/test/kotlin/com/tencent/devops/auth/rbac/service/migrate/MigrateV3PolicyServiceTest.kt index f18ee9cf8d2f..bf4e94b3d767 100644 --- a/src/backend/ci/core/auth/biz-auth/src/test/kotlin/com/tencent/devops/auth/rbac/service/migrate/MigrateV3PolicyServiceTest.kt +++ b/src/backend/ci/core/auth/biz-auth/src/test/kotlin/com/tencent/devops/auth/rbac/service/migrate/MigrateV3PolicyServiceTest.kt @@ -55,7 +55,7 @@ class MigrateV3PolicyServiceTest : AbMigratePolicyServiceTest() { migrateIamApiService = migrateIamApiService, authResourceCodeConverter = authResourceCodeConverter, permissionService = permissionService, - rbacCacheService = rbacCacheService, + rbacCommonService = rbacCommonService, authMigrationDao = authMigrationDao, deptService = deptService, permissionResourceGroupPermissionService = permissionResourceGroupPermissionService, diff --git a/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/pojo/app/StartBuildContext.kt b/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/pojo/app/StartBuildContext.kt index d8ffd3e36298..fb8ad79b289c 100644 --- a/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/pojo/app/StartBuildContext.kt +++ b/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/pojo/app/StartBuildContext.kt @@ -481,7 +481,7 @@ data class StartBuildContext( */ private fun fillCascadeParam( param: BuildParameters, - originStartContexts: HashMap + originStartContexts: HashMap, ): List { val originStartParams = mutableListOf() val key = param.key