From 04d620f158e562734fb083a7f67c92f68f77b5bb Mon Sep 17 00:00:00 2001 From: DivyanshuVorrtex Date: Tue, 5 May 2026 04:09:39 +0000 Subject: [PATCH 1/3] chores Signed-off-by: DivyanshuVorrtex --- cmd/version.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/version.go b/cmd/version.go index 6ce71635..39897784 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -25,8 +25,8 @@ import ( func NewVersionCommand() *cobra.Command { var command = &cobra.Command{ Use: "version", - Short: "Print the version number of microkcs CLI", - Long: `Print the version number of microkcs CLI`, + Short: "Print the version number of microcks CLI", + Long: `Print the version number of microcks CLI`, Run: func(cmd *cobra.Command, args []string) { fmt.Printf("Microcks-CLI %s\n", version.Version) }, From daa238635b34669060dedfcf30554f5d99061f07 Mon Sep 17 00:00:00 2001 From: DivyanshuVorrtex Date: Tue, 5 May 2026 04:48:00 +0000 Subject: [PATCH 2/3] add more typo fixs Signed-off-by: DivyanshuVorrtex --- cmd/import.go | 2 +- cmd/importURL.go | 6 +++--- cmd/login.go | 20 ++++++++++---------- cmd/start.go | 10 +++++----- cmd/test.go | 6 +++--- documentation/cmd/login.md | 2 +- pkg/config/localconfig.go | 10 +++++----- pkg/connectors/keycloak_client.go | 4 ++-- pkg/connectors/microcks_client.go | 6 +++--- 9 files changed, 33 insertions(+), 33 deletions(-) diff --git a/cmd/import.go b/cmd/import.go index 27471516..c1a74c4c 100644 --- a/cmd/import.go +++ b/cmd/import.go @@ -78,7 +78,7 @@ func NewImportCommand(globalClientOpts *connectors.ClientOptions) *cobra.Command oauthToken, err = kc.ConnectAndGetToken() if err != nil { - fmt.Printf("Got error when invoking Keycloack client: %s", err) + fmt.Printf("Got error when invoking Keycloak client: %s", err) os.Exit(1) } //fmt.Printf("Retrieve OAuthToken: %s", oauthToken) diff --git a/cmd/importURL.go b/cmd/importURL.go index 442e7e24..69c32e8e 100644 --- a/cmd/importURL.go +++ b/cmd/importURL.go @@ -57,14 +57,14 @@ func NewImportURLCommand(globalClientOpts *connectors.ClientOptions) *cobra.Comm os.Exit(1) } - var oauthToken string = "unauthentifed-token" + var oauthToken string = "unauthenticated-token" if keycloakURL != "null" { // If Keycloak is enabled, retrieve an OAuth token using Keycloak Client. kc := connectors.NewKeycloakClient(keycloakURL, globalClientOpts.ClientId, globalClientOpts.ClientSecret) oauthToken, err = kc.ConnectAndGetToken() if err != nil { - fmt.Printf("Got error when invoking Keycloack client: %s", err) + fmt.Printf("Got error when invoking Keycloak client: %s", err) os.Exit(1) } //fmt.Printf("Retrieve OAuthToken: %s", oauthToken) @@ -81,7 +81,7 @@ func NewImportURLCommand(globalClientOpts *connectors.ClientOptions) *cobra.Comm } if localConfig == nil { - fmt.Println("Please login to perform opertion...") + fmt.Println("Please login to perform operation...") return } diff --git a/cmd/login.go b/cmd/login.go index 2b624f79..f721d47d 100644 --- a/cmd/login.go +++ b/cmd/login.go @@ -42,7 +42,7 @@ func NewLoginCommand(globalClientOpts *connectors.ClientOptions) *cobra.Command Long: "Login into Microcks instance", Example: `microcks login http://locahost:8080 -# Provide name to your logged in context (Defautl context name is server name) +# Provide name to your logged in context (Default context name is server name) microcks login http://localhost:8080 --name # Provide username and password as flags @@ -61,7 +61,7 @@ microcks login http://localhost:8080 --sso --sso-launch-browser=false ctx := cmd.Context() var server string - //Chekc if server name is provided or not + //Checkc if server name is provided or not if len(args) != 1 { cmd.HelpFunc()(cmd, args) os.Exit(1) @@ -104,14 +104,14 @@ microcks login http://localhost:8080 --sso --sso-launch-browser=false if keycloakUrl == "null" { localConfig.UpsertServer(config.Server{ - Server: server, - InsecureTLS: true, - KeycloackEnable: false, + Server: server, + InsecureTLS: true, + KeycloakEnable: false, }) fmt.Print("No login required...\n") } else { if !sso { - //Chek for the enviroment variables + //Check for the enviroment variables clientID := os.Getenv("MICROCKS_CLIENT_ID") clientSecret := os.Getenv("MICROCKS_CLIENT_SECRET") @@ -145,13 +145,13 @@ microcks login http://localhost:8080 --sso --sso-launch-browser=false fmt.Printf("'%s' logged in successfully\n", em) localConfig.UpsertServer(config.Server{ - Server: server, - InsecureTLS: true, - KeycloackEnable: true, + Server: server, + InsecureTLS: true, + KeycloakEnable: true, }) } - localConfig.UpserAuth(authCfg) + localConfig.UpsertAuth(authCfg) localConfig.UpsertUser(config.User{ Name: server, diff --git a/cmd/start.go b/cmd/start.go index f36c22c6..80446039 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -110,13 +110,13 @@ microcks start --name [name of you container/instance]`, server := fmt.Sprintf("http://localhost:%s", instance.Port) localConfig.UpsertServer(config.Server{ - Name: name, - Server: server, - InsecureTLS: true, - KeycloackEnable: false, + Name: name, + Server: server, + InsecureTLS: true, + KeycloakEnable: false, }) - localConfig.UpserAuth(config.Auth{ + localConfig.UpsertAuth(config.Auth{ Server: server, ClientId: "", ClientSecret: "", diff --git a/cmd/test.go b/cmd/test.go index 1d29a3f0..70ecb4f2 100644 --- a/cmd/test.go +++ b/cmd/test.go @@ -125,14 +125,14 @@ func NewTestCommand(globalClientOpts *connectors.ClientOptions) *cobra.Command { os.Exit(1) } - var oauthToken string = "unauthentifed-token" + var oauthToken string = "unauthenticated-token" if keycloakURL != "null" { // If Keycloak is enabled, retrieve an OAuth token using Keycloak Client. kc := connectors.NewKeycloakClient(keycloakURL, globalClientOpts.ClientId, globalClientOpts.ClientSecret) oauthToken, err = kc.ConnectAndGetToken() if err != nil { - fmt.Printf("Got error when invoking Keycloack client: %s", err) + fmt.Printf("Got error when invoking Keycloak client: %s", err) os.Exit(1) } //fmt.Printf("Retrieve OAuthToken: %s", oauthToken) @@ -149,7 +149,7 @@ func NewTestCommand(globalClientOpts *connectors.ClientOptions) *cobra.Command { } if localConfig == nil { - fmt.Println("Please login to perform opertion...") + fmt.Println("Please login to perform operation...") return } diff --git a/documentation/cmd/login.md b/documentation/cmd/login.md index 099e7c93..0480944e 100644 --- a/documentation/cmd/login.md +++ b/documentation/cmd/login.md @@ -6,7 +6,7 @@ Log in to a Microcks instance using username/password or SSO. Creates or updates # Login to microcks using a username and password microcks login http://locahost:8080 -# Provide name to your logged in context (Defautl context name is server name) +# Provide name to your logged in context (Default context name is server name) microcks login http://localhost:8080 --name # Provide username and password as flags diff --git a/pkg/config/localconfig.go b/pkg/config/localconfig.go index c7546e90..1e5eeda6 100644 --- a/pkg/config/localconfig.go +++ b/pkg/config/localconfig.go @@ -39,10 +39,10 @@ type User struct { } type Server struct { - Name string `yaml:"name"` - Server string `yaml:"server"` - InsecureTLS bool `yaml:"insecureTLS"` - KeycloackEnable bool `yaml:"keycloakEnable"` + Name string `yaml:"name"` + Server string `yaml:"server"` + InsecureTLS bool `yaml:"insecureTLS"` + KeycloakEnable bool `yaml:"keycloakEnable"` } type Instance struct { @@ -348,7 +348,7 @@ func (l *LocalConfig) GetAuth(server string) (*Auth, error) { return nil, fmt.Errorf("Auth for '%s' is undifined", server) } -func (l *LocalConfig) UpserAuth(auth Auth) { +func (l *LocalConfig) UpsertAuth(auth Auth) { for i, a := range l.Auths { if a.Server == auth.Server { l.Auths[i] = auth diff --git a/pkg/connectors/keycloak_client.go b/pkg/connectors/keycloak_client.go index 3c2257b3..5d6aeedd 100644 --- a/pkg/connectors/keycloak_client.go +++ b/pkg/connectors/keycloak_client.go @@ -183,7 +183,7 @@ func (c *keycloakClient) ConnectAndGetTokenAndRefreshToken(username, password st } authToken := openIDResp["access_token"].(string) - refershToken := openIDResp["refresh_token"].(string) + refreshToken := openIDResp["refresh_token"].(string) - return authToken, refershToken, nil + return authToken, refreshToken, nil } diff --git a/pkg/connectors/microcks_client.go b/pkg/connectors/microcks_client.go index 00a2d8cd..f76884b8 100644 --- a/pkg/connectors/microcks_client.go +++ b/pkg/connectors/microcks_client.go @@ -124,7 +124,7 @@ func NewClient(opts ClientOptions) (MicrocksClient, error) { return nil, err } c.ServerAddr = configCtx.Server.Server - c.Insecure = configCtx.Server.KeycloackEnable + c.Insecure = configCtx.Server.KeycloakEnable c.InsecureTLS = configCtx.Server.InsecureTLS c.AuthToken = configCtx.User.AuthToken c.RefreshToken = configCtx.User.RefreshToken @@ -338,7 +338,7 @@ func (c *microcksClient) CreateTestResult(serviceID string, testEndpoint string, if len(operationsHeaders) > 0 && ensureValidOperationsHeaders(operationsHeaders) { input += (", \"operationsHeaders\": " + operationsHeaders) } - if len(oAuth2Context) > 0 && ensureValieOAuth2Context(oAuth2Context) { + if len(oAuth2Context) > 0 && ensureValidOAuth2Context(oAuth2Context) { input += (", \"oAuth2Context\": " + oAuth2Context) } @@ -557,7 +557,7 @@ func ensureValidOperationsHeaders(operationsHeaders string) bool { return true } -func ensureValieOAuth2Context(oAuth2Context string) bool { +func ensureValidOAuth2Context(oAuth2Context string) bool { var oContext = OAuth2ClientContext{} err := json.Unmarshal([]byte(oAuth2Context), &oContext) if err != nil { From 73e5be9b81b3f9837683154264f9ba35303f9759 Mon Sep 17 00:00:00 2001 From: DivyanshuVorrtex Date: Tue, 5 May 2026 04:49:45 +0000 Subject: [PATCH 3/3] chores Signed-off-by: DivyanshuVorrtex --- cmd/login.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/login.go b/cmd/login.go index f721d47d..bd24415f 100644 --- a/cmd/login.go +++ b/cmd/login.go @@ -61,7 +61,7 @@ microcks login http://localhost:8080 --sso --sso-launch-browser=false ctx := cmd.Context() var server string - //Checkc if server name is provided or not + //Check if server name is provided or not if len(args) != 1 { cmd.HelpFunc()(cmd, args) os.Exit(1)