mirror of
https://github.com/openziti/zrok.git
synced 2025-06-26 12:42:18 +02:00
clean up secret access identity 'zrok admin delete secrets-access-identity' (#983)
This commit is contained in:
parent
301bdd643a
commit
a8dd3ec567
@ -3,9 +3,14 @@ package main
|
||||
import (
|
||||
"github.com/openziti/zrok/environment"
|
||||
"github.com/openziti/zrok/rest_client_zrok"
|
||||
"github.com/openziti/zrok/rest_client_zrok/admin"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func init() {
|
||||
adminDeleteCmd.AddCommand(newDeleteSecretsAccessIdentityCommand().cmd)
|
||||
}
|
||||
|
||||
type adminDeleteSecretsAccessIdentityCommand struct {
|
||||
cmd *cobra.Command
|
||||
}
|
||||
@ -45,9 +50,25 @@ func (cmd *adminDeleteSecretsAccessIdentityCommand) run(_ *cobra.Command, args [
|
||||
}
|
||||
|
||||
func (cmd *adminDeleteSecretsAccessIdentityCommand) deleteDialPolicy(zId string, zrok *rest_client_zrok.Zrok) error {
|
||||
req := admin.NewDeleteSecretsAccessParams()
|
||||
req.Body.SecretsAccessIdentityZID = zId
|
||||
|
||||
_, err := zrok.Admin.DeleteSecretsAccess(req, mustGetAdminAuth())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cmd *adminDeleteSecretsAccessIdentityCommand) deleteIdentity(zId string, zrok *rest_client_zrok.Zrok) error {
|
||||
req := admin.NewDeleteIdentityParams()
|
||||
req.Body.ZID = zId
|
||||
|
||||
_, err := zrok.Admin.DeleteIdentity(req, mustGetAdminAuth())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user