Skip to content

Commit b5f34f6

Browse files
committed
Test output
1 parent 0bbaa19 commit b5f34f6

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

common/commands/config.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,9 @@ func exchangeOidcTokenAndSetAccessToken(cc *ConfigCommand) error {
234234
SetProjectKey(cc.oidcSetupParams.ProjectKey).
235235
SetRepository(cc.oidcSetupParams.Repository).
236236
SetJobId(cc.oidcSetupParams.JobId).
237-
SetRunId(cc.oidcSetupParams.RunId)
237+
SetRunId(cc.oidcSetupParams.RunId).
238+
// TODO remove this after tests
239+
SetOutputTokenToConsole(true)
238240

239241
// Usage report will be sent only after execution in order to have valid token
240242
err := ExecAndReportUsage(accessTokenCreateCmd)

general/token/oidctokenexchange.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
package token
22

33
import (
4-
"encoding/json"
54
"fmt"
65
rtUtils "github.com/jfrog/jfrog-cli-core/v2/artifactory/utils"
76
"github.com/jfrog/jfrog-cli-core/v2/utils/config"
87
"github.com/jfrog/jfrog-client-go/access/services"
98
"github.com/jfrog/jfrog-client-go/auth"
10-
"github.com/jfrog/jfrog-client-go/utils/errorutils"
119
"strings"
1210
)
1311

@@ -119,9 +117,12 @@ func (otc *OidcTokenExchangeCommand) SetRepository(repo string) *OidcTokenExchan
119117
return otc
120118
}
121119

122-
func (otc *OidcTokenExchangeCommand) Response() ([]byte, error) {
123-
content, err := json.Marshal(*otc.response)
124-
return content, errorutils.CheckError(err)
120+
func (otc *OidcTokenExchangeCommand) SetOutputTokenToConsole(outputTokenToConsole bool) {
121+
otc.outputTokenToConsole = outputTokenToConsole
122+
}
123+
124+
func (otc *OidcTokenExchangeCommand) Response() (response *auth.OidcTokenResponseData) {
125+
return otc.response
125126
}
126127

127128
func (otc *OidcTokenExchangeCommand) ServerDetails() (*config.ServerDetails, error) {

0 commit comments

Comments
 (0)