Skip to content

Commit c01f511

Browse files
authored
Merge pull request #283 from DivyanshuVortex/fix/typos
fix(typo): microkcs CLI instead of microkcs CLI
2 parents 7081036 + 73e5be9 commit c01f511

10 files changed

Lines changed: 35 additions & 35 deletions

File tree

cmd/import.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func NewImportCommand(globalClientOpts *connectors.ClientOptions) *cobra.Command
7878

7979
oauthToken, err = kc.ConnectAndGetToken()
8080
if err != nil {
81-
fmt.Printf("Got error when invoking Keycloack client: %s", err)
81+
fmt.Printf("Got error when invoking Keycloak client: %s", err)
8282
os.Exit(1)
8383
}
8484
//fmt.Printf("Retrieve OAuthToken: %s", oauthToken)

cmd/importURL.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ func NewImportURLCommand(globalClientOpts *connectors.ClientOptions) *cobra.Comm
5757
os.Exit(1)
5858
}
5959

60-
var oauthToken string = "unauthentifed-token"
60+
var oauthToken string = "unauthenticated-token"
6161
if keycloakURL != "null" {
6262
// If Keycloak is enabled, retrieve an OAuth token using Keycloak Client.
6363
kc := connectors.NewKeycloakClient(keycloakURL, globalClientOpts.ClientId, globalClientOpts.ClientSecret)
6464

6565
oauthToken, err = kc.ConnectAndGetToken()
6666
if err != nil {
67-
fmt.Printf("Got error when invoking Keycloack client: %s", err)
67+
fmt.Printf("Got error when invoking Keycloak client: %s", err)
6868
os.Exit(1)
6969
}
7070
//fmt.Printf("Retrieve OAuthToken: %s", oauthToken)
@@ -81,7 +81,7 @@ func NewImportURLCommand(globalClientOpts *connectors.ClientOptions) *cobra.Comm
8181
}
8282

8383
if localConfig == nil {
84-
fmt.Println("Please login to perform opertion...")
84+
fmt.Println("Please login to perform operation...")
8585
return
8686
}
8787

cmd/login.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func NewLoginCommand(globalClientOpts *connectors.ClientOptions) *cobra.Command
4242
Long: "Login into Microcks instance",
4343
Example: `microcks login http://locahost:8080
4444
45-
# Provide name to your logged in context (Defautl context name is server name)
45+
# Provide name to your logged in context (Default context name is server name)
4646
microcks login http://localhost:8080 --name
4747
4848
# Provide username and password as flags
@@ -61,7 +61,7 @@ microcks login http://localhost:8080 --sso --sso-launch-browser=false
6161
ctx := cmd.Context()
6262
var server string
6363

64-
//Chekc if server name is provided or not
64+
//Check if server name is provided or not
6565
if len(args) != 1 {
6666
cmd.HelpFunc()(cmd, args)
6767
os.Exit(1)
@@ -104,14 +104,14 @@ microcks login http://localhost:8080 --sso --sso-launch-browser=false
104104

105105
if keycloakUrl == "null" {
106106
localConfig.UpsertServer(config.Server{
107-
Server: server,
108-
InsecureTLS: true,
109-
KeycloackEnable: false,
107+
Server: server,
108+
InsecureTLS: true,
109+
KeycloakEnable: false,
110110
})
111111
fmt.Print("No login required...\n")
112112
} else {
113113
if !sso {
114-
//Chek for the enviroment variables
114+
//Check for the enviroment variables
115115
clientID := os.Getenv("MICROCKS_CLIENT_ID")
116116
clientSecret := os.Getenv("MICROCKS_CLIENT_SECRET")
117117

@@ -145,13 +145,13 @@ microcks login http://localhost:8080 --sso --sso-launch-browser=false
145145
fmt.Printf("'%s' logged in successfully\n", em)
146146

147147
localConfig.UpsertServer(config.Server{
148-
Server: server,
149-
InsecureTLS: true,
150-
KeycloackEnable: true,
148+
Server: server,
149+
InsecureTLS: true,
150+
KeycloakEnable: true,
151151
})
152152
}
153153

154-
localConfig.UpserAuth(authCfg)
154+
localConfig.UpsertAuth(authCfg)
155155

156156
localConfig.UpsertUser(config.User{
157157
Name: server,

cmd/start.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ microcks start --name [name of you container/instance]`,
110110
server := fmt.Sprintf("http://localhost:%s", instance.Port)
111111

112112
localConfig.UpsertServer(config.Server{
113-
Name: name,
114-
Server: server,
115-
InsecureTLS: true,
116-
KeycloackEnable: false,
113+
Name: name,
114+
Server: server,
115+
InsecureTLS: true,
116+
KeycloakEnable: false,
117117
})
118118

119-
localConfig.UpserAuth(config.Auth{
119+
localConfig.UpsertAuth(config.Auth{
120120
Server: server,
121121
ClientId: "",
122122
ClientSecret: "",

cmd/test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ func NewTestCommand(globalClientOpts *connectors.ClientOptions) *cobra.Command {
125125
os.Exit(1)
126126
}
127127

128-
var oauthToken string = "unauthentifed-token"
128+
var oauthToken string = "unauthenticated-token"
129129
if keycloakURL != "null" {
130130
// If Keycloak is enabled, retrieve an OAuth token using Keycloak Client.
131131
kc := connectors.NewKeycloakClient(keycloakURL, globalClientOpts.ClientId, globalClientOpts.ClientSecret)
132132

133133
oauthToken, err = kc.ConnectAndGetToken()
134134
if err != nil {
135-
fmt.Printf("Got error when invoking Keycloack client: %s", err)
135+
fmt.Printf("Got error when invoking Keycloak client: %s", err)
136136
os.Exit(1)
137137
}
138138
//fmt.Printf("Retrieve OAuthToken: %s", oauthToken)
@@ -149,7 +149,7 @@ func NewTestCommand(globalClientOpts *connectors.ClientOptions) *cobra.Command {
149149
}
150150

151151
if localConfig == nil {
152-
fmt.Println("Please login to perform opertion...")
152+
fmt.Println("Please login to perform operation...")
153153
return
154154
}
155155

cmd/version.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import (
2525
func NewVersionCommand() *cobra.Command {
2626
var command = &cobra.Command{
2727
Use: "version",
28-
Short: "Print the version number of microkcs CLI",
29-
Long: `Print the version number of microkcs CLI`,
28+
Short: "Print the version number of microcks CLI",
29+
Long: `Print the version number of microcks CLI`,
3030
Run: func(cmd *cobra.Command, args []string) {
3131
fmt.Printf("Microcks-CLI %s\n", version.Version)
3232
},

documentation/cmd/login.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Log in to a Microcks instance using username/password or SSO. Creates or updates
66
# Login to microcks using a username and password
77
microcks login http://locahost:8080
88

9-
# Provide name to your logged in context (Defautl context name is server name)
9+
# Provide name to your logged in context (Default context name is server name)
1010
microcks login http://localhost:8080 --name
1111

1212
# Provide username and password as flags

pkg/config/localconfig.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ type User struct {
3939
}
4040

4141
type Server struct {
42-
Name string `yaml:"name"`
43-
Server string `yaml:"server"`
44-
InsecureTLS bool `yaml:"insecureTLS"`
45-
KeycloackEnable bool `yaml:"keycloakEnable"`
42+
Name string `yaml:"name"`
43+
Server string `yaml:"server"`
44+
InsecureTLS bool `yaml:"insecureTLS"`
45+
KeycloakEnable bool `yaml:"keycloakEnable"`
4646
}
4747

4848
type Instance struct {
@@ -348,7 +348,7 @@ func (l *LocalConfig) GetAuth(server string) (*Auth, error) {
348348
return nil, fmt.Errorf("Auth for '%s' is undifined", server)
349349
}
350350

351-
func (l *LocalConfig) UpserAuth(auth Auth) {
351+
func (l *LocalConfig) UpsertAuth(auth Auth) {
352352
for i, a := range l.Auths {
353353
if a.Server == auth.Server {
354354
l.Auths[i] = auth

pkg/connectors/keycloak_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func (c *keycloakClient) ConnectAndGetTokenAndRefreshToken(username, password st
183183
}
184184

185185
authToken := openIDResp["access_token"].(string)
186-
refershToken := openIDResp["refresh_token"].(string)
186+
refreshToken := openIDResp["refresh_token"].(string)
187187

188-
return authToken, refershToken, nil
188+
return authToken, refreshToken, nil
189189
}

pkg/connectors/microcks_client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func NewClient(opts ClientOptions) (MicrocksClient, error) {
124124
return nil, err
125125
}
126126
c.ServerAddr = configCtx.Server.Server
127-
c.Insecure = configCtx.Server.KeycloackEnable
127+
c.Insecure = configCtx.Server.KeycloakEnable
128128
c.InsecureTLS = configCtx.Server.InsecureTLS
129129
c.AuthToken = configCtx.User.AuthToken
130130
c.RefreshToken = configCtx.User.RefreshToken
@@ -338,7 +338,7 @@ func (c *microcksClient) CreateTestResult(serviceID string, testEndpoint string,
338338
if len(operationsHeaders) > 0 && ensureValidOperationsHeaders(operationsHeaders) {
339339
input += (", \"operationsHeaders\": " + operationsHeaders)
340340
}
341-
if len(oAuth2Context) > 0 && ensureValieOAuth2Context(oAuth2Context) {
341+
if len(oAuth2Context) > 0 && ensureValidOAuth2Context(oAuth2Context) {
342342
input += (", \"oAuth2Context\": " + oAuth2Context)
343343
}
344344

@@ -557,7 +557,7 @@ func ensureValidOperationsHeaders(operationsHeaders string) bool {
557557
return true
558558
}
559559

560-
func ensureValieOAuth2Context(oAuth2Context string) bool {
560+
func ensureValidOAuth2Context(oAuth2Context string) bool {
561561
var oContext = OAuth2ClientContext{}
562562
err := json.Unmarshal([]byte(oAuth2Context), &oContext)
563563
if err != nil {

0 commit comments

Comments
 (0)