forked from TencentBlueKing/bk-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature proxy
- Loading branch information
Showing
209 changed files
with
8,245 additions
and
145 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...ive/biz-archive/src/main/kotlin/com/tencent/bkrepo/archive/job/FileStorageFileProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/backend/auth/api-auth/src/main/kotlin/com/tencent/bkrepo/auth/api/ServiceProxyClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. | ||
* | ||
* A copy of the MIT License is included in this file. | ||
* | ||
* | ||
* Terms of the MIT License: | ||
* --------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT | ||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.bkrepo.auth.api | ||
|
||
import com.tencent.bkrepo.auth.pojo.proxy.ProxyKey | ||
import com.tencent.bkrepo.common.api.constant.AUTH_SERVICE_NAME | ||
import com.tencent.bkrepo.common.api.pojo.Response | ||
import io.swagger.annotations.Api | ||
import io.swagger.annotations.ApiOperation | ||
import org.springframework.cloud.openfeign.FeignClient | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.PathVariable | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
|
||
@Api(tags = ["SERVICE_PROXY"], description = "服务Proxy接口") | ||
@FeignClient(AUTH_SERVICE_NAME, contextId = "ServiceProxyClient") | ||
@RequestMapping("/service/proxy") | ||
interface ServiceProxyClient { | ||
|
||
@ApiOperation("获取Proxy加密存储的密钥") | ||
@GetMapping("/key/{projectId}/{name}") | ||
fun getEncryptedKey( | ||
@PathVariable projectId: String, | ||
@PathVariable name: String | ||
): Response<ProxyKey> | ||
} |
62 changes: 62 additions & 0 deletions
62
...end/auth/api-auth/src/main/kotlin/com/tencent/bkrepo/auth/api/proxy/ProxyAccountClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. | ||
* | ||
* A copy of the MIT License is included in this file. | ||
* | ||
* | ||
* Terms of the MIT License: | ||
* --------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT | ||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.bkrepo.auth.api.proxy | ||
|
||
import com.tencent.bkrepo.common.api.constant.AUTH_SERVICE_NAME | ||
import com.tencent.bkrepo.common.api.pojo.Response | ||
import io.swagger.annotations.Api | ||
import io.swagger.annotations.ApiOperation | ||
import io.swagger.annotations.ApiParam | ||
import org.springframework.cloud.openfeign.FeignClient | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.PathVariable | ||
import org.springframework.web.bind.annotation.PostMapping | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
import org.springframework.web.bind.annotation.RequestParam | ||
|
||
@Api(tags = ["PROXY_ACCOUNT"], description = "Proxy账号接口") | ||
@FeignClient(AUTH_SERVICE_NAME, contextId = "ProxyAccountClient") | ||
@RequestMapping("/proxy/account") | ||
interface ProxyAccountClient { | ||
|
||
@ApiOperation("校验ak/sk") | ||
@PostMapping("/credential") | ||
fun checkAccountCredential( | ||
@ApiParam(value = "accesskey") | ||
@RequestParam accesskey: String, | ||
@ApiParam(value = "secretkey") | ||
@RequestParam secretkey: String | ||
): Response<String?> | ||
|
||
@ApiOperation("查找sk") | ||
@GetMapping("/credential/appId/{appId}/accessKey/{accessKey}") | ||
fun findSecretKey( | ||
@ApiParam @PathVariable appId: String, | ||
@ApiParam @PathVariable accessKey: String | ||
): Response<String?> | ||
} |
67 changes: 67 additions & 0 deletions
67
...ackend/auth/api-auth/src/main/kotlin/com/tencent/bkrepo/auth/api/proxy/ProxyAuthClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. | ||
* | ||
* A copy of the MIT License is included in this file. | ||
* | ||
* | ||
* Terms of the MIT License: | ||
* --------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT | ||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.bkrepo.auth.api.proxy | ||
|
||
import com.tencent.bkrepo.auth.pojo.proxy.ProxyStatusRequest | ||
import com.tencent.bkrepo.common.api.constant.AUTH_SERVICE_NAME | ||
import com.tencent.bkrepo.common.api.pojo.Response | ||
import io.swagger.annotations.Api | ||
import org.springframework.cloud.openfeign.FeignClient | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.PathVariable | ||
import org.springframework.web.bind.annotation.PostMapping | ||
import org.springframework.web.bind.annotation.RequestBody | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
|
||
@Api(tags = ["PROXY_AUTH"], description = "Proxy认证接口") | ||
@FeignClient(AUTH_SERVICE_NAME, contextId = "ProxyAuthClient") | ||
@RequestMapping("/proxy/auth") | ||
interface ProxyAuthClient { | ||
|
||
@GetMapping("/ticket/{projectId}/{name}") | ||
fun ticket( | ||
@PathVariable projectId: String, | ||
@PathVariable name: String | ||
): Response<Int> | ||
|
||
@PostMapping("/startup") | ||
fun startup( | ||
@RequestBody proxyStatusRequest: ProxyStatusRequest | ||
): Response<String> | ||
|
||
@PostMapping("/shutdown") | ||
fun shutdown( | ||
@RequestBody proxyStatusRequest: ProxyStatusRequest | ||
): Response<Void> | ||
|
||
@PostMapping("/heartbeat/{projectId}/{name}") | ||
fun heartbeat( | ||
@PathVariable projectId: String, | ||
@PathVariable name: String | ||
): Response<Void> | ||
} |
58 changes: 58 additions & 0 deletions
58
...i-auth/src/main/kotlin/com/tencent/bkrepo/auth/api/proxy/ProxyOauthAuthorizationClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. | ||
* | ||
* A copy of the MIT License is included in this file. | ||
* | ||
* | ||
* Terms of the MIT License: | ||
* --------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT | ||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.bkrepo.auth.api.proxy | ||
|
||
import com.tencent.bkrepo.auth.pojo.oauth.OauthToken | ||
import com.tencent.bkrepo.common.api.constant.AUTH_SERVICE_NAME | ||
import com.tencent.bkrepo.common.api.pojo.Response | ||
import io.swagger.annotations.Api | ||
import io.swagger.annotations.ApiOperation | ||
import org.springframework.cloud.openfeign.FeignClient | ||
import org.springframework.context.annotation.Primary | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
import org.springframework.web.bind.annotation.RequestParam | ||
|
||
@Api(tags = ["PROXY_OAUTHAUTHORIZATION"], description = "Proxy Oauth授权接口") | ||
@Primary | ||
@FeignClient(AUTH_SERVICE_NAME, contextId = "ProxyOauthAuthorizationClient") | ||
@RequestMapping("/proxy/oauth") | ||
interface ProxyOauthAuthorizationClient { | ||
|
||
@ApiOperation("获取oauth token信息") | ||
@GetMapping("/token") | ||
fun getToken( | ||
@RequestParam accessToken: String | ||
): Response<OauthToken?> | ||
|
||
@ApiOperation("验证oauth token") | ||
@GetMapping("/token/validate") | ||
fun validateToken( | ||
@RequestParam accessToken: String | ||
): Response<String?> | ||
} |
50 changes: 50 additions & 0 deletions
50
.../auth/api-auth/src/main/kotlin/com/tencent/bkrepo/auth/api/proxy/ProxyPermissionClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. | ||
* | ||
* A copy of the MIT License is included in this file. | ||
* | ||
* | ||
* Terms of the MIT License: | ||
* --------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT | ||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.bkrepo.auth.api.proxy | ||
|
||
import com.tencent.bkrepo.auth.pojo.permission.CheckPermissionRequest | ||
import com.tencent.bkrepo.common.api.constant.AUTH_SERVICE_NAME | ||
import com.tencent.bkrepo.common.api.pojo.Response | ||
import io.swagger.annotations.Api | ||
import io.swagger.annotations.ApiOperation | ||
import org.springframework.cloud.openfeign.FeignClient | ||
import org.springframework.web.bind.annotation.PostMapping | ||
import org.springframework.web.bind.annotation.RequestBody | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
|
||
@Api(tags = ["PROXY_PERMISSION"], description = "Proxy权限接口") | ||
@FeignClient(AUTH_SERVICE_NAME, contextId = "ProxyPermissionClient") | ||
@RequestMapping("/proxy/permission") | ||
interface ProxyPermissionClient { | ||
|
||
@ApiOperation("校验权限") | ||
@PostMapping("/check") | ||
fun checkPermission( | ||
@RequestBody request: CheckPermissionRequest | ||
): Response<Boolean> | ||
} |
51 changes: 51 additions & 0 deletions
51
...ckend/auth/api-auth/src/main/kotlin/com/tencent/bkrepo/auth/api/proxy/ProxyProxyClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. | ||
* | ||
* A copy of the MIT License is included in this file. | ||
* | ||
* | ||
* Terms of the MIT License: | ||
* --------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT | ||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.bkrepo.auth.api.proxy | ||
|
||
import com.tencent.bkrepo.auth.pojo.proxy.ProxyInfo | ||
import com.tencent.bkrepo.common.api.constant.AUTH_SERVICE_NAME | ||
import com.tencent.bkrepo.common.api.pojo.Response | ||
import io.swagger.annotations.Api | ||
import io.swagger.annotations.ApiOperation | ||
import org.springframework.cloud.openfeign.FeignClient | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.PathVariable | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
|
||
@Api(tags = ["PROXY_PROXY"], description = "Proxy Proxy接口") | ||
@FeignClient(AUTH_SERVICE_NAME, contextId = "ProxyProxyClient") | ||
@RequestMapping("/proxy/proxy") | ||
interface ProxyProxyClient { | ||
|
||
@ApiOperation("查询Proxy信息") | ||
@GetMapping("/info/{projectId}/{name}") | ||
fun info( | ||
@PathVariable projectId: String, | ||
@PathVariable name: String | ||
): Response<ProxyInfo> | ||
} |
Oops, something went wrong.