File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff line change 11package token
22
33import (
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
127128func (otc * OidcTokenExchangeCommand ) ServerDetails () (* config.ServerDetails , error ) {
You can’t perform that action at this time.
0 commit comments