I'd like to have a useful Sentry CLI that is simple enough to send various
Thrift requests to the running Sentry server, so I wrote one. It is work in
progress, so a bunch of functionality is missing. Kerberos isn't supported
at all.

The tool and its documentation are available from
https://github.com/akolb1/sentrytool. To use it, you need a GO toolchain
installed (on Mac you can easily do this with brew install go). Once you
have it, you can do the following:


   1. mkdir ~/go
   2. export GOPATH=~/go
   3. go get -u -v github.com/akolb1/sentrytool

This will compile the tool and place it in ~/go/bin. The actual source code
will be in ~/go/src/github.com/akolb1/sentrytool

The documentation for the command options is documented using the tool
itself with `sentrytool doc' command.

Here are some examples:

$ sentrytool role list -v
any_role: ()
r2: (g1,g2,g3,g4)
r3: ()
r4: ()
r1: (g5,hive,bar,foo,baz)

$ sentrytool role rm r3 r4
delete 'r3'? y
delete 'r4'? y

$sentrytool role list
any_role
r2
r1

$ sentrytool role list -m role
any_role

# Grant group to a role
$ sentrytool group add r1 mygroup
$ sentrytool role ls -v r1
r2: (g1,g2,g3,g4)
r1: (baz,g5,hive,mygroup,bar,foo)
any_role: ()

# Select role by group
$ ./sentrytool role ls -v -g mygroup
r1: (foo,baz,g5,hive,mygroup,bar)

- Alex

Reply via email to