Skip to content

Commit f8c1ec9

Browse files
committed
scopes flag
1 parent f592a22 commit f8c1ec9

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

cmd/docker-mcp/commands/oauth.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,20 @@ func lsOauthCommand() *cobra.Command {
3535
}
3636

3737
func authorizeOauthCommand() *cobra.Command {
38-
return &cobra.Command{
38+
var opts struct {
39+
Scopes string
40+
}
41+
cmd := &cobra.Command{
3942
Use: "authorize <app>",
4043
Short: "Authorize the specified OAuth app.",
4144
Args: cobra.ExactArgs(1),
4245
RunE: func(cmd *cobra.Command, args []string) error {
43-
return oauth.Authorize(cmd.Context(), args[0])
46+
return oauth.Authorize(cmd.Context(), args[0], opts.Scopes)
4447
},
4548
}
49+
flags := cmd.Flags()
50+
flags.StringVar(&opts.Scopes, "scopes", "", "OAuth scopes to request (comma-separated)")
51+
return cmd
4652
}
4753

4854
func revokeOauthCommand() *cobra.Command {

cmd/docker-mcp/oauth/auth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import (
77
"github.com/docker/mcp-gateway/cmd/docker-mcp/internal/desktop"
88
)
99

10-
func Authorize(ctx context.Context, app string) error {
10+
func Authorize(ctx context.Context, app string, scopes string) error {
1111
client := desktop.NewAuthClient()
1212

13-
authResponse, err := client.PostOAuthApp(ctx, app, "")
13+
authResponse, err := client.PostOAuthApp(ctx, app, scopes)
1414
if err != nil {
1515
return err
1616
}

0 commit comments

Comments
 (0)