MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / newAPITokenRevokeCmd

Function newAPITokenRevokeCmd

app/cli/cmd/organization_apitoken_revoke.go:26–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24)
25
26func newAPITokenRevokeCmd() *cobra.Command {
27 var id string
28
29 cmd := &cobra.Command{
30 Use: "revoke",
31 Short: "revoke API token",
32 RunE: func(cmd *cobra.Command, args []string) error {
33 if err := action.NewAPITokenRevoke(ActionOpts).Run(context.Background(), id); err != nil {
34 return fmt.Errorf("revoking API token: %w", err)
35 }
36
37 logger.Info().Msg("API token revoked!")
38 return nil
39 },
40 }
41
42 cmd.Flags().StringVar(&id, "id", "", "API token ID")
43 err := cmd.MarkFlagRequired("id")
44 cobra.CheckErr(err)
45
46 return cmd
47}

Callers 1

Calls 3

NewAPITokenRevokeFunction · 0.92
InfoMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected