MCPcopy Index your code
hub / github.com/docker/docker-agent / newDebugOAuthRemoveCmd

Function newDebugOAuthRemoveCmd

cmd/root/debug_oauth.go:134–154  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

132}
133
134func newDebugOAuthRemoveCmd() *cobra.Command {
135 return &cobra.Command{
136 Use: "remove <resource-url>",
137 Short: "Remove a stored OAuth token",
138 Args: cobra.ExactArgs(1),
139 RunE: func(cmd *cobra.Command, args []string) (commandErr error) {
140 ctx := cmd.Context()
141 telemetry.TrackCommand(ctx, "debug", []string{"oauth", "remove"})
142 defer func() {
143 telemetry.TrackCommandError(ctx, "debug", []string{"oauth", "remove"}, commandErr)
144 }()
145
146 if err := mcp.RemoveOAuthToken(args[0]); err != nil {
147 return err
148 }
149
150 fmt.Fprintf(cmd.OutOrStdout(), "Removed OAuth token for %s\n", args[0])
151 return nil
152 },
153 }
154}
155
156func newDebugOAuthLoginCmd() *cobra.Command {
157 var flags debugFlags

Callers 1

newDebugOAuthCmdFunction · 0.85

Calls 4

TrackCommandFunction · 0.92
TrackCommandErrorFunction · 0.92
RemoveOAuthTokenFunction · 0.92
ContextMethod · 0.80

Tested by

no test coverage detected