From a7fca4480944dc59b149fb22e96fc2528e5e93e5 Mon Sep 17 00:00:00 2001 From: Jeff Malnick Date: Fri, 13 Nov 2020 07:06:37 -0800 Subject: [PATCH] Fix authz flag (#787) * Fix authz flag * add changelog bug fix for authz flag Co-authored-by: Jeff Mitchell --- CHANGELOG.md | 2 ++ internal/cmd/commands/connect/connect.go | 15 +++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2492aa0799..161854e54a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,8 @@ Canonical reference for changes, improvements, and bugfixes for Boundary. * ui: Fix grant string corruption on updates ([Issue](https://github.com/hashicorp/boundary/issues/757)) ([PR](https://github.com/hashicorp/boundary-ui/pull/356)) +* controller, cli: Fix mutual exclusivity bug with using -authz-token on `boundary connect` + ([PR](https://github.com/hashicorp/boundary/pull/787)) ## v0.1.1 diff --git a/internal/cmd/commands/connect/connect.go b/internal/cmd/commands/connect/connect.go index dfcfd5df56..b928eb68c9 100644 --- a/internal/cmd/commands/connect/connect.go +++ b/internal/cmd/commands/connect/connect.go @@ -257,12 +257,15 @@ func (c *Command) Run(args []string) (retCode int) { } switch { - case c.flagAuthzToken != "" && c.flagTargetId != "": - c.UI.Error(`-target-id and -authz-token cannot both be specified`) - return 1 - case c.flagAuthzToken != "" && c.flagTargetName != "": - c.UI.Error(`-target-name and -authz-token cannot both be specified`) - return 1 + case c.flagAuthzToken != "": + switch { + case c.flagTargetId != "": + c.UI.Error(`-target-id and -authz-token cannot both be specified`) + return 1 + case c.flagTargetName != "": + c.UI.Error(`-target-name and -authz-token cannot both be specified`) + return 1 + } default: if c.flagTargetId == "" && (c.flagTargetName == "" ||