Remove support for 'id' field in grants (#4290)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2024-01-25 15:58:55 -05:00
1 parent 7921ce22fd
commit e91c4cbfe2
4 files changed
+5 -14

No files matched your search

-3
View File
@@ -13,7 +13,6 @@ import (
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/hashicorp/boundary/internal/perms"
"github.com/hashicorp/boundary/internal/types/scope"
"github.com/hashicorp/boundary/version"
"github.com/mitchellh/go-wordwrap"
)
@@ -284,8 +283,6 @@ func extraFlagsHandlingFuncImpl(c *Command, _ *base.FlagSets, opts *[]roles.Opti
switch {
case parsed.Id() == "":
// Nothing
case version.SupportsFeature(version.Binary, version.SupportIdInGrants):
c.UI.Warn(fmt.Sprintf("Grant %q uses the %q field, which is deprecated and will not be allowed in version 0.16.0+. Please use %q instead.", grant, "id", "ids"))
default:
c.UI.Error(fmt.Sprintf("Grant %q uses the %q field which is no longer supported. Please use %q instead.", grant, "id", "ids"))
return false
@@ -27,7 +27,6 @@ import (
"github.com/hashicorp/boundary/internal/types/scope"
pb "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/roles"
"github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/scopes"
"github.com/hashicorp/boundary/version"
"github.com/hashicorp/go-secure-stdlib/strutil"
"google.golang.org/grpc/codes"
"google.golang.org/protobuf/types/known/wrapperspb"
@@ -1385,8 +1384,6 @@ func validateAddRoleGrantsRequest(ctx context.Context, req *pbs.AddRoleGrantsReq
switch {
case grant.Id() == "":
// Nothing
case version.SupportsFeature(version.Binary, version.SupportIdInGrants):
// This will warn on the CLI
default:
badFields["grant_strings"] = fmt.Sprintf("Grant %q uses the %q field which is no longer supported. Please use %q instead.", v, "id", "ids")
}
@@ -1424,8 +1421,6 @@ func validateSetRoleGrantsRequest(ctx context.Context, req *pbs.SetRoleGrantsReq
switch {
case grant.Id() == "":
// Nothing
case version.SupportsFeature(version.Binary, version.SupportIdInGrants):
// This will warn on the CLI
default:
badFields["grant_strings"] = fmt.Sprintf("Grant %q uses the %q field which is no longer supported. Please use %q instead.", v, "id", "ids")
}