Remove support for 'id' field in grants (#4290)
This commit is contained in:
1 parent
7921ce22fd
commit
e91c4cbfe2
4 files changed
+5
-14
No files matched your search
+4
-5
@@ -17,11 +17,10 @@ Canonical reference for changes, improvements, and bugfixes for Boundary.
|
||||
target's session authorization call.
|
||||
* The `grant_scope_id` field on roles is now deprecated in favor of the multiple
|
||||
grant scope support.
|
||||
* The deprecation notice for the `id` field in grant changing to `ids` in 0.13.1
|
||||
specified that it would be removed in 0.15.0. Instead, this will be removed in
|
||||
0.16.0. Existing grants already submitted into the system will still work, but
|
||||
the API will no longer accept adding or setting grants containing the `id`
|
||||
field in 0.16.0.
|
||||
* Per the note in Boundary 0.13.1, the `id` field in grants has changed to `ids`
|
||||
which allows multiple ids to be included; existing grants submitted to
|
||||
Boundary will continue to work, but grants using "id" can no longer be added
|
||||
to or set on a role.
|
||||
|
||||
### New and Improved
|
||||
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ func init() {
|
||||
// Warn until 0.16 about using the now-deprecated id field in grants; after
|
||||
// that disallow it
|
||||
featureMap[SupportIdInGrants] = MetadataConstraint{
|
||||
Constraints: mustNewConstraints("< 0.16.0"),
|
||||
Constraints: mustNewConstraints("< 0.15.0"),
|
||||
}
|
||||
|
||||
// PluginDelete supports calling DeleteObjects on the Storage Plugin
|
||||
|
||||
Reference in new issue
Block a user