Skip to content

Commit

Permalink
Add authorized collection actions output for credential stores
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferai committed Sep 15, 2021
1 parent 5d7e723 commit 61fabf7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

Canonical reference for changes, improvements, and bugfixes for Boundary.

## Next


## 0.6.1 (2021/09/14)

### Bug Fixes
Expand All @@ -15,6 +12,8 @@ Canonical reference for changes, improvements, and bugfixes for Boundary.
project scope output. ([PR](https://github.com/hashicorp/boundary/pull/1524))
* actions: Fix `sessions` collection actions not being visible when reading a
scope ([PR](https://github.com/hashicorp/boundary/pull/1527))
* credential stores: Fix credential stores not showing authorized collection
actions ([PR](https://github.com/hashicorp/boundary/pull/1530))

## 0.6.0 (2021/09/03)

Expand Down
2 changes: 1 addition & 1 deletion internal/servers/controller/auth/authorized_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func CalculateAuthorizedCollectionActions(ctx context.Context,
if err != nil {
return nil, err
}
ret[k.String()+"s"] = lv
ret[k.PluralString()] = lv
}
}
return ret, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,9 @@ func toProto(in credential.Store, opt ...handlers.Option) (*pb.CredentialStore,
if outputFields.Has(globals.AuthorizedActionsField) {
out.AuthorizedActions = opts.WithAuthorizedActions
}
if outputFields.Has(globals.AuthorizedCollectionActionsField) {
out.AuthorizedCollectionActions = opts.WithAuthorizedCollectionActions
}
if outputFields.Has(globals.AttributesField) {
switch credential.SubtypeFromId(in.GetPublicId()) {
case vault.Subtype:
Expand Down
9 changes: 9 additions & 0 deletions internal/types/resource/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ func (r Type) String() string {
}[r]
}

func (r Type) PluralString() string {
switch r {
case CredentialLibrary:
return "credential-libraries"
default:
return r.String() + "s"
}
}

var Map = map[string]Type{
Unknown.String(): Unknown,
All.String(): All,
Expand Down

0 comments on commit 61fabf7

Please sign in to comment.