-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce add
family of commands for company IAM
#140
Conversation
docs/30_commands.md
Outdated
@@ -210,15 +223,17 @@ Available flags for the command: | |||
- `--insecure-skip-tls-verify`, to disallow the check the validity of the certificate of the remote endpoint | |||
- `--context`, to specify a different context from the currently selected one | |||
- `--company-id`, to set the ID of the desired Company | |||
- `--output`, optional flag to save the service account json description in a file at the provided path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description? Are saved the credentials?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed the docs to better reflect what we are saving
} | ||
|
||
options.CreateNewGroupFlags(cmd.Flags()) | ||
err := cmd.RegisterFlagCompletionFunc("role", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those roles should be dynamic? There is a role api, which could be used to dynamically configure this completion. What do you think?
In the future, probably the roles will change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will postpone the feature until a proper caching mechanism is in place for the various calls, because making an http call for every autocomplete try is not the best experience...
} | ||
|
||
func createNewGroup(ctx context.Context, client *client.APIClient, companyID, groupName string, role resources.ServiceAccountRole) error { | ||
if !resources.IsValidServiceAccountRole(role) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this check is static
} | ||
|
||
options.AddNewUserFlags(cmd.Flags()) | ||
err := cmd.RegisterFlagCompletionFunc("role", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here, static completion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What this PR is for?
This PR will introduce the new
add
family of command forcompany iam
.Those command are for: