From 61fe77572e5d03a56138e507c455e8f6c81b9555 Mon Sep 17 00:00:00 2001 From: Louis Ruch Date: Thu, 13 Jan 2022 14:03:46 -0800 Subject: [PATCH] chore: make tools & make gen --- api/accounts/account.gen.go | 6 ++---- api/authmethods/authmethods.gen.go | 6 ++---- api/authtokens/authtokens.gen.go | 6 ++---- api/credentiallibraries/credential_library.gen.go | 6 ++---- api/credentialstores/credential_store.gen.go | 6 ++---- api/groups/group.gen.go | 6 ++---- api/hostcatalogs/host_catalog.gen.go | 6 ++---- api/hosts/host.gen.go | 6 ++---- api/hostsets/host_set.gen.go | 6 ++---- api/managedgroups/managedgroups.gen.go | 6 ++---- api/roles/role.gen.go | 6 ++---- api/scopes/scope.gen.go | 6 ++---- api/sessions/session.gen.go | 6 ++---- api/targets/target.gen.go | 6 ++---- api/users/user.gen.go | 6 ++---- internal/cmd/commands/accountscmd/accounts.gen.go | 2 ++ internal/cmd/commands/accountscmd/oidc_accounts.gen.go | 8 ++++++++ .../cmd/commands/accountscmd/password_accounts.gen.go | 8 ++++++++ internal/cmd/commands/authmethodscmd/authmethods.gen.go | 2 ++ .../cmd/commands/authmethodscmd/oidc_authmethods.gen.go | 6 ++++++ .../commands/authmethodscmd/password_authmethods.gen.go | 8 ++++++++ internal/cmd/commands/authtokenscmd/authtokens.gen.go | 3 +++ .../credentiallibrariescmd/credentiallibraries.gen.go | 2 ++ .../vault_credentiallibraries.gen.go | 8 ++++++++ .../commands/credentialstorescmd/credentialstores.gen.go | 2 ++ .../credentialstorescmd/vault_credentialstores.gen.go | 8 ++++++++ internal/cmd/commands/groupscmd/groups.gen.go | 1 + internal/cmd/commands/hostcatalogscmd/hostcatalogs.gen.go | 2 ++ .../commands/hostcatalogscmd/plugin_hostcatalogs.gen.go | 8 ++++++++ .../commands/hostcatalogscmd/static_hostcatalogs.gen.go | 8 ++++++++ internal/cmd/commands/hostscmd/hosts.gen.go | 2 ++ internal/cmd/commands/hostscmd/static_hosts.gen.go | 8 ++++++++ internal/cmd/commands/hostsetscmd/hostsets.gen.go | 2 ++ internal/cmd/commands/hostsetscmd/plugin_hostsets.gen.go | 8 ++++++++ internal/cmd/commands/hostsetscmd/static_hostsets.gen.go | 8 ++++++++ .../cmd/commands/managedgroupscmd/managedgroups.gen.go | 2 ++ .../commands/managedgroupscmd/oidc_managedgroups.gen.go | 8 ++++++++ internal/cmd/commands/rolescmd/roles.gen.go | 1 + internal/cmd/commands/scopescmd/scopes.gen.go | 3 +++ internal/cmd/commands/sessionscmd/sessions.gen.go | 7 +++++++ internal/cmd/commands/targetscmd/targets.gen.go | 2 ++ internal/cmd/commands/targetscmd/tcp_targets.gen.go | 8 ++++++++ internal/cmd/commands/userscmd/users.gen.go | 1 + .../vault/repository_credential_library_test.go | 1 - .../credentiallibraries/credentiallibrary_service.go | 4 ++-- 45 files changed, 168 insertions(+), 63 deletions(-) diff --git a/api/accounts/account.gen.go b/api/accounts/account.gen.go index 563f1f7a9..556d78d3b 100644 --- a/api/accounts/account.gen.go +++ b/api/accounts/account.gen.go @@ -42,10 +42,8 @@ func (n AccountReadResult) GetResponse() *api.Response { return n.response } -type ( - AccountCreateResult = AccountReadResult - AccountUpdateResult = AccountReadResult -) +type AccountCreateResult = AccountReadResult +type AccountUpdateResult = AccountReadResult type AccountDeleteResult struct { response *api.Response diff --git a/api/authmethods/authmethods.gen.go b/api/authmethods/authmethods.gen.go index 881187000..5934f95f4 100644 --- a/api/authmethods/authmethods.gen.go +++ b/api/authmethods/authmethods.gen.go @@ -43,10 +43,8 @@ func (n AuthMethodReadResult) GetResponse() *api.Response { return n.response } -type ( - AuthMethodCreateResult = AuthMethodReadResult - AuthMethodUpdateResult = AuthMethodReadResult -) +type AuthMethodCreateResult = AuthMethodReadResult +type AuthMethodUpdateResult = AuthMethodReadResult type AuthMethodDeleteResult struct { response *api.Response diff --git a/api/authtokens/authtokens.gen.go b/api/authtokens/authtokens.gen.go index 5eb28dfde..e4f1408e2 100644 --- a/api/authtokens/authtokens.gen.go +++ b/api/authtokens/authtokens.gen.go @@ -41,10 +41,8 @@ func (n AuthTokenReadResult) GetResponse() *api.Response { return n.response } -type ( - AuthTokenCreateResult = AuthTokenReadResult - AuthTokenUpdateResult = AuthTokenReadResult -) +type AuthTokenCreateResult = AuthTokenReadResult +type AuthTokenUpdateResult = AuthTokenReadResult type AuthTokenDeleteResult struct { response *api.Response diff --git a/api/credentiallibraries/credential_library.gen.go b/api/credentiallibraries/credential_library.gen.go index e374637c5..7ee533814 100644 --- a/api/credentiallibraries/credential_library.gen.go +++ b/api/credentiallibraries/credential_library.gen.go @@ -43,10 +43,8 @@ func (n CredentialLibraryReadResult) GetResponse() *api.Response { return n.response } -type ( - CredentialLibraryCreateResult = CredentialLibraryReadResult - CredentialLibraryUpdateResult = CredentialLibraryReadResult -) +type CredentialLibraryCreateResult = CredentialLibraryReadResult +type CredentialLibraryUpdateResult = CredentialLibraryReadResult type CredentialLibraryDeleteResult struct { response *api.Response diff --git a/api/credentialstores/credential_store.gen.go b/api/credentialstores/credential_store.gen.go index a59c0e813..5c37e8c65 100644 --- a/api/credentialstores/credential_store.gen.go +++ b/api/credentialstores/credential_store.gen.go @@ -42,10 +42,8 @@ func (n CredentialStoreReadResult) GetResponse() *api.Response { return n.response } -type ( - CredentialStoreCreateResult = CredentialStoreReadResult - CredentialStoreUpdateResult = CredentialStoreReadResult -) +type CredentialStoreCreateResult = CredentialStoreReadResult +type CredentialStoreUpdateResult = CredentialStoreReadResult type CredentialStoreDeleteResult struct { response *api.Response diff --git a/api/groups/group.gen.go b/api/groups/group.gen.go index 9a6e6421e..f394b92f6 100644 --- a/api/groups/group.gen.go +++ b/api/groups/group.gen.go @@ -41,10 +41,8 @@ func (n GroupReadResult) GetResponse() *api.Response { return n.response } -type ( - GroupCreateResult = GroupReadResult - GroupUpdateResult = GroupReadResult -) +type GroupCreateResult = GroupReadResult +type GroupUpdateResult = GroupReadResult type GroupDeleteResult struct { response *api.Response diff --git a/api/hostcatalogs/host_catalog.gen.go b/api/hostcatalogs/host_catalog.gen.go index d196f7355..45c8218be 100644 --- a/api/hostcatalogs/host_catalog.gen.go +++ b/api/hostcatalogs/host_catalog.gen.go @@ -47,10 +47,8 @@ func (n HostCatalogReadResult) GetResponse() *api.Response { return n.response } -type ( - HostCatalogCreateResult = HostCatalogReadResult - HostCatalogUpdateResult = HostCatalogReadResult -) +type HostCatalogCreateResult = HostCatalogReadResult +type HostCatalogUpdateResult = HostCatalogReadResult type HostCatalogDeleteResult struct { response *api.Response diff --git a/api/hosts/host.gen.go b/api/hosts/host.gen.go index b8c199ed7..33f90ab6a 100644 --- a/api/hosts/host.gen.go +++ b/api/hosts/host.gen.go @@ -47,10 +47,8 @@ func (n HostReadResult) GetResponse() *api.Response { return n.response } -type ( - HostCreateResult = HostReadResult - HostUpdateResult = HostReadResult -) +type HostCreateResult = HostReadResult +type HostUpdateResult = HostReadResult type HostDeleteResult struct { response *api.Response diff --git a/api/hostsets/host_set.gen.go b/api/hostsets/host_set.gen.go index 612c9b81b..c46720fdf 100644 --- a/api/hostsets/host_set.gen.go +++ b/api/hostsets/host_set.gen.go @@ -46,10 +46,8 @@ func (n HostSetReadResult) GetResponse() *api.Response { return n.response } -type ( - HostSetCreateResult = HostSetReadResult - HostSetUpdateResult = HostSetReadResult -) +type HostSetCreateResult = HostSetReadResult +type HostSetUpdateResult = HostSetReadResult type HostSetDeleteResult struct { response *api.Response diff --git a/api/managedgroups/managedgroups.gen.go b/api/managedgroups/managedgroups.gen.go index a79f3ccc5..b023bae23 100644 --- a/api/managedgroups/managedgroups.gen.go +++ b/api/managedgroups/managedgroups.gen.go @@ -42,10 +42,8 @@ func (n ManagedGroupReadResult) GetResponse() *api.Response { return n.response } -type ( - ManagedGroupCreateResult = ManagedGroupReadResult - ManagedGroupUpdateResult = ManagedGroupReadResult -) +type ManagedGroupCreateResult = ManagedGroupReadResult +type ManagedGroupUpdateResult = ManagedGroupReadResult type ManagedGroupDeleteResult struct { response *api.Response diff --git a/api/roles/role.gen.go b/api/roles/role.gen.go index 2263dfa9b..145dd3eda 100644 --- a/api/roles/role.gen.go +++ b/api/roles/role.gen.go @@ -44,10 +44,8 @@ func (n RoleReadResult) GetResponse() *api.Response { return n.response } -type ( - RoleCreateResult = RoleReadResult - RoleUpdateResult = RoleReadResult -) +type RoleCreateResult = RoleReadResult +type RoleUpdateResult = RoleReadResult type RoleDeleteResult struct { response *api.Response diff --git a/api/scopes/scope.gen.go b/api/scopes/scope.gen.go index ae11d826c..ce6c5f0b5 100644 --- a/api/scopes/scope.gen.go +++ b/api/scopes/scope.gen.go @@ -41,10 +41,8 @@ func (n ScopeReadResult) GetResponse() *api.Response { return n.response } -type ( - ScopeCreateResult = ScopeReadResult - ScopeUpdateResult = ScopeReadResult -) +type ScopeCreateResult = ScopeReadResult +type ScopeUpdateResult = ScopeReadResult type ScopeDeleteResult struct { response *api.Response diff --git a/api/sessions/session.gen.go b/api/sessions/session.gen.go index 388a6cb8f..5855297f0 100644 --- a/api/sessions/session.gen.go +++ b/api/sessions/session.gen.go @@ -50,10 +50,8 @@ func (n SessionReadResult) GetResponse() *api.Response { return n.response } -type ( - SessionCreateResult = SessionReadResult - SessionUpdateResult = SessionReadResult -) +type SessionCreateResult = SessionReadResult +type SessionUpdateResult = SessionReadResult type SessionDeleteResult struct { response *api.Response diff --git a/api/targets/target.gen.go b/api/targets/target.gen.go index 1e1a64fc7..d75621bc5 100644 --- a/api/targets/target.gen.go +++ b/api/targets/target.gen.go @@ -54,10 +54,8 @@ func (n TargetReadResult) GetResponse() *api.Response { return n.response } -type ( - TargetCreateResult = TargetReadResult - TargetUpdateResult = TargetReadResult -) +type TargetCreateResult = TargetReadResult +type TargetUpdateResult = TargetReadResult type TargetDeleteResult struct { response *api.Response diff --git a/api/users/user.gen.go b/api/users/user.gen.go index 70c3c2d0d..e1f8c78b0 100644 --- a/api/users/user.gen.go +++ b/api/users/user.gen.go @@ -45,10 +45,8 @@ func (n UserReadResult) GetResponse() *api.Response { return n.response } -type ( - UserCreateResult = UserReadResult - UserUpdateResult = UserReadResult -) +type UserCreateResult = UserReadResult +type UserUpdateResult = UserReadResult type UserDeleteResult struct { response *api.Response diff --git a/internal/cmd/commands/accountscmd/accounts.gen.go b/internal/cmd/commands/accountscmd/accounts.gen.go index 3a476ab32..a249b2eb0 100644 --- a/internal/cmd/commands/accountscmd/accounts.gen.go +++ b/internal/cmd/commands/accountscmd/accounts.gen.go @@ -144,11 +144,13 @@ func (c *Command) Run(args []string) int { if strutil.StrListContains(flagsMap[c.Func], "auth-method-id") { switch c.Func { + case "list": if c.FlagAuthMethodId == "" { c.PrintCliError(errors.New("AuthMethod ID must be passed in via -auth-method-id or BOUNDARY_AUTH_METHOD_ID")) return base.CommandUserError } + } } diff --git a/internal/cmd/commands/accountscmd/oidc_accounts.gen.go b/internal/cmd/commands/accountscmd/oidc_accounts.gen.go index 8ec585122..9caacbd29 100644 --- a/internal/cmd/commands/accountscmd/oidc_accounts.gen.go +++ b/internal/cmd/commands/accountscmd/oidc_accounts.gen.go @@ -67,9 +67,11 @@ func (c *OidcCommand) Help() string { helpMap := common.HelpMap("account") switch c.Func { + default: helpStr = c.extraOidcHelpFunc(helpMap) + } // Keep linter from complaining if we don't actually generate code using it @@ -104,6 +106,7 @@ func (c *OidcCommand) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "oidc-type account" @@ -128,11 +131,13 @@ func (c *OidcCommand) Run(args []string) int { if strutil.StrListContains(flagsOidcMap[c.Func], "auth-method-id") { switch c.Func { + case "create": if c.FlagAuthMethodId == "" { c.PrintCliError(errors.New("AuthMethod ID must be passed in via -auth-method-id or BOUNDARY_AUTH_METHOD_ID")) return base.CommandUserError } + } } @@ -166,6 +171,7 @@ func (c *OidcCommand) Run(args []string) int { var version uint32 switch c.Func { + case "update": switch c.FlagVersion { case 0: @@ -173,6 +179,7 @@ func (c *OidcCommand) Run(args []string) int { default: version = uint32(c.FlagVersion) } + } if ok := extraOidcFlagsHandlingFunc(c, f, &opts); !ok { @@ -214,6 +221,7 @@ func (c *OidcCommand) Run(args []string) int { } switch c.Func { + } switch base.Format(c.UI) { diff --git a/internal/cmd/commands/accountscmd/password_accounts.gen.go b/internal/cmd/commands/accountscmd/password_accounts.gen.go index d8a40761a..10944147c 100644 --- a/internal/cmd/commands/accountscmd/password_accounts.gen.go +++ b/internal/cmd/commands/accountscmd/password_accounts.gen.go @@ -67,9 +67,11 @@ func (c *PasswordCommand) Help() string { helpMap := common.HelpMap("account") switch c.Func { + default: helpStr = c.extraPasswordHelpFunc(helpMap) + } // Keep linter from complaining if we don't actually generate code using it @@ -104,6 +106,7 @@ func (c *PasswordCommand) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "password-type account" @@ -128,11 +131,13 @@ func (c *PasswordCommand) Run(args []string) int { if strutil.StrListContains(flagsPasswordMap[c.Func], "auth-method-id") { switch c.Func { + case "create": if c.FlagAuthMethodId == "" { c.PrintCliError(errors.New("AuthMethod ID must be passed in via -auth-method-id or BOUNDARY_AUTH_METHOD_ID")) return base.CommandUserError } + } } @@ -166,6 +171,7 @@ func (c *PasswordCommand) Run(args []string) int { var version uint32 switch c.Func { + case "update": switch c.FlagVersion { case 0: @@ -173,6 +179,7 @@ func (c *PasswordCommand) Run(args []string) int { default: version = uint32(c.FlagVersion) } + } if ok := extraPasswordFlagsHandlingFunc(c, f, &opts); !ok { @@ -214,6 +221,7 @@ func (c *PasswordCommand) Run(args []string) int { } switch c.Func { + } switch base.Format(c.UI) { diff --git a/internal/cmd/commands/authmethodscmd/authmethods.gen.go b/internal/cmd/commands/authmethodscmd/authmethods.gen.go index c09b1f4bd..cd022e384 100644 --- a/internal/cmd/commands/authmethodscmd/authmethods.gen.go +++ b/internal/cmd/commands/authmethodscmd/authmethods.gen.go @@ -142,11 +142,13 @@ func (c *Command) Run(args []string) int { if strutil.StrListContains(flagsMap[c.Func], "scope-id") { switch c.Func { + case "list": if c.FlagScopeId == "" { c.PrintCliError(errors.New("Scope ID must be passed in via -scope-id or BOUNDARY_SCOPE_ID")) return base.CommandUserError } + } } diff --git a/internal/cmd/commands/authmethodscmd/oidc_authmethods.gen.go b/internal/cmd/commands/authmethodscmd/oidc_authmethods.gen.go index 0c18c67b6..270c92a98 100644 --- a/internal/cmd/commands/authmethodscmd/oidc_authmethods.gen.go +++ b/internal/cmd/commands/authmethodscmd/oidc_authmethods.gen.go @@ -67,9 +67,11 @@ func (c *OidcCommand) Help() string { helpMap := common.HelpMap("auth method") switch c.Func { + default: helpStr = c.extraOidcHelpFunc(helpMap) + } // Keep linter from complaining if we don't actually generate code using it @@ -104,6 +106,7 @@ func (c *OidcCommand) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "oidc-type auth method" @@ -128,11 +131,13 @@ func (c *OidcCommand) Run(args []string) int { if strutil.StrListContains(flagsOidcMap[c.Func], "scope-id") { switch c.Func { + case "create": if c.FlagScopeId == "" { c.PrintCliError(errors.New("Scope ID must be passed in via -scope-id or BOUNDARY_SCOPE_ID")) return base.CommandUserError } + } } @@ -229,6 +234,7 @@ func (c *OidcCommand) Run(args []string) int { } switch c.Func { + } switch base.Format(c.UI) { diff --git a/internal/cmd/commands/authmethodscmd/password_authmethods.gen.go b/internal/cmd/commands/authmethodscmd/password_authmethods.gen.go index dd72b86f8..4104797e4 100644 --- a/internal/cmd/commands/authmethodscmd/password_authmethods.gen.go +++ b/internal/cmd/commands/authmethodscmd/password_authmethods.gen.go @@ -67,9 +67,11 @@ func (c *PasswordCommand) Help() string { helpMap := common.HelpMap("auth method") switch c.Func { + default: helpStr = c.extraPasswordHelpFunc(helpMap) + } // Keep linter from complaining if we don't actually generate code using it @@ -104,6 +106,7 @@ func (c *PasswordCommand) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "password-type auth method" @@ -128,11 +131,13 @@ func (c *PasswordCommand) Run(args []string) int { if strutil.StrListContains(flagsPasswordMap[c.Func], "scope-id") { switch c.Func { + case "create": if c.FlagScopeId == "" { c.PrintCliError(errors.New("Scope ID must be passed in via -scope-id or BOUNDARY_SCOPE_ID")) return base.CommandUserError } + } } @@ -171,6 +176,7 @@ func (c *PasswordCommand) Run(args []string) int { var version uint32 switch c.Func { + case "update": switch c.FlagVersion { case 0: @@ -178,6 +184,7 @@ func (c *PasswordCommand) Run(args []string) int { default: version = uint32(c.FlagVersion) } + } if ok := extraPasswordFlagsHandlingFunc(c, f, &opts); !ok { @@ -219,6 +226,7 @@ func (c *PasswordCommand) Run(args []string) int { } switch c.Func { + } switch base.Format(c.UI) { diff --git a/internal/cmd/commands/authtokenscmd/authtokens.gen.go b/internal/cmd/commands/authtokenscmd/authtokens.gen.go index cb71873db..d69b9f6c1 100644 --- a/internal/cmd/commands/authtokenscmd/authtokens.gen.go +++ b/internal/cmd/commands/authtokenscmd/authtokens.gen.go @@ -114,6 +114,7 @@ func (c *Command) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "auth token" @@ -133,11 +134,13 @@ func (c *Command) Run(args []string) int { if strutil.StrListContains(flagsMap[c.Func], "scope-id") { switch c.Func { + case "list": if c.FlagScopeId == "" { c.PrintCliError(errors.New("Scope ID must be passed in via -scope-id or BOUNDARY_SCOPE_ID")) return base.CommandUserError } + } } diff --git a/internal/cmd/commands/credentiallibrariescmd/credentiallibraries.gen.go b/internal/cmd/commands/credentiallibrariescmd/credentiallibraries.gen.go index 87803efc6..33bdab34f 100644 --- a/internal/cmd/commands/credentiallibrariescmd/credentiallibraries.gen.go +++ b/internal/cmd/commands/credentiallibrariescmd/credentiallibraries.gen.go @@ -142,11 +142,13 @@ func (c *Command) Run(args []string) int { if strutil.StrListContains(flagsMap[c.Func], "credential-store-id") { switch c.Func { + case "list": if c.FlagCredentialStoreId == "" { c.PrintCliError(errors.New("CredentialStore ID must be passed in via -credential-store-id or BOUNDARY_CREDENTIAL_STORE_ID")) return base.CommandUserError } + } } diff --git a/internal/cmd/commands/credentiallibrariescmd/vault_credentiallibraries.gen.go b/internal/cmd/commands/credentiallibrariescmd/vault_credentiallibraries.gen.go index 395cb7fa7..a02999694 100644 --- a/internal/cmd/commands/credentiallibrariescmd/vault_credentiallibraries.gen.go +++ b/internal/cmd/commands/credentiallibrariescmd/vault_credentiallibraries.gen.go @@ -67,9 +67,11 @@ func (c *VaultCommand) Help() string { helpMap := common.HelpMap("credential library") switch c.Func { + default: helpStr = c.extraVaultHelpFunc(helpMap) + } // Keep linter from complaining if we don't actually generate code using it @@ -104,6 +106,7 @@ func (c *VaultCommand) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "vault-type credential library" @@ -128,11 +131,13 @@ func (c *VaultCommand) Run(args []string) int { if strutil.StrListContains(flagsVaultMap[c.Func], "credential-store-id") { switch c.Func { + case "create": if c.FlagCredentialStoreId == "" { c.PrintCliError(errors.New("CredentialStore ID must be passed in via -credential-store-id or BOUNDARY_CREDENTIAL_STORE_ID")) return base.CommandUserError } + } } @@ -166,6 +171,7 @@ func (c *VaultCommand) Run(args []string) int { var version uint32 switch c.Func { + case "update": switch c.FlagVersion { case 0: @@ -173,6 +179,7 @@ func (c *VaultCommand) Run(args []string) int { default: version = uint32(c.FlagVersion) } + } if ok := extraVaultFlagsHandlingFunc(c, f, &opts); !ok { @@ -216,6 +223,7 @@ func (c *VaultCommand) Run(args []string) int { } switch c.Func { + } switch base.Format(c.UI) { diff --git a/internal/cmd/commands/credentialstorescmd/credentialstores.gen.go b/internal/cmd/commands/credentialstorescmd/credentialstores.gen.go index a7da26513..bc532a064 100644 --- a/internal/cmd/commands/credentialstorescmd/credentialstores.gen.go +++ b/internal/cmd/commands/credentialstorescmd/credentialstores.gen.go @@ -142,11 +142,13 @@ func (c *Command) Run(args []string) int { if strutil.StrListContains(flagsMap[c.Func], "scope-id") { switch c.Func { + case "list": if c.FlagScopeId == "" { c.PrintCliError(errors.New("Scope ID must be passed in via -scope-id or BOUNDARY_SCOPE_ID")) return base.CommandUserError } + } } diff --git a/internal/cmd/commands/credentialstorescmd/vault_credentialstores.gen.go b/internal/cmd/commands/credentialstorescmd/vault_credentialstores.gen.go index a45714fe6..f23d26d82 100644 --- a/internal/cmd/commands/credentialstorescmd/vault_credentialstores.gen.go +++ b/internal/cmd/commands/credentialstorescmd/vault_credentialstores.gen.go @@ -67,9 +67,11 @@ func (c *VaultCommand) Help() string { helpMap := common.HelpMap("credential store") switch c.Func { + default: helpStr = c.extraVaultHelpFunc(helpMap) + } // Keep linter from complaining if we don't actually generate code using it @@ -104,6 +106,7 @@ func (c *VaultCommand) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "vault-type credential store" @@ -128,11 +131,13 @@ func (c *VaultCommand) Run(args []string) int { if strutil.StrListContains(flagsVaultMap[c.Func], "scope-id") { switch c.Func { + case "create": if c.FlagScopeId == "" { c.PrintCliError(errors.New("Scope ID must be passed in via -scope-id or BOUNDARY_SCOPE_ID")) return base.CommandUserError } + } } @@ -171,6 +176,7 @@ func (c *VaultCommand) Run(args []string) int { var version uint32 switch c.Func { + case "update": switch c.FlagVersion { case 0: @@ -178,6 +184,7 @@ func (c *VaultCommand) Run(args []string) int { default: version = uint32(c.FlagVersion) } + } if ok := extraVaultFlagsHandlingFunc(c, f, &opts); !ok { @@ -221,6 +228,7 @@ func (c *VaultCommand) Run(args []string) int { } switch c.Func { + } switch base.Format(c.UI) { diff --git a/internal/cmd/commands/groupscmd/groups.gen.go b/internal/cmd/commands/groupscmd/groups.gen.go index e25f377f1..45b8fe354 100644 --- a/internal/cmd/commands/groupscmd/groups.gen.go +++ b/internal/cmd/commands/groupscmd/groups.gen.go @@ -126,6 +126,7 @@ func (c *Command) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "group" diff --git a/internal/cmd/commands/hostcatalogscmd/hostcatalogs.gen.go b/internal/cmd/commands/hostcatalogscmd/hostcatalogs.gen.go index 6ab66cd53..023fb7123 100644 --- a/internal/cmd/commands/hostcatalogscmd/hostcatalogs.gen.go +++ b/internal/cmd/commands/hostcatalogscmd/hostcatalogs.gen.go @@ -142,11 +142,13 @@ func (c *Command) Run(args []string) int { if strutil.StrListContains(flagsMap[c.Func], "scope-id") { switch c.Func { + case "list": if c.FlagScopeId == "" { c.PrintCliError(errors.New("Scope ID must be passed in via -scope-id or BOUNDARY_SCOPE_ID")) return base.CommandUserError } + } } diff --git a/internal/cmd/commands/hostcatalogscmd/plugin_hostcatalogs.gen.go b/internal/cmd/commands/hostcatalogscmd/plugin_hostcatalogs.gen.go index 41b1fb8dd..f233291ab 100644 --- a/internal/cmd/commands/hostcatalogscmd/plugin_hostcatalogs.gen.go +++ b/internal/cmd/commands/hostcatalogscmd/plugin_hostcatalogs.gen.go @@ -65,9 +65,11 @@ func (c *PluginCommand) Help() string { helpMap := common.HelpMap("host catalog") switch c.Func { + default: helpStr = c.extraPluginHelpFunc(helpMap) + } // Keep linter from complaining if we don't actually generate code using it @@ -108,6 +110,7 @@ func (c *PluginCommand) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "plugin-type host catalog" @@ -132,11 +135,13 @@ func (c *PluginCommand) Run(args []string) int { if strutil.StrListContains(flagsPluginMap[c.Func], "scope-id") { switch c.Func { + case "create": if c.FlagScopeId == "" { c.PrintCliError(errors.New("Scope ID must be passed in via -scope-id or BOUNDARY_SCOPE_ID")) return base.CommandUserError } + } } @@ -186,6 +191,7 @@ func (c *PluginCommand) Run(args []string) int { var version uint32 switch c.Func { + case "update": switch c.FlagVersion { case 0: @@ -193,6 +199,7 @@ func (c *PluginCommand) Run(args []string) int { default: version = uint32(c.FlagVersion) } + } if err := common.HandleAttributeFlags( @@ -264,6 +271,7 @@ func (c *PluginCommand) Run(args []string) int { } switch c.Func { + } switch base.Format(c.UI) { diff --git a/internal/cmd/commands/hostcatalogscmd/static_hostcatalogs.gen.go b/internal/cmd/commands/hostcatalogscmd/static_hostcatalogs.gen.go index 84b8de177..e5815023d 100644 --- a/internal/cmd/commands/hostcatalogscmd/static_hostcatalogs.gen.go +++ b/internal/cmd/commands/hostcatalogscmd/static_hostcatalogs.gen.go @@ -65,9 +65,11 @@ func (c *StaticCommand) Help() string { helpMap := common.HelpMap("host catalog") switch c.Func { + default: helpStr = c.extraStaticHelpFunc(helpMap) + } // Keep linter from complaining if we don't actually generate code using it @@ -102,6 +104,7 @@ func (c *StaticCommand) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "static-type host catalog" @@ -126,11 +129,13 @@ func (c *StaticCommand) Run(args []string) int { if strutil.StrListContains(flagsStaticMap[c.Func], "scope-id") { switch c.Func { + case "create": if c.FlagScopeId == "" { c.PrintCliError(errors.New("Scope ID must be passed in via -scope-id or BOUNDARY_SCOPE_ID")) return base.CommandUserError } + } } @@ -169,6 +174,7 @@ func (c *StaticCommand) Run(args []string) int { var version uint32 switch c.Func { + case "update": switch c.FlagVersion { case 0: @@ -176,6 +182,7 @@ func (c *StaticCommand) Run(args []string) int { default: version = uint32(c.FlagVersion) } + } if ok := extraStaticFlagsHandlingFunc(c, f, &opts); !ok { @@ -217,6 +224,7 @@ func (c *StaticCommand) Run(args []string) int { } switch c.Func { + } switch base.Format(c.UI) { diff --git a/internal/cmd/commands/hostscmd/hosts.gen.go b/internal/cmd/commands/hostscmd/hosts.gen.go index c5fd4799d..60fadb8e3 100644 --- a/internal/cmd/commands/hostscmd/hosts.gen.go +++ b/internal/cmd/commands/hostscmd/hosts.gen.go @@ -142,11 +142,13 @@ func (c *Command) Run(args []string) int { if strutil.StrListContains(flagsMap[c.Func], "host-catalog-id") { switch c.Func { + case "list": if c.FlagHostCatalogId == "" { c.PrintCliError(errors.New("HostCatalog ID must be passed in via -host-catalog-id or BOUNDARY_HOST_CATALOG_ID")) return base.CommandUserError } + } } diff --git a/internal/cmd/commands/hostscmd/static_hosts.gen.go b/internal/cmd/commands/hostscmd/static_hosts.gen.go index 016126e66..a09840c45 100644 --- a/internal/cmd/commands/hostscmd/static_hosts.gen.go +++ b/internal/cmd/commands/hostscmd/static_hosts.gen.go @@ -67,9 +67,11 @@ func (c *StaticCommand) Help() string { helpMap := common.HelpMap("host") switch c.Func { + default: helpStr = c.extraStaticHelpFunc(helpMap) + } // Keep linter from complaining if we don't actually generate code using it @@ -104,6 +106,7 @@ func (c *StaticCommand) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "static-type host" @@ -128,11 +131,13 @@ func (c *StaticCommand) Run(args []string) int { if strutil.StrListContains(flagsStaticMap[c.Func], "host-catalog-id") { switch c.Func { + case "create": if c.FlagHostCatalogId == "" { c.PrintCliError(errors.New("HostCatalog ID must be passed in via -host-catalog-id or BOUNDARY_HOST_CATALOG_ID")) return base.CommandUserError } + } } @@ -166,6 +171,7 @@ func (c *StaticCommand) Run(args []string) int { var version uint32 switch c.Func { + case "update": switch c.FlagVersion { case 0: @@ -173,6 +179,7 @@ func (c *StaticCommand) Run(args []string) int { default: version = uint32(c.FlagVersion) } + } if ok := extraStaticFlagsHandlingFunc(c, f, &opts); !ok { @@ -214,6 +221,7 @@ func (c *StaticCommand) Run(args []string) int { } switch c.Func { + } switch base.Format(c.UI) { diff --git a/internal/cmd/commands/hostsetscmd/hostsets.gen.go b/internal/cmd/commands/hostsetscmd/hostsets.gen.go index ea69e3c74..31ab7982d 100644 --- a/internal/cmd/commands/hostsetscmd/hostsets.gen.go +++ b/internal/cmd/commands/hostsetscmd/hostsets.gen.go @@ -144,11 +144,13 @@ func (c *Command) Run(args []string) int { if strutil.StrListContains(flagsMap[c.Func], "host-catalog-id") { switch c.Func { + case "list": if c.FlagHostCatalogId == "" { c.PrintCliError(errors.New("HostCatalog ID must be passed in via -host-catalog-id or BOUNDARY_HOST_CATALOG_ID")) return base.CommandUserError } + } } diff --git a/internal/cmd/commands/hostsetscmd/plugin_hostsets.gen.go b/internal/cmd/commands/hostsetscmd/plugin_hostsets.gen.go index 8190cae04..24dc42250 100644 --- a/internal/cmd/commands/hostsetscmd/plugin_hostsets.gen.go +++ b/internal/cmd/commands/hostsetscmd/plugin_hostsets.gen.go @@ -67,9 +67,11 @@ func (c *PluginCommand) Help() string { helpMap := common.HelpMap("host set") switch c.Func { + default: helpStr = c.extraPluginHelpFunc(helpMap) + } // Keep linter from complaining if we don't actually generate code using it @@ -107,6 +109,7 @@ func (c *PluginCommand) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "plugin-type host set" @@ -131,11 +134,13 @@ func (c *PluginCommand) Run(args []string) int { if strutil.StrListContains(flagsPluginMap[c.Func], "host-catalog-id") { switch c.Func { + case "create": if c.FlagHostCatalogId == "" { c.PrintCliError(errors.New("HostCatalog ID must be passed in via -host-catalog-id or BOUNDARY_HOST_CATALOG_ID")) return base.CommandUserError } + } } @@ -169,6 +174,7 @@ func (c *PluginCommand) Run(args []string) int { var version uint32 switch c.Func { + case "update": switch c.FlagVersion { case 0: @@ -176,6 +182,7 @@ func (c *PluginCommand) Run(args []string) int { default: version = uint32(c.FlagVersion) } + } if err := common.HandleAttributeFlags( @@ -232,6 +239,7 @@ func (c *PluginCommand) Run(args []string) int { } switch c.Func { + } switch base.Format(c.UI) { diff --git a/internal/cmd/commands/hostsetscmd/static_hostsets.gen.go b/internal/cmd/commands/hostsetscmd/static_hostsets.gen.go index 25375154e..f76bf2df3 100644 --- a/internal/cmd/commands/hostsetscmd/static_hostsets.gen.go +++ b/internal/cmd/commands/hostsetscmd/static_hostsets.gen.go @@ -65,9 +65,11 @@ func (c *StaticCommand) Help() string { helpMap := common.HelpMap("host set") switch c.Func { + default: helpStr = c.extraStaticHelpFunc(helpMap) + } // Keep linter from complaining if we don't actually generate code using it @@ -102,6 +104,7 @@ func (c *StaticCommand) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "static-type host set" @@ -126,11 +129,13 @@ func (c *StaticCommand) Run(args []string) int { if strutil.StrListContains(flagsStaticMap[c.Func], "host-catalog-id") { switch c.Func { + case "create": if c.FlagHostCatalogId == "" { c.PrintCliError(errors.New("HostCatalog ID must be passed in via -host-catalog-id or BOUNDARY_HOST_CATALOG_ID")) return base.CommandUserError } + } } @@ -164,6 +169,7 @@ func (c *StaticCommand) Run(args []string) int { var version uint32 switch c.Func { + case "update": switch c.FlagVersion { case 0: @@ -171,6 +177,7 @@ func (c *StaticCommand) Run(args []string) int { default: version = uint32(c.FlagVersion) } + } if ok := extraStaticFlagsHandlingFunc(c, f, &opts); !ok { @@ -212,6 +219,7 @@ func (c *StaticCommand) Run(args []string) int { } switch c.Func { + } switch base.Format(c.UI) { diff --git a/internal/cmd/commands/managedgroupscmd/managedgroups.gen.go b/internal/cmd/commands/managedgroupscmd/managedgroups.gen.go index 27d642c37..266d4c4c2 100644 --- a/internal/cmd/commands/managedgroupscmd/managedgroups.gen.go +++ b/internal/cmd/commands/managedgroupscmd/managedgroups.gen.go @@ -142,11 +142,13 @@ func (c *Command) Run(args []string) int { if strutil.StrListContains(flagsMap[c.Func], "auth-method-id") { switch c.Func { + case "list": if c.FlagAuthMethodId == "" { c.PrintCliError(errors.New("AuthMethod ID must be passed in via -auth-method-id or BOUNDARY_AUTH_METHOD_ID")) return base.CommandUserError } + } } diff --git a/internal/cmd/commands/managedgroupscmd/oidc_managedgroups.gen.go b/internal/cmd/commands/managedgroupscmd/oidc_managedgroups.gen.go index 8a09b0797..6f608e627 100644 --- a/internal/cmd/commands/managedgroupscmd/oidc_managedgroups.gen.go +++ b/internal/cmd/commands/managedgroupscmd/oidc_managedgroups.gen.go @@ -67,9 +67,11 @@ func (c *OidcCommand) Help() string { helpMap := common.HelpMap("managed group") switch c.Func { + default: helpStr = c.extraOidcHelpFunc(helpMap) + } // Keep linter from complaining if we don't actually generate code using it @@ -104,6 +106,7 @@ func (c *OidcCommand) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "oidc-type managed group" @@ -128,11 +131,13 @@ func (c *OidcCommand) Run(args []string) int { if strutil.StrListContains(flagsOidcMap[c.Func], "auth-method-id") { switch c.Func { + case "create": if c.FlagAuthMethodId == "" { c.PrintCliError(errors.New("AuthMethod ID must be passed in via -auth-method-id or BOUNDARY_AUTH_METHOD_ID")) return base.CommandUserError } + } } @@ -166,6 +171,7 @@ func (c *OidcCommand) Run(args []string) int { var version uint32 switch c.Func { + case "update": switch c.FlagVersion { case 0: @@ -173,6 +179,7 @@ func (c *OidcCommand) Run(args []string) int { default: version = uint32(c.FlagVersion) } + } if ok := extraOidcFlagsHandlingFunc(c, f, &opts); !ok { @@ -214,6 +221,7 @@ func (c *OidcCommand) Run(args []string) int { } switch c.Func { + } switch base.Format(c.UI) { diff --git a/internal/cmd/commands/rolescmd/roles.gen.go b/internal/cmd/commands/rolescmd/roles.gen.go index fc6e749f8..514801cc2 100644 --- a/internal/cmd/commands/rolescmd/roles.gen.go +++ b/internal/cmd/commands/rolescmd/roles.gen.go @@ -126,6 +126,7 @@ func (c *Command) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "role" diff --git a/internal/cmd/commands/scopescmd/scopes.gen.go b/internal/cmd/commands/scopescmd/scopes.gen.go index 65edfa060..d06413f95 100644 --- a/internal/cmd/commands/scopescmd/scopes.gen.go +++ b/internal/cmd/commands/scopescmd/scopes.gen.go @@ -126,6 +126,7 @@ func (c *Command) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "scope" @@ -201,6 +202,7 @@ func (c *Command) Run(args []string) int { var version uint32 switch c.Func { + case "update": switch c.FlagVersion { case 0: @@ -208,6 +210,7 @@ func (c *Command) Run(args []string) int { default: version = uint32(c.FlagVersion) } + } if ok := extraFlagsHandlingFunc(c, f, &opts); !ok { diff --git a/internal/cmd/commands/sessionscmd/sessions.gen.go b/internal/cmd/commands/sessionscmd/sessions.gen.go index 3810eff56..f4f9b022f 100644 --- a/internal/cmd/commands/sessionscmd/sessions.gen.go +++ b/internal/cmd/commands/sessionscmd/sessions.gen.go @@ -109,6 +109,7 @@ func (c *Command) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "session" @@ -133,11 +134,13 @@ func (c *Command) Run(args []string) int { if strutil.StrListContains(flagsMap[c.Func], "scope-id") { switch c.Func { + case "list": if c.FlagScopeId == "" { c.PrintCliError(errors.New("Scope ID must be passed in via -scope-id or BOUNDARY_SCOPE_ID")) return base.CommandUserError } + } } @@ -160,6 +163,7 @@ func (c *Command) Run(args []string) int { var version uint32 switch c.Func { + case "cancel": switch c.FlagVersion { case 0: @@ -167,6 +171,7 @@ func (c *Command) Run(args []string) int { default: version = uint32(c.FlagVersion) } + } if ok := extraFlagsHandlingFunc(c, f, &opts); !ok { @@ -210,6 +215,7 @@ func (c *Command) Run(args []string) int { } switch c.Func { + case "list": switch base.Format(c.UI) { case "json": @@ -223,6 +229,7 @@ func (c *Command) Run(args []string) int { } return base.CommandSuccess + } switch base.Format(c.UI) { diff --git a/internal/cmd/commands/targetscmd/targets.gen.go b/internal/cmd/commands/targetscmd/targets.gen.go index 7931c4e39..ebe9acd88 100644 --- a/internal/cmd/commands/targetscmd/targets.gen.go +++ b/internal/cmd/commands/targetscmd/targets.gen.go @@ -145,11 +145,13 @@ func (c *Command) Run(args []string) int { if strutil.StrListContains(flagsMap[c.Func], "scope-id") { switch c.Func { + case "list": if c.FlagScopeId == "" { c.PrintCliError(errors.New("Scope ID must be passed in via -scope-id or BOUNDARY_SCOPE_ID")) return base.CommandUserError } + } } diff --git a/internal/cmd/commands/targetscmd/tcp_targets.gen.go b/internal/cmd/commands/targetscmd/tcp_targets.gen.go index 2992ea4a8..d1e3d9449 100644 --- a/internal/cmd/commands/targetscmd/tcp_targets.gen.go +++ b/internal/cmd/commands/targetscmd/tcp_targets.gen.go @@ -67,9 +67,11 @@ func (c *TcpCommand) Help() string { helpMap := common.HelpMap("target") switch c.Func { + default: helpStr = c.extraTcpHelpFunc(helpMap) + } // Keep linter from complaining if we don't actually generate code using it @@ -104,6 +106,7 @@ func (c *TcpCommand) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "tcp-type target" @@ -128,11 +131,13 @@ func (c *TcpCommand) Run(args []string) int { if strutil.StrListContains(flagsTcpMap[c.Func], "scope-id") { switch c.Func { + case "create": if c.FlagScopeId == "" { c.PrintCliError(errors.New("Scope ID must be passed in via -scope-id or BOUNDARY_SCOPE_ID")) return base.CommandUserError } + } } @@ -171,6 +176,7 @@ func (c *TcpCommand) Run(args []string) int { var version uint32 switch c.Func { + case "update": switch c.FlagVersion { case 0: @@ -178,6 +184,7 @@ func (c *TcpCommand) Run(args []string) int { default: version = uint32(c.FlagVersion) } + } if ok := extraTcpFlagsHandlingFunc(c, f, &opts); !ok { @@ -219,6 +226,7 @@ func (c *TcpCommand) Run(args []string) int { } switch c.Func { + } switch base.Format(c.UI) { diff --git a/internal/cmd/commands/userscmd/users.gen.go b/internal/cmd/commands/userscmd/users.gen.go index f8d0e1b63..a1293128e 100644 --- a/internal/cmd/commands/userscmd/users.gen.go +++ b/internal/cmd/commands/userscmd/users.gen.go @@ -126,6 +126,7 @@ func (c *Command) Run(args []string) int { switch c.Func { case "": return cli.RunResultHelp + } c.plural = "user" diff --git a/internal/credential/vault/repository_credential_library_test.go b/internal/credential/vault/repository_credential_library_test.go index d12e7ed77..968e1cb06 100644 --- a/internal/credential/vault/repository_credential_library_test.go +++ b/internal/credential/vault/repository_credential_library_test.go @@ -519,7 +519,6 @@ func TestRepository_UpdateCredentialLibrary(t *testing.T) { wantCount int wantErr errors.Code }{ - { name: "nil-credential-library", orig: &CredentialLibrary{ diff --git a/internal/servers/controller/handlers/credentiallibraries/credentiallibrary_service.go b/internal/servers/controller/handlers/credentiallibraries/credentiallibrary_service.go index 349b61295..0402c526f 100644 --- a/internal/servers/controller/handlers/credentiallibraries/credentiallibrary_service.go +++ b/internal/servers/controller/handlers/credentiallibraries/credentiallibrary_service.go @@ -344,8 +344,8 @@ func (s Service) updateInRepo( masks []string, in *pb.CredentialLibrary, currentCredentialType credential.Type, - currentMapping vault.MappingOverride) (credential.Library, error) { - + currentMapping vault.MappingOverride) (credential.Library, error, +) { const op = "credentiallibraries.(Service).updateInRepo" var dbMasks []string