diff --git a/go.mod b/go.mod index d3e8ba6f6..e06e8867a 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,6 @@ require ( github.com/redhat-developer/app-services-sdk-go/kafkamgmt v0.13.0 github.com/redhat-developer/app-services-sdk-go/registryinstance v0.5.1 github.com/redhat-developer/app-services-sdk-go/registrymgmt v0.10.0 - github.com/redhat-developer/app-services-sdk-go/serviceaccountmgmt v0.8.0 github.com/redhat-developer/service-binding-operator v0.9.0 github.com/spf13/cobra v1.5.0 github.com/spf13/pflag v1.0.5 diff --git a/internal/build/build.go b/internal/build/build.go index 5e0532c5b..feb5d2f59 100644 --- a/internal/build/build.go +++ b/internal/build/build.go @@ -60,7 +60,6 @@ var ( DefaultLoginTimeout = 60 * time.Second OfflineTokenURL = ConsoleURL + "/openshift/token" ProductionAuthURL = "https://sso.redhat.com/auth/realms/redhat-external" - StagingAuthURL = "https://sso.stage.redhat.com/auth/realms/redhat-external" ) func init() { diff --git a/pkg/cmd/connector/create/create.go b/pkg/cmd/connector/create/create.go index 0363a9987..fa0df4737 100644 --- a/pkg/cmd/connector/create/create.go +++ b/pkg/cmd/connector/create/create.go @@ -20,14 +20,13 @@ import ( "github.com/redhat-developer/app-services-cli/pkg/core/ioutil/dump" "github.com/redhat-developer/app-services-cli/pkg/core/localize" connectorerror "github.com/redhat-developer/app-services-sdk-go/connectormgmt/apiv1/error" - svcacctmgmtclient "github.com/redhat-developer/app-services-sdk-go/serviceaccountmgmt/apiv1/client" - "gopkg.in/AlecAivazis/survey.v1" "github.com/redhat-developer/app-services-cli/pkg/shared/connection" "github.com/redhat-developer/app-services-cli/pkg/shared/factory" connectormgmtclient "github.com/redhat-developer/app-services-sdk-go/connectormgmt/apiv1/client" + kafkamgmtclient "github.com/redhat-developer/app-services-sdk-go/kafkamgmt/apiv1/client" "github.com/spf13/cobra" ) @@ -138,17 +137,17 @@ func runCreate(opts *options) error { return nil } -func createServiceAccount(opts *factory.Factory, shortDescription string) (*svcacctmgmtclient.ServiceAccountData, error) { +func createServiceAccount(opts *factory.Factory, shortDescription string) (*kafkamgmtclient.ServiceAccount, error) { conn, err := opts.Connection() if err != nil { return nil, err } - serviceAccountPayload := svcacctmgmtclient.ServiceAccountCreateRequestData{Name: shortDescription} + serviceAccountPayload := kafkamgmtclient.ServiceAccountRequest{Name: shortDescription} serviceacct, httpRes, err := conn.API(). ServiceAccountMgmt(). CreateServiceAccount(opts.Context). - ServiceAccountCreateRequestData(serviceAccountPayload). + ServiceAccountRequest(serviceAccountPayload). Execute() if httpRes != nil { @@ -159,7 +158,7 @@ func createServiceAccount(opts *factory.Factory, shortDescription string) (*svca return nil, err } opts.Logger.Info(opts.Localizer.MustLocalize("connector.sa.created", - localize.NewEntry("ClientId", serviceacct.ClientId), localize.NewEntry("ClientSecret", serviceacct.Secret), localize.NewEntry("Name", shortDescription))) + localize.NewEntry("ClientId", serviceacct.ClientId), localize.NewEntry("ClientSecret", serviceacct.ClientSecret), localize.NewEntry("Name", shortDescription))) return &serviceacct, nil } @@ -184,7 +183,7 @@ func setDefaultValuesFromFlags(connector *connectormgmtclient.ConnectorRequest, if err1 != nil { return err1 } - connector.ServiceAccount = *connectormgmtclient.NewServiceAccount(serviceAccount.GetClientId(), serviceAccount.GetSecret()) + connector.ServiceAccount = *connectormgmtclient.NewServiceAccount(serviceAccount.GetClientId(), serviceAccount.GetClientSecret()) } return nil } diff --git a/pkg/cmd/login/login.go b/pkg/cmd/login/login.go index 5f50a0a37..7da8c6959 100644 --- a/pkg/cmd/login/login.go +++ b/pkg/cmd/login/login.go @@ -38,8 +38,8 @@ var apiGatewayAliases = map[string]string{ var authURLAliases = map[string]string{ "production": build.ProductionAuthURL, "prod": build.ProductionAuthURL, - "staging": build.StagingAuthURL, - "stage": build.StagingAuthURL, + "staging": build.ProductionAuthURL, + "stage": build.ProductionAuthURL, } type options struct { diff --git a/pkg/cmd/serviceaccount/create/create.go b/pkg/cmd/serviceaccount/create/create.go index c597a819d..660db93e2 100644 --- a/pkg/cmd/serviceaccount/create/create.go +++ b/pkg/cmd/serviceaccount/create/create.go @@ -18,7 +18,7 @@ import ( "github.com/redhat-developer/app-services-cli/pkg/core/logging" "github.com/redhat-developer/app-services-cli/pkg/shared/factory" - svcacctmgmtclient "github.com/redhat-developer/app-services-sdk-go/serviceaccountmgmt/apiv1/client" + kafkamgmtclient "github.com/redhat-developer/app-services-sdk-go/kafkamgmt/apiv1/client" "github.com/AlecAivazis/survey/v2" "github.com/spf13/cobra" @@ -127,12 +127,17 @@ func runCreate(opts *options) error { spinner.SetSuffix(opts.localizer.MustLocalize("serviceAccount.create.log.info.creating")) spinner.Start() // create the service account - serviceAccountPayload := svcacctmgmtclient.ServiceAccountCreateRequestData{Name: opts.shortDescription} + serviceAccountPayload := kafkamgmtclient.ServiceAccountRequest{Name: opts.shortDescription} + + providerUrls, err := svcaccountcmdutil.GetProvidersDetails(conn, opts.Context) + if err != nil { + return err + } serviceacct, httpRes, err := conn.API(). ServiceAccountMgmt(). CreateServiceAccount(opts.Context). - ServiceAccountCreateRequestData(serviceAccountPayload). + ServiceAccountRequest(serviceAccountPayload). Execute() spinner.Stop() @@ -148,8 +153,8 @@ func runCreate(opts *options) error { creds := &credentials.Credentials{ ClientID: serviceacct.GetClientId(), - ClientSecret: serviceacct.GetSecret(), - TokenURL: conn.API().GetConfig().AuthURL.String() + "/protocol/openid-connect/token", + ClientSecret: serviceacct.GetClientSecret(), + TokenURL: providerUrls.GetTokenUrl(), } // save the credentials to a file diff --git a/pkg/cmd/serviceaccount/delete/delete.go b/pkg/cmd/serviceaccount/delete/delete.go index a83962cdb..10c1aa22f 100644 --- a/pkg/cmd/serviceaccount/delete/delete.go +++ b/pkg/cmd/serviceaccount/delete/delete.go @@ -78,7 +78,7 @@ func runDelete(opts *options) (err error) { return err } - _, httpRes, err := conn.API().ServiceAccountMgmt().GetServiceAccount(opts.Context, opts.id).Execute() + _, httpRes, err := conn.API().ServiceAccountMgmt().GetServiceAccountById(opts.Context, opts.id).Execute() if httpRes != nil { defer httpRes.Body.Close() } @@ -118,7 +118,7 @@ func deleteServiceAccount(opts *options) error { return err } - httpRes, err := conn.API().ServiceAccountMgmt().DeleteServiceAccount(opts.Context, opts.id).Execute() + _, httpRes, err := conn.API().ServiceAccountMgmt().DeleteServiceAccountById(opts.Context, opts.id).Execute() if httpRes != nil { defer httpRes.Body.Close() } diff --git a/pkg/cmd/serviceaccount/describe/describe.go b/pkg/cmd/serviceaccount/describe/describe.go index a2000bccb..c4e9d01ed 100644 --- a/pkg/cmd/serviceaccount/describe/describe.go +++ b/pkg/cmd/serviceaccount/describe/describe.go @@ -68,7 +68,7 @@ func runDescribe(opts *options) error { api := conn.API() - res, httpRes, err := api.ServiceAccountMgmt().GetServiceAccount(opts.Context, opts.id).Execute() + res, httpRes, err := api.ServiceAccountMgmt().GetServiceAccountById(opts.Context, opts.id).Execute() if httpRes != nil { defer httpRes.Body.Close() } diff --git a/pkg/cmd/serviceaccount/list/list.go b/pkg/cmd/serviceaccount/list/list.go index 25c4667a8..cb52acefc 100644 --- a/pkg/cmd/serviceaccount/list/list.go +++ b/pkg/cmd/serviceaccount/list/list.go @@ -2,8 +2,6 @@ package list import ( "context" - "fmt" - "time" "github.com/redhat-developer/app-services-cli/pkg/core/cmdutil/flagutil" "github.com/redhat-developer/app-services-cli/pkg/core/config" @@ -12,8 +10,7 @@ import ( "github.com/redhat-developer/app-services-cli/pkg/core/localize" "github.com/redhat-developer/app-services-cli/pkg/core/logging" "github.com/redhat-developer/app-services-cli/pkg/shared/factory" - svcacctmgmtclient "github.com/redhat-developer/app-services-sdk-go/serviceaccountmgmt/apiv1/client" - + kafkamgmtclient "github.com/redhat-developer/app-services-sdk-go/kafkamgmt/apiv1/client" "github.com/spf13/cobra" ) @@ -77,11 +74,12 @@ func runList(opts *options) (err error) { return err } - serviceaccounts, _, err := conn.API().ServiceAccountMgmt().GetServiceAccounts(opts.Context).Execute() + res, _, err := conn.API().ServiceAccountMgmt().GetServiceAccounts(opts.Context).Execute() if err != nil { return err } + serviceaccounts := res.GetItems() if len(serviceaccounts) == 0 && opts.output == "" { opts.Logger.Info(opts.localizer.MustLocalize("serviceAccount.list.log.info.noneFound")) return nil @@ -93,23 +91,22 @@ func runList(opts *options) (err error) { rows := mapResponseItemsToRows(serviceaccounts) dump.Table(outStream, rows) default: - return dump.Formatted(opts.IO.Out, opts.output, serviceaccounts) + return dump.Formatted(opts.IO.Out, opts.output, res) } return nil } -func mapResponseItemsToRows(svcAccts []svcacctmgmtclient.ServiceAccountData) []svcAcctRow { +func mapResponseItemsToRows(svcAccts []kafkamgmtclient.ServiceAccountListItem) []svcAcctRow { rows := make([]svcAcctRow, len(svcAccts)) for i, sa := range svcAccts { - row := svcAcctRow{ ID: sa.GetId(), Name: sa.GetName(), ClientID: sa.GetClientId(), Owner: sa.GetCreatedBy(), - CreatedAt: unixTimestampToUTC(sa.GetCreatedAt()), + CreatedAt: sa.GetCreatedAt().String(), } rows[i] = row @@ -117,9 +114,3 @@ func mapResponseItemsToRows(svcAccts []svcacctmgmtclient.ServiceAccountData) []s return rows } - -// unixTimestampToUTC converts a unix timestamp to the corresponding local Time -func unixTimestampToUTC(timestamp int64) string { - localTime := time.Unix(timestamp, 0) - return fmt.Sprint(localTime) -} diff --git a/pkg/cmd/serviceaccount/resetcredentials/reset_credentials.go b/pkg/cmd/serviceaccount/resetcredentials/reset_credentials.go index 2bb0bf51d..c7aa5726c 100644 --- a/pkg/cmd/serviceaccount/resetcredentials/reset_credentials.go +++ b/pkg/cmd/serviceaccount/resetcredentials/reset_credentials.go @@ -17,7 +17,7 @@ import ( "github.com/redhat-developer/app-services-cli/pkg/core/localize" "github.com/redhat-developer/app-services-cli/pkg/core/logging" "github.com/redhat-developer/app-services-cli/pkg/shared/factory" - svcacctmgmtclient "github.com/redhat-developer/app-services-sdk-go/serviceaccountmgmt/apiv1/client" + kafkamgmtclient "github.com/redhat-developer/app-services-sdk-go/kafkamgmt/apiv1/client" "github.com/AlecAivazis/survey/v2" "github.com/spf13/cobra" @@ -107,19 +107,16 @@ func runResetCredentials(opts *options) (err error) { api := conn.API() - if opts.id != "" { - _, httpRes, newErr := api.ServiceAccountMgmt().GetServiceAccount(opts.Context, opts.id).Execute() - if httpRes != nil { - defer httpRes.Body.Close() - } - if newErr != nil { - return newErr - } + _, httpRes, err := api.ServiceAccountMgmt().GetServiceAccountById(opts.Context, opts.id).Execute() + if httpRes != nil { + defer httpRes.Body.Close() + } + if err != nil { + return err } if opts.interactive { - err = runInteractivePrompt(opts) if err != nil { return err @@ -159,10 +156,12 @@ func runResetCredentials(opts *options) (err error) { opts.Logger.Info(icon.SuccessPrefix(), opts.localizer.MustLocalize("serviceAccount.resetCredentials.log.info.resetSuccess", localize.NewEntry("ID", updatedServiceAccount.GetId()))) + providerUrls, err := svcaccountcmdutil.GetProvidersDetails(conn, opts.Context) + creds := &credentials.Credentials{ ClientID: updatedServiceAccount.GetClientId(), - ClientSecret: updatedServiceAccount.GetSecret(), - TokenURL: conn.API().GetConfig().AuthURL.String() + "/protocol/openid-connect/token", + ClientSecret: updatedServiceAccount.GetClientSecret(), + TokenURL: providerUrls.GetTokenUrl(), } // save the credentials to a file @@ -179,7 +178,7 @@ func runResetCredentials(opts *options) (err error) { return nil } -func resetCredentials(opts *options) (*svcacctmgmtclient.ServiceAccountData, error) { +func resetCredentials(opts *options) (*kafkamgmtclient.ServiceAccount, error) { conn, err := opts.Connection() if err != nil { return nil, err @@ -190,7 +189,7 @@ func resetCredentials(opts *options) (*svcacctmgmtclient.ServiceAccountData, err opts.Logger.Debug(opts.localizer.MustLocalize("serviceAccount.resetCredentials.log.debug.resettingCredentials", localize.NewEntry("ID", opts.id))) - serviceacct, httpRes, err := api.ServiceAccountMgmt().ResetServiceAccountSecret(opts.Context, opts.id).Execute() + serviceacct, httpRes, err := api.ServiceAccountMgmt().ResetServiceAccountCreds(opts.Context, opts.id).Execute() if httpRes != nil { defer httpRes.Body.Close() } diff --git a/pkg/cmd/serviceaccount/svcaccountcmdutil/svcaccount_util.go b/pkg/cmd/serviceaccount/svcaccountcmdutil/svcaccount_util.go index a7208dbcd..a2f953d26 100644 --- a/pkg/cmd/serviceaccount/svcaccountcmdutil/svcaccount_util.go +++ b/pkg/cmd/serviceaccount/svcaccountcmdutil/svcaccount_util.go @@ -1,9 +1,30 @@ package svcaccountcmdutil import ( + "context" + "github.com/redhat-developer/app-services-cli/pkg/cmd/serviceaccount/svcaccountcmdutil/credentials" + "github.com/redhat-developer/app-services-cli/pkg/shared/connection" + + kafkamgmtclient "github.com/redhat-developer/app-services-sdk-go/kafkamgmt/apiv1/client" ) var ( CredentialsOutputFormats = []string{credentials.EnvFormat, credentials.JSONFormat, credentials.PropertiesFormat, credentials.SecretFormat} ) + +// Method fetches authentication details for providers +func GetProvidersDetails(conn connection.Connection, context context.Context) (*kafkamgmtclient.SsoProvider, error) { + providers, httpRes, err := conn.API(). + ServiceAccountMgmt().GetSsoProviders(context).Execute() + + if httpRes != nil { + defer httpRes.Body.Close() + } + + if err != nil { + return nil, err + } + + return &providers, err +} diff --git a/pkg/core/cmdutil/flagutil/completions.go b/pkg/core/cmdutil/flagutil/completions.go index d7ae8231b..b297a2265 100644 --- a/pkg/core/cmdutil/flagutil/completions.go +++ b/pkg/core/cmdutil/flagutil/completions.go @@ -69,11 +69,13 @@ func RegisterServiceAccountCompletionFunc(cmd *cobra.Command, f *factory.Factory return cachedServiceAccounts, directive } - serviceAccounts, _, err := conn.API().ServiceAccountMgmt().GetServiceAccounts(cmd.Context()).Execute() - if err != nil || len(serviceAccounts) == 0 { + serviceAccountResults, _, err := conn.API().ServiceAccountMgmt().GetServiceAccounts(cmd.Context()).Execute() + if err != nil || len(serviceAccountResults.GetItems()) == 0 { return emptyList, directive } + serviceAccounts := serviceAccountResults.GetItems() + for _, serviceAcct := range serviceAccounts { cachedServiceAccounts = append(cachedServiceAccounts, serviceAcct.GetClientId()) } diff --git a/pkg/shared/cluster/connect.go b/pkg/shared/cluster/connect.go index 54ededca3..5cd6e2f8b 100644 --- a/pkg/shared/cluster/connect.go +++ b/pkg/shared/cluster/connect.go @@ -17,8 +17,7 @@ import ( "github.com/AlecAivazis/survey/v2" "github.com/golang-jwt/jwt/v4" "github.com/redhat-developer/app-services-cli/internal/build" - svcacctmgmtclient "github.com/redhat-developer/app-services-sdk-go/serviceaccountmgmt/apiv1/client" - + kafkamgmtclient "github.com/redhat-developer/app-services-sdk-go/kafkamgmt/apiv1/client" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -68,7 +67,7 @@ func (api *KubernetesClusterAPIImpl) ExecuteConnect(connectOpts *v1alpha.Connect localize.NewEntry("Namespace", color.Info(currentNamespace)), localize.NewEntry("ServiceAccountSecretName", color.Info(constants.ServiceAccountSecretName)))) - if !connectOpts.ForceCreationWithoutAsk { + if connectOpts.ForceCreationWithoutAsk == false { var shouldContinue bool confirm := &survey.Confirm{ Message: cliOpts.Localizer.MustLocalize("cluster.kubernetes.input.confirm.message"), @@ -209,7 +208,7 @@ func (c *KubernetesClusterAPIImpl) createServiceAccountSecretIfNeeded(namespace }, StringData: map[string]string{ "client-id": serviceAcct.GetClientId(), - "client-secret": serviceAcct.GetSecret(), + "client-secret": serviceAcct.GetClientSecret(), }, } @@ -227,13 +226,13 @@ func (c *KubernetesClusterAPIImpl) createServiceAccountSecretIfNeeded(namespace } // createServiceAccount creates a service account -func (c *KubernetesClusterAPIImpl) createServiceAccount(ctx context.Context, cliOpts *v1alpha.CommandEnvironment) (*svcacctmgmtclient.ServiceAccountData, error) { +func (c *KubernetesClusterAPIImpl) createServiceAccount(ctx context.Context, cliOpts *v1alpha.CommandEnvironment) (*kafkamgmtclient.ServiceAccount, error) { t := time.Now() api := cliOpts.Connection.API() - serviceAcct := &svcacctmgmtclient.ServiceAccountCreateRequestData{Name: fmt.Sprintf("rhoascli-%v", t.Unix())} + serviceAcct := &kafkamgmtclient.ServiceAccountRequest{Name: fmt.Sprintf("rhoascli-%v", t.Unix())} req := api.ServiceAccountMgmt().CreateServiceAccount(ctx) - req = req.ServiceAccountCreateRequestData(*serviceAcct) + req = req.ServiceAccountRequest(*serviceAcct) serviceAcctRes, httpRes, err := req.Execute() if httpRes != nil { defer httpRes.Body.Close() diff --git a/pkg/shared/connection/api/api.go b/pkg/shared/connection/api/api.go index 3d5c2ebf4..3266c02bf 100644 --- a/pkg/shared/connection/api/api.go +++ b/pkg/shared/connection/api/api.go @@ -14,14 +14,13 @@ import ( kafkamgmtclient "github.com/redhat-developer/app-services-sdk-go/kafkamgmt/apiv1/client" registryinstanceclient "github.com/redhat-developer/app-services-sdk-go/registryinstance/apiv1internal/client" registrymgmtclient "github.com/redhat-developer/app-services-sdk-go/registrymgmt/apiv1/client" - svcacctmgmtclient "github.com/redhat-developer/app-services-sdk-go/serviceaccountmgmt/apiv1/client" ) type API interface { KafkaMgmt() kafkamgmtclient.DefaultApi ServiceRegistryMgmt() registrymgmtclient.RegistriesApi ConnectorsMgmt() connectormgmtclient.APIClient - ServiceAccountMgmt() svcacctmgmtclient.ServiceAccountsApi + ServiceAccountMgmt() kafkamgmtclient.SecurityApi KafkaAdmin(instanceID string) (*kafkainstanceclient.APIClient, *kafkamgmtclient.KafkaRequest, error) ServiceRegistryInstance(instanceID string) (*registryinstanceclient.APIClient, *registrymgmtclient.Registry, error) AccountMgmt() amsclient.AppServicesApi @@ -33,7 +32,6 @@ type API interface { type Config struct { AccessToken string ApiURL *url.URL - AuthURL *url.URL ConsoleURL *url.URL UserAgent string HTTPClient *http.Client diff --git a/pkg/shared/connection/api/defaultapi/default_client.go b/pkg/shared/connection/api/defaultapi/default_client.go index 401224e60..a119e4d52 100644 --- a/pkg/shared/connection/api/defaultapi/default_client.go +++ b/pkg/shared/connection/api/defaultapi/default_client.go @@ -28,9 +28,6 @@ import ( registrymgmt "github.com/redhat-developer/app-services-sdk-go/registrymgmt/apiv1" registrymgmtclient "github.com/redhat-developer/app-services-sdk-go/registrymgmt/apiv1/client" "golang.org/x/oauth2" - - svcacctmgmt "github.com/redhat-developer/app-services-sdk-go/serviceaccountmgmt/apiv1" - svcacctmgmtclient "github.com/redhat-developer/app-services-sdk-go/serviceaccountmgmt/apiv1/client" ) // defaultAPI is a type which defines a number of API creator functions @@ -76,16 +73,16 @@ func (a *defaultAPI) ServiceRegistryMgmt() registrymgmtclient.RegistriesApi { } // ServiceAccountMgmt return a new Service Account Management API client instance -func (a *defaultAPI) ServiceAccountMgmt() svcacctmgmtclient.ServiceAccountsApi { +func (a *defaultAPI) ServiceAccountMgmt() kafkamgmtclient.SecurityApi { tc := a.CreateOAuthTransport(a.AccessToken) - client := svcacctmgmt.NewAPIClient(&svcacctmgmt.Config{ - BaseURL: a.AuthURL.String(), + client := kafkamgmt.NewAPIClient(&kafkamgmt.Config{ + BaseURL: a.ApiURL.String(), Debug: a.Logger.DebugEnabled(), HTTPClient: tc, UserAgent: a.UserAgent, }) - return client.ServiceAccountsApi + return client.SecurityApi } // KafkaAdmin returns a new Kafka Admin API client instance, with the Kafka configuration object @@ -106,16 +103,16 @@ func (a *defaultAPI) KafkaAdmin(instanceID string) (*kafkainstanceclient.APIClie switch kafkaStatus { case svcstatus.StatusProvisioning, svcstatus.StatusAccepted: - err = fmt.Errorf(`kafka instance "%v" is not ready yet`, kafkaInstance.GetName()) + err = fmt.Errorf(`Kafka instance "%v" is not ready yet`, kafkaInstance.GetName()) return nil, nil, err case svcstatus.StatusFailed: - err = fmt.Errorf(`kafka instance "%v" has failed`, kafkaInstance.GetName()) + err = fmt.Errorf(`Kafka instance "%v" has failed`, kafkaInstance.GetName()) return nil, nil, err case svcstatus.StatusDeprovision: - err = fmt.Errorf(`kafka instance "%v" is being deprovisioned`, kafkaInstance.GetName()) + err = fmt.Errorf(`Kafka instance "%v" is being deprovisioned`, kafkaInstance.GetName()) return nil, nil, err case svcstatus.StatusDeleting: - err = fmt.Errorf(`kafka instance "%v" is being deleted`, kafkaInstance.GetName()) + err = fmt.Errorf(`Kafka instance "%v" is being deleted`, kafkaInstance.GetName()) return nil, nil, err } diff --git a/pkg/shared/connection/kcconnection/builder.go b/pkg/shared/connection/kcconnection/builder.go index 82027f7b7..cb7ca1db4 100644 --- a/pkg/shared/connection/kcconnection/builder.go +++ b/pkg/shared/connection/kcconnection/builder.go @@ -229,7 +229,6 @@ func (b *ConnectionBuilder) BuildContext(ctx context.Context) (connection *Conne consoleURL: consoleURL, scopes: scopes, apiURL: apiURL, - authURL: authURL, defaultHTTPClient: client, keycloakClient: keycloak, Token: &tkn, diff --git a/pkg/shared/connection/kcconnection/keycloak_connection.go b/pkg/shared/connection/kcconnection/keycloak_connection.go index 4c55100d1..febddd9cc 100644 --- a/pkg/shared/connection/kcconnection/keycloak_connection.go +++ b/pkg/shared/connection/kcconnection/keycloak_connection.go @@ -33,7 +33,6 @@ type Connection struct { scopes []string keycloakClient gocloak.GoCloak apiURL *url.URL - authURL *url.URL consoleURL *url.URL defaultRealm string logger logging.Logger @@ -111,7 +110,6 @@ func (c *Connection) API() api.API { UserAgent: build.DefaultUserAgentPrefix + build.Version, AccessToken: c.Token.AccessToken, ApiURL: c.apiURL, - AuthURL: c.authURL, ConsoleURL: c.consoleURL, Logger: c.logger, })