fix(cluster connect): display service account credentials#1237
fix(cluster connect): display service account credentials#1237rkpattnaik780 merged 2 commits intomainfrom
Conversation
craicoverflow
left a comment
There was a problem hiding this comment.
All good, but we should not print client secret IMO.
pkg/cluster/connect.go
Outdated
| cliOpts.Logger.Info(cliOpts.Localizer.MustLocalize("cluster.kubernetes.createSASecret.log.info.createSuccess", | ||
| localize.NewEntry("Name", createdSecret.Name), | ||
| localize.NewEntry("ClientID", serviceAcct.GetClientId()), | ||
| localize.NewEntry("ClientSecret", serviceAcct.GetClientSecret()), |
There was a problem hiding this comment.
I don't think we should print the client secret for any reason. The CLI user only needs the client ID for ACL operations.
There was a problem hiding this comment.
Though it may be irrelevant for cluster context, I think it will be useful if user needs a svc-account created like this for other purposes. wdyt?
There was a problem hiding this comment.
It's risky, it is printing a password that gives access to data. Default to safe, if people need it we can propose another solution. This is why the service-account commands do not print anything and you must specify a file.
There was a problem hiding this comment.
Okay. Taking it down.
| Service Account Secret "{{.Name}}" created successfully | ||
|
|
||
| Client ID: {{.ClientID}} | ||
| Client Secret: {{.ClientSecret}} |
There was a problem hiding this comment.
I think we can omit that
|
|
||
| Execute the following command to grant access to the service-account using rhoas cli | ||
|
|
||
| rhoas kafka acl grant-access --producer --consumer --service-account {{.ClientID}} --topic "*" --group "*" |
There was a problem hiding this comment.
If we externalize this as a variable, we could highlight it in colour to make it easier to identify and keep separate from text.
There was a problem hiding this comment.
Or simply indent it to differentiate.
Verification Steps
Type of change
Checklist