From 084a49d09faeb2037a468116957a83832fcfe6f3 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Tue, 19 Mar 2024 14:58:10 -0600 Subject: [PATCH] Updated login CLI flags --- cmd/login.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmd/login.go b/cmd/login.go index 974ba94..b4a1273 100644 --- a/cmd/login.go +++ b/cmd/login.go @@ -14,6 +14,7 @@ import ( var ( client oauth.Client + scope []string target string = "" targetIndex int = -1 ) @@ -99,7 +100,8 @@ func init() { loginCmd.Flags().StringVar(&client.Id, "client.id", client.Id, "set the client ID") loginCmd.Flags().StringVar(&client.Secret, "client.secret", client.Secret, "set the client secret") loginCmd.Flags().StringSliceVar(&client.RedirectUris, "client.redirect-uris", client.RedirectUris, "set the redirect URI") - loginCmd.Flags().StringSliceVar(&client.Scope, "client.scope", client.Scope, "set the scopes") + loginCmd.Flags().StringSliceVar(&client.Scope, "client.scope", client.Scope, "set the identity provider scopes") + loginCmd.Flags().StringSliceVar(&config.Authorization.Token.Scope, "token.scope", scope, "set the access token scope") loginCmd.Flags().StringVar(&config.Server.Host, "server.host", config.Server.Host, "set the listening host") loginCmd.Flags().IntVar(&config.Server.Port, "server.port", config.Server.Port, "set the listening port") loginCmd.Flags().BoolVar(&config.Options.OpenBrowser, "open-browser", config.Options.OpenBrowser, "automatically open link in browser") @@ -107,8 +109,8 @@ func init() { loginCmd.Flags().StringVar(&config.Options.FlowType, "flow", config.Options.FlowType, "set the grant-type/authorization flow") loginCmd.Flags().BoolVar(&config.Options.CacheOnly, "cache-only", config.Options.CacheOnly, "only fetch identity provider configs stored locally") loginCmd.Flags().BoolVar(&config.Authentication.TestAllClients, "test-all", config.Authentication.TestAllClients, "test all clients in config for a valid provider") - loginCmd.Flags().StringVar(&target, "target", "", "set target client to use from config by name") - loginCmd.Flags().IntVar(&targetIndex, "index", -1, "set target client to use from config by index") - loginCmd.MarkFlagsMutuallyExclusive("target", "index") + loginCmd.Flags().StringVar(&target, "target.name", "", "set target client to use from config by name") + loginCmd.Flags().IntVar(&targetIndex, "target.index", -1, "set target client to use from config by index") + loginCmd.MarkFlagsMutuallyExclusive("target.name", "target.index") rootCmd.AddCommand(loginCmd) }