Skip to content

Commit

Permalink
feat:oauth2 增加密码模式 #10663
Browse files Browse the repository at this point in the history
  • Loading branch information
fcfang123 committed Sep 20, 2024
1 parent 1bdc23c commit a9894b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.tencent.devops.openapi.api.apigw.v4

import com.tencent.devops.auth.pojo.Oauth2AccessTokenRequest
import com.tencent.devops.auth.pojo.vo.Oauth2AccessTokenVo
import com.tencent.devops.common.api.auth.AUTH_HEADER_DEVOPS_APP_CODE
import com.tencent.devops.common.api.auth.AUTH_HEADER_DEVOPS_APP_CODE_DEFAULT_VALUE
import com.tencent.devops.common.api.auth.AUTH_HEADER_OAUTH2_CLIENT_ID
Expand Down Expand Up @@ -43,5 +44,5 @@ interface ApigwOauth2EndpointResourceV4 {
clientSecret: String,
@Parameter(description = "oauth2获取token请求报文体", required = true)
accessTokenRequest: Oauth2AccessTokenRequest
): Result<Any>
): Result<Oauth2AccessTokenVo>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.tencent.devops.openapi.resources.apigw.v4

import com.tencent.devops.auth.api.oauth2.Oauth2ServiceEndpointResource
import com.tencent.devops.auth.pojo.Oauth2AccessTokenRequest
import com.tencent.devops.auth.pojo.vo.Oauth2AccessTokenVo
import com.tencent.devops.common.api.exception.ErrorCodeException
import com.tencent.devops.common.api.exception.RemoteServiceException
import com.tencent.devops.common.api.pojo.Result
Expand All @@ -22,7 +23,7 @@ class ApigwOauth2EndpointResourceV4Impl @Autowired constructor(
clientId: String,
clientSecret: String,
accessTokenRequest: Oauth2AccessTokenRequest
): Result<Any> {
): Result<Oauth2AccessTokenVo> {
logger.info("OPENAPI_OAUTH2_ACCESS_TOKEN_V4|$appCode|$clientId")
return try {
client.get(Oauth2ServiceEndpointResource::class).getAccessToken(
Expand Down

0 comments on commit a9894b9

Please sign in to comment.