@@ -48,6 +48,7 @@ func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
|
||||
}
|
||||
|
||||
var confirmed bool
|
||||
|
||||
err := huh.NewConfirm().
|
||||
Title(fmt.Sprintf("Delete SCIM configuration %s? This will also remove the associated bridge.", args[0])).
|
||||
Value(&confirmed).
|
||||
@@ -55,6 +56,7 @@ func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !confirmed {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -125,12 +125,15 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
||||
if err := json.Unmarshal(data, &resp); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if resp.Node == nil {
|
||||
return nil, fmt.Errorf("SCIM configuration %s not found", args[0])
|
||||
}
|
||||
|
||||
if resp.Node.Typename != "SCIMConfiguration" {
|
||||
return nil, fmt.Errorf("expected SCIMConfiguration node, got %s", resp.Node.Typename)
|
||||
}
|
||||
|
||||
return &resp.Node.Events, nil
|
||||
},
|
||||
)
|
||||
|
||||
@@ -61,6 +61,7 @@ func NewCmdRegenerateToken(f *cmdutil.Factory) *cobra.Command {
|
||||
}
|
||||
|
||||
var confirmed bool
|
||||
|
||||
err := huh.NewConfirm().
|
||||
Title("Regenerate SCIM token? The current token will be invalidated.").
|
||||
Value(&confirmed).
|
||||
@@ -68,6 +69,7 @@ func NewCmdRegenerateToken(f *cmdutil.Factory) *cobra.Command {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !confirmed {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -152,7 +152,9 @@ func NewCmdView(f *cmdutil.Factory) *cobra.Command {
|
||||
if *flagOutput == cmdutil.OutputJSON {
|
||||
return cmdutil.PrintJSON(f.IOStreams.Out, nil)
|
||||
}
|
||||
|
||||
_, _ = fmt.Fprintln(f.IOStreams.Out, "No SCIM configuration found.")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user