Skip to content

Commit

Permalink
Add support for recursive listing (#885)
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferai authored Jan 26, 2021
1 parent 1f9fcad commit 6cd97a4
Show file tree
Hide file tree
Showing 77 changed files with 2,241 additions and 1,445 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Canonical reference for changes, improvements, and bugfixes for Boundary.
* Boundary now uses Go's new execabs package for execution of binaries in
`boundary connect`. This is for defense-in-depth rather than a specific
issue. See the [Go blog post](https://blog.golang.org/path-security) for more
details. ([PR](https://github.com/hashicorp/boundary/pull/873))
details. ([PR](https://github.com/hashicorp/boundary/pull/873))

### Changes/Deprecations

Expand All @@ -24,6 +24,9 @@ Canonical reference for changes, improvements, and bugfixes for Boundary.
* api/cli: On listing/reading, return a list of actions the user is authorized
to perform on the identified resources or their associated collections
([PR](https://github.com/hashicorp/boundary/pull/870))
* api/cli: Most resource types now support recursive listing, allowing listing
to occur down a scope tree
([PR](https://github.com/hashicorp/boundary/pull/885))
* cli: Add a `database migrate` command which updates a database's schema to
the version supported by the boundary binary ([PR](https://github.com/hashicorp/boundary/pull/872)).

Expand Down
14 changes: 14 additions & 0 deletions api/authmethods/option.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package authmethods

import (
"strconv"

"github.com/hashicorp/boundary/api"
)

Expand All @@ -18,6 +20,7 @@ type options struct {
queryMap map[string]string
withAutomaticVersioning bool
withSkipCurlOutput bool
withRecursive bool
}

func getDefaultOptions() options {
Expand All @@ -36,6 +39,9 @@ func getOpts(opt ...Option) (options, []api.Option) {
if opts.withSkipCurlOutput {
apiOpts = append(apiOpts, api.WithSkipCurlOutput(true))
}
if opts.withRecursive {
opts.queryMap["recursive"] = strconv.FormatBool(opts.withRecursive)
}
return opts, apiOpts
}

Expand All @@ -57,6 +63,14 @@ func WithSkipCurlOutput(skip bool) Option {
}
}

// WithRecursive tells the API to use recursion for listing operations on this
// resource
func WithRecursive(recurse bool) Option {
return func(o *options) {
o.withRecursive = true
}
}

func WithAttributes(inAttributes map[string]interface{}) Option {
return func(o *options) {
o.postMap["attributes"] = inAttributes
Expand Down
14 changes: 14 additions & 0 deletions api/authtokens/option.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package authtokens

import (
"strconv"

"github.com/hashicorp/boundary/api"
)

Expand All @@ -18,6 +20,7 @@ type options struct {
queryMap map[string]string
withAutomaticVersioning bool
withSkipCurlOutput bool
withRecursive bool
}

func getDefaultOptions() options {
Expand All @@ -36,6 +39,9 @@ func getOpts(opt ...Option) (options, []api.Option) {
if opts.withSkipCurlOutput {
apiOpts = append(apiOpts, api.WithSkipCurlOutput(true))
}
if opts.withRecursive {
opts.queryMap["recursive"] = strconv.FormatBool(opts.withRecursive)
}
return opts, apiOpts
}

Expand All @@ -56,3 +62,11 @@ func WithSkipCurlOutput(skip bool) Option {
o.withSkipCurlOutput = true
}
}

// WithRecursive tells the API to use recursion for listing operations on this
// resource
func WithRecursive(recurse bool) Option {
return func(o *options) {
o.withRecursive = true
}
}
14 changes: 14 additions & 0 deletions api/groups/option.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package groups

import (
"strconv"

"github.com/hashicorp/boundary/api"
)

Expand All @@ -18,6 +20,7 @@ type options struct {
queryMap map[string]string
withAutomaticVersioning bool
withSkipCurlOutput bool
withRecursive bool
}

func getDefaultOptions() options {
Expand All @@ -36,6 +39,9 @@ func getOpts(opt ...Option) (options, []api.Option) {
if opts.withSkipCurlOutput {
apiOpts = append(apiOpts, api.WithSkipCurlOutput(true))
}
if opts.withRecursive {
opts.queryMap["recursive"] = strconv.FormatBool(opts.withRecursive)
}
return opts, apiOpts
}

Expand All @@ -57,6 +63,14 @@ func WithSkipCurlOutput(skip bool) Option {
}
}

// WithRecursive tells the API to use recursion for listing operations on this
// resource
func WithRecursive(recurse bool) Option {
return func(o *options) {
o.withRecursive = true
}
}

func WithDescription(inDescription string) Option {
return func(o *options) {
o.postMap["description"] = inDescription
Expand Down
14 changes: 14 additions & 0 deletions api/hostcatalogs/option.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package hostcatalogs

import (
"strconv"

"github.com/hashicorp/boundary/api"
)

Expand All @@ -18,6 +20,7 @@ type options struct {
queryMap map[string]string
withAutomaticVersioning bool
withSkipCurlOutput bool
withRecursive bool
}

func getDefaultOptions() options {
Expand All @@ -36,6 +39,9 @@ func getOpts(opt ...Option) (options, []api.Option) {
if opts.withSkipCurlOutput {
apiOpts = append(apiOpts, api.WithSkipCurlOutput(true))
}
if opts.withRecursive {
opts.queryMap["recursive"] = strconv.FormatBool(opts.withRecursive)
}
return opts, apiOpts
}

Expand All @@ -57,6 +63,14 @@ func WithSkipCurlOutput(skip bool) Option {
}
}

// WithRecursive tells the API to use recursion for listing operations on this
// resource
func WithRecursive(recurse bool) Option {
return func(o *options) {
o.withRecursive = true
}
}

func WithAttributes(inAttributes map[string]interface{}) Option {
return func(o *options) {
o.postMap["attributes"] = inAttributes
Expand Down
13 changes: 13 additions & 0 deletions api/scopes/option.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package scopes

import (
"fmt"
"strconv"

"github.com/hashicorp/boundary/api"
)
Expand All @@ -20,6 +21,7 @@ type options struct {
queryMap map[string]string
withAutomaticVersioning bool
withSkipCurlOutput bool
withRecursive bool
}

func getDefaultOptions() options {
Expand All @@ -38,6 +40,9 @@ func getOpts(opt ...Option) (options, []api.Option) {
if opts.withSkipCurlOutput {
apiOpts = append(apiOpts, api.WithSkipCurlOutput(true))
}
if opts.withRecursive {
opts.queryMap["recursive"] = strconv.FormatBool(opts.withRecursive)
}
return opts, apiOpts
}

Expand All @@ -59,6 +64,14 @@ func WithSkipCurlOutput(skip bool) Option {
}
}

// WithRecursive tells the API to use recursion for listing operations on this
// resource
func WithRecursive(recurse bool) Option {
return func(o *options) {
o.withRecursive = true
}
}

func WithDescription(inDescription string) Option {
return func(o *options) {
o.postMap["description"] = inDescription
Expand Down
14 changes: 14 additions & 0 deletions api/sessions/option.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package sessions

import (
"strconv"

"github.com/hashicorp/boundary/api"
)

Expand All @@ -18,6 +20,7 @@ type options struct {
queryMap map[string]string
withAutomaticVersioning bool
withSkipCurlOutput bool
withRecursive bool
}

func getDefaultOptions() options {
Expand All @@ -36,6 +39,9 @@ func getOpts(opt ...Option) (options, []api.Option) {
if opts.withSkipCurlOutput {
apiOpts = append(apiOpts, api.WithSkipCurlOutput(true))
}
if opts.withRecursive {
opts.queryMap["recursive"] = strconv.FormatBool(opts.withRecursive)
}
return opts, apiOpts
}

Expand All @@ -56,3 +62,11 @@ func WithSkipCurlOutput(skip bool) Option {
o.withSkipCurlOutput = true
}
}

// WithRecursive tells the API to use recursion for listing operations on this
// resource
func WithRecursive(recurse bool) Option {
return func(o *options) {
o.withRecursive = true
}
}
14 changes: 14 additions & 0 deletions api/targets/option.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package targets

import (
"strconv"

"github.com/hashicorp/boundary/api"
)

Expand All @@ -18,6 +20,7 @@ type options struct {
queryMap map[string]string
withAutomaticVersioning bool
withSkipCurlOutput bool
withRecursive bool
}

func getDefaultOptions() options {
Expand All @@ -36,6 +39,9 @@ func getOpts(opt ...Option) (options, []api.Option) {
if opts.withSkipCurlOutput {
apiOpts = append(apiOpts, api.WithSkipCurlOutput(true))
}
if opts.withRecursive {
opts.queryMap["recursive"] = strconv.FormatBool(opts.withRecursive)
}
return opts, apiOpts
}

Expand All @@ -57,6 +63,14 @@ func WithSkipCurlOutput(skip bool) Option {
}
}

// WithRecursive tells the API to use recursion for listing operations on this
// resource
func WithRecursive(recurse bool) Option {
return func(o *options) {
o.withRecursive = true
}
}

func WithAttributes(inAttributes map[string]interface{}) Option {
return func(o *options) {
o.postMap["attributes"] = inAttributes
Expand Down
14 changes: 14 additions & 0 deletions api/users/option.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package users

import (
"strconv"

"github.com/hashicorp/boundary/api"
)

Expand All @@ -18,6 +20,7 @@ type options struct {
queryMap map[string]string
withAutomaticVersioning bool
withSkipCurlOutput bool
withRecursive bool
}

func getDefaultOptions() options {
Expand All @@ -36,6 +39,9 @@ func getOpts(opt ...Option) (options, []api.Option) {
if opts.withSkipCurlOutput {
apiOpts = append(apiOpts, api.WithSkipCurlOutput(true))
}
if opts.withRecursive {
opts.queryMap["recursive"] = strconv.FormatBool(opts.withRecursive)
}
return opts, apiOpts
}

Expand All @@ -57,6 +63,14 @@ func WithSkipCurlOutput(skip bool) Option {
}
}

// WithRecursive tells the API to use recursion for listing operations on this
// resource
func WithRecursive(recurse bool) Option {
return func(o *options) {
o.withRecursive = true
}
}

func WithDescription(inDescription string) Option {
return func(o *options) {
o.postMap["description"] = inDescription
Expand Down
Loading

0 comments on commit 6cd97a4

Please sign in to comment.