Skip to content

Commit

Permalink
chore: expose check command (#1058)
Browse files Browse the repository at this point in the history
  • Loading branch information
hperl authored Oct 10, 2022
1 parent a15c5ad commit b80c42b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/check/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (o *checkOutput) String() string {

const FlagMaxDepth = "max-depth"

func newCheckCmd() *cobra.Command {
func NewCheckCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "check <subject> <relation> <namespace> <object>",
Short: "Check whether a subject has a relation on an object",
Expand Down Expand Up @@ -78,7 +78,7 @@ func newCheckCmd() *cobra.Command {
}

func RegisterCommandsRecursive(parent *cobra.Command) {
parent.AddCommand(newCheckCmd())
parent.AddCommand(NewCheckCmd())
}

func parseSubject(s string) (*rts.Subject, error) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/check/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

func TestCheckCommand(t *testing.T) {
nspace := &namespace.Namespace{Name: t.Name()}
ts := client.NewTestServer(t, client.ReadServer, []*namespace.Namespace{nspace}, newCheckCmd)
ts := client.NewTestServer(t, client.ReadServer, []*namespace.Namespace{nspace}, NewCheckCmd)
defer ts.Shutdown(t)

stdOut := ts.Cmd.ExecNoErr(t, "subject", "access", nspace.Name, "object",
Expand Down

0 comments on commit b80c42b

Please sign in to comment.