Skip to content

Commit

Permalink
feat:支持管理我的 OAUTH TencentBlueKing#10995
Browse files Browse the repository at this point in the history
  • Loading branch information
hejieehe committed Dec 10, 2024
1 parent 565229f commit d6952eb
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,5 @@ object AuthMessageCode {
const val INVALID_HANDOVER_TO = "2121088" // 目标对象和交接人不允许相同
const val INVALID_EXPIRED_PERM_NOT_ALLOW_TO_HANDOVER = "2121089" // 已过期的权限不允许交接

const val ERROR_USER_INFORMATION_NOT_SYNCED = "2121090" // 请等待第二天用户信息同步后再尝试操作,因为新入职用户的信息尚未同步完成

const val OAUTH_INFO_OCCUPIED_CANNOT_DELETE = "2121097" // OAUTH授权信息被占用,无法删除
const val ERROR_USER_INFORMATION_NOT_SYNCED = "2121090" // 请等待第二天用户信息同步后再尝试操作,因为新入职用户的信息尚未同步完成。
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ object RepositoryMessageCode {
const val ERROR_USER_HAVE_NOT_DOWNLOAD_PEM = "2115043" // 用户({0})无({1})项目下载权限
const val NOT_GITHUB_AUTHORIZED_BY_OAUTH = "2115044" // 用户[{0}]尚未进行GITHUB OAUTH授权,请先授权。
const val REPOSITORY_NO_SUPPORT_OAUTH = "2115045" // ({0})类型代码库暂不支持OAUTH授权
const val OAUTH_INFO_OCCUPIED_CANNOT_DELETE = "2115049" // OAUTH授权信息被占用,无法删除

const val USER_NOT_PERMISSIONS_OPERATE_REPOSITORY = "2115046" // 用户({0})无权限在工程({1})下{2}流水线{3}

Expand All @@ -107,4 +108,5 @@ object RepositoryMessageCode {
const val OPERATION_LIST_TAGS = "OperationListTags" // 获取Tag列表

const val TRIGGER_CONDITION_PREFIX = "trigger.condition"

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.tencent.devops.common.api.enums.ScmCode
import com.tencent.devops.common.api.exception.ErrorCodeException
import com.tencent.devops.common.api.pojo.Page
import com.tencent.devops.common.api.util.PageUtil
import com.tencent.devops.repository.constant.RepositoryMessageCode
import com.tencent.devops.repository.pojo.RepoOauthRefVo
import com.tencent.devops.repository.pojo.enums.RedirectUrlTypeEnum
import com.tencent.devops.repository.pojo.enums.TokenTypeEnum
Expand Down Expand Up @@ -85,7 +86,7 @@ class OauthRepositoryService @Autowired constructor(
// 检查是否还有关联代码库
if (countOauthRepo(userId, scmCode) > 0) {
throw ErrorCodeException(
errorCode = AuthMessageCode.OAUTH_INFO_OCCUPIED_CANNOT_DELETE
errorCode = RepositoryMessageCode.OAUTH_INFO_OCCUPIED_CANNOT_DELETE
)
}
oauth2TokenStoreManager.delete(userId = userId, scmCode = scmCode.name)
Expand Down
1 change: 0 additions & 1 deletion support-files/i18n/auth/message_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
2121088=The target member and the handover person are not allowed to be the same.
2121089=Expired permissions are not allowed to be transferred
2121090=Please wait until the next day for user information to be synchronized before trying again, as the information of new users has not yet been synchronized.
2121097=OAuth auth info occupied, can't delete
bkAdministratorNotExpired=Permission has not expired and no action is required
bkAgreeRenew=Agree to renew
bkApproverAgreeRenew=Approver agreed to your permission renewal
Expand Down
1 change: 0 additions & 1 deletion support-files/i18n/auth/message_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
2121088=目标对象和交接人不允许相同
2121089=已过期的权限不允许交接
2121090=请等待第二天用户信息同步后再尝试操作,因为新入职用户的信息尚未同步完成。
2121097=OAUTH授权信息被占用, 无法删除
bkAdministratorNotExpired=权限还未过期,不需要操作
bkAgreeRenew=同意续期
bkApproverAgreeRenew=审批人同意了您的权限续期
Expand Down
1 change: 1 addition & 0 deletions support-files/i18n/repository/message_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
2115043=User ({0}) does not have pull access to the (<a href="{1}" target="_blank">{2}</a>) repository
2115044=User [{0}] has not authorized Github Oauth yet. Please authorize first
2115045=({0}) type of code repository does not currently support OAUTH authorization
2115049=OAuth auth info occupied, can't delete
2100054=User ({0}) does not have permission to {2} repository {3} under project ({1}).
bkRequestFileSizeLimit=The request file cannot exceed 1m
OperationAddCheckRuns=Add a detection task
Expand Down
1 change: 1 addition & 0 deletions support-files/i18n/repository/message_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
2115044=用户[{0}]尚未进行GITHUB OAUTH授权,请先授权
2115045=({0})类型代码库暂不支持OAUTH授权
2115046=用户({0})无权限在工程({1})下{2}代码库{3}
2115049=OAUTH授权信息被占用, 无法删除
bkRequestFileSizeLimit=请求文件不能超过1M
OperationAddCheckRuns=添加检测任务
OperationUpdateCheckRuns=更新检测任务
Expand Down

0 comments on commit d6952eb

Please sign in to comment.