@@ -64,9 +64,9 @@ type ConfigCommand struct {
6464 // Forcibly make the configured server default.
6565 makeDefault bool
6666 // For unit tests
67- disablePrompts bool
68- cmdType ConfigAction
69- oidcSetupParams * generic.ConfigOidcParams
67+ disablePrompts bool
68+ cmdType ConfigAction
69+ configOidcParams * generic.OidcParams
7070}
7171
7272func NewConfigCommand (cmdType ConfigAction , serverId string ) * ConfigCommand {
@@ -216,22 +216,22 @@ func (cc *ConfigCommand) getConfigurationNonInteractively() error {
216216
217217// When a user is configuration a new server with OIDC, we will exchange the token and set the access token.
218218func exchangeOidcTokenAndSetAccessToken (cc * ConfigCommand ) error {
219- if err := validateOidcParams (cc .details .Url , cc .oidcSetupParams ); err != nil {
219+ if err := validateOidcParams (cc .details .Url , cc .configOidcParams ); err != nil {
220220 return err
221221 }
222222 log .Debug ("Exchanging OIDC token..." )
223223 exchangeOidcTokenCmd := generic .NewOidcTokenExchangeCommand ()
224224 exchangeOidcTokenCmd .
225225 SetServerDetails (cc .details ).
226- SetProviderName (cc .oidcSetupParams .ProviderName ).
227- SetOidcTokenID (cc .oidcSetupParams .TokenId ).
228- SetProviderType (cc .oidcSetupParams .ProviderType ).
229- SetAudience (cc .oidcSetupParams .Audience ).
230- SetApplicationKey (cc .oidcSetupParams .ApplicationKey ).
231- SetProjectKey (cc .oidcSetupParams .ProjectKey ).
232- SetRepository (cc .oidcSetupParams .Repository ).
233- SetJobId (cc .oidcSetupParams .JobId ).
234- SetRunId (cc .oidcSetupParams .RunId )
226+ SetProviderName (cc .configOidcParams .ProviderName ).
227+ SetOidcTokenID (cc .configOidcParams .TokenId ).
228+ SetProviderType (cc .configOidcParams .ProviderType ).
229+ SetAudience (cc .configOidcParams .Audience ).
230+ SetApplicationKey (cc .configOidcParams .ApplicationKey ).
231+ SetProjectKey (cc .configOidcParams .ProjectKey ).
232+ SetRepository (cc .configOidcParams .Repository ).
233+ SetJobId (cc .configOidcParams .JobId ).
234+ SetRunId (cc .configOidcParams .RunId )
235235
236236 // Usage report will be sent only after execution in order to have valid token
237237 err := ExecAndThenReportUsage (exchangeOidcTokenCmd )
@@ -300,7 +300,7 @@ func (cc *ConfigCommand) prepareConfigurationData() ([]*config.ServerDetails, er
300300 if cc .defaultDetails != nil {
301301 cc .details .InsecureTls = cc .defaultDetails .InsecureTls
302302 }
303- cc .oidcSetupParams = new (generic.ConfigOidcParams )
303+ cc .configOidcParams = new (generic.OidcParams )
304304 }
305305
306306 // Get configurations list
@@ -505,12 +505,12 @@ func (cc *ConfigCommand) readClientCertInfoFromConsole() {
505505}
506506
507507func (cc * ConfigCommand ) SetOidcExchangeTokenId (id string ) {
508- cc .oidcSetupParams .TokenId = id
508+ cc .configOidcParams .TokenId = id
509509}
510510
511511// If OIDC params were provided it indicates that we should use OIDC authentication method.
512512func (cc * ConfigCommand ) OidcAuthMethodUsed () bool {
513- return cc .oidcSetupParams != nil && cc .oidcSetupParams .ProviderName != ""
513+ return cc .configOidcParams != nil && cc .configOidcParams .ProviderName != ""
514514}
515515
516516func readAccessTokenFromConsole (details * config.ServerDetails ) error {
@@ -847,8 +847,8 @@ func (cc *ConfigCommand) handleWebLogin() error {
847847 return nil
848848}
849849
850- func (cc * ConfigCommand ) SetOIDCParams (oidcDetails * generic.ConfigOidcParams ) * ConfigCommand {
851- cc .oidcSetupParams = oidcDetails
850+ func (cc * ConfigCommand ) SetOIDCParams (oidcDetails * generic.OidcParams ) * ConfigCommand {
851+ cc .configOidcParams = oidcDetails
852852 return cc
853853}
854854
@@ -887,7 +887,7 @@ func assertSingleAuthMethod(details *config.ServerDetails) error {
887887
888888type ConfigCommandConfiguration struct {
889889 ServerDetails * config.ServerDetails
890- OidcParams * generic.ConfigOidcParams
890+ OidcParams * generic.OidcParams
891891 Interactive bool
892892 EncPassword bool
893893 BasicAuthOnly bool
@@ -905,7 +905,7 @@ func GetAllServerIds() []string {
905905 return serverIds
906906}
907907
908- func validateOidcParams (platformUrl string , oidcParams * generic.ConfigOidcParams ) error {
908+ func validateOidcParams (platformUrl string , oidcParams * generic.OidcParams ) error {
909909 if platformUrl == "" {
910910 return errorutils .CheckErrorf ("the --url flag must be provided when --oidc-provider is used" )
911911 }
0 commit comments