Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: do not hide SSO commands/flags #1218

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/app/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func configureKingpin(data *global.Data) *kingpin.Application {
// IMPORTANT: `--debug` is a built-in Kingpin flag so we must use `debug-mode`.
app.Flag("debug-mode", "Print API request and response details (NOTE: can disrupt the normal CLI flow output formatting)").BoolVar(&data.Flags.Debug)
// IMPORTANT: `--sso` causes a Kingpin runtime panic 🤦 so we use `enable-sso`.
app.Flag("enable-sso", "Enable Single-Sign On (SSO) for current profile execution (see also: 'fastly sso')").Hidden().BoolVar(&data.Flags.SSO)
app.Flag("enable-sso", "Enable Single-Sign On (SSO) for current profile execution (see also: 'fastly sso')").BoolVar(&data.Flags.SSO)
app.Flag("non-interactive", "Do not prompt for user input - suitable for CI processes. Equivalent to --accept-defaults and --auto-yes").Short('i').BoolVar(&data.Flags.NonInteractive)
app.Flag("profile", "Switch account profile for single command execution (see also: 'fastly profile switch')").Short('o').StringVar(&data.Flags.Profile)
app.Flag("quiet", "Silence all output except direct command output. This won't prevent interactive prompts (see: --accept-defaults, --auto-yes, --non-interactive)").Short('q').BoolVar(&data.Flags.Quiet)
Expand Down
1 change: 1 addition & 0 deletions pkg/app/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ complete -F _fastly_bash_autocomplete fastly
Name: "shell evaluate completion options",
Args: args("--completion-bash"),
WantOutput: `help
sso
acl
acl-entry
alerts
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/profile/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func NewCreateCommand(parent argparser.Registerer, g *global.Data, ssoCmd *sso.R
c.CmdClause = parent.Command("create", "Create user profile")
c.CmdClause.Arg("profile", "Profile to create (default 'user')").Default(profile.DefaultName).Short('p').StringVar(&c.profile)
c.CmdClause.Flag("automation-token", "Expected input will be an 'automation token' instead of a 'user token'").BoolVar(&c.automationToken)
c.CmdClause.Flag("sso", "Create an SSO-based token").Hidden().BoolVar(&c.sso)
c.CmdClause.Flag("sso", "Create an SSO-based token").BoolVar(&c.sso)
return &c
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/profile/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func NewUpdateCommand(parent argparser.Registerer, g *global.Data, ssoCmd *sso.R
c.CmdClause = parent.Command("update", "Update user profile")
c.CmdClause.Arg("profile", "Profile to update (defaults to the currently active profile)").Short('p').StringVar(&c.profile)
c.CmdClause.Flag("automation-token", "Expected input will be an 'automation token' instead of a 'user token'").BoolVar(&c.automationToken)
c.CmdClause.Flag("sso", "Update profile to use an SSO-based token").Hidden().BoolVar(&c.sso)
c.CmdClause.Flag("sso", "Update profile to use an SSO-based token").BoolVar(&c.sso)
return &c
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/sso/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func NewRootCommand(parent argparser.Registerer, g *global.Data) *RootCommand {
var c RootCommand
c.Globals = g
// FIXME: Unhide this command once SSO is GA.
c.CmdClause = parent.Command("sso", "Single Sign-On authentication (defaults to current profile)").Hidden()
c.CmdClause = parent.Command("sso", "Single Sign-On authentication (defaults to current profile)")
c.CmdClause.Arg("profile", "Profile to authenticate (i.e. create/update a token for)").Short('p').StringVar(&c.profile)
return &c
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/global/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ type Flags struct {
Profile string
// Quiet silences all output except direct command output.
Quiet bool
// SSO enables to SSO authentication tokens for the current profile.
// SSO enables SSO authentication tokens for the current profile.
SSO bool
// Token is an override for a profile (when passed SSO is disabled).
Token string
Expand Down
Loading