zed
A client for managing authzed or any API-compatible system from your command line.
Installation
zed is currently packaged by as a head-only Homebrew Formula for both macOS and Linux.
$ brew install --HEAD authzed/tap/zed
Example Usage
Managing credentials
Configuring credentials is similar to kubeconfig in kubectl.
API Tokens are stored in the system keychain.
$ zed config set-token [email protected] tu_zed_hanazawa_deadbeefdeadbeefdeadbeefdeadbeef
NAME ENDPOINT TOKEN
[email protected] grpc.authzed.com:443
$ zed config get-tokens
NAME ENDPOINT TOKEN
[email protected] grpc.authzed.com:443
Context data is stored in $XDG_CONFIG_HOME/zed
falling back to ~/.zed
if that environment variable is not set.
$ zed config set-context rbac rbac_example [email protected]
NAME TENANT TOKEN NAME ENDPOINT CURRENT
rbac rbac_example [email protected] grpc.authzed.com:443
$ zed config use-context rbac
NAME TENANT TOKEN NAME ENDPOINT CURRENT
rbac rbac_example [email protected] grpc.authzed.com:443 true
The environment variables $ZED_TENANT
, $ZED_TOKEN
, and $ZED_ENDPOINT
can be used to override their respective values in the current context.
Explore relationships
The describe
command provides a tree view of a namespace definition.
$ zed describe document
document
├── writer
└── reader
└── union
├── _this
└── TUPLE_OBJECT: writer
The expand
command provides a tree view of a relation of a particular object.
$ zed expand document:firstdoc reader
document:firstdoc reader
└── union
├── user:fred
└── document:firstdoc writer
└── user:tom
When piped or provided the --json
flag, API responses are converted into JSON.
$ zed describe document | jq '.config.relation[0].name'
"writer"
Modify relationships
$ zed check user:jimmy document:firstdoc reader
false
$ zed create user:jimmy document:firstdoc writer
CAESAwiLBA==
$ zed check user:jimmy document:firstdoc writer
true
$ zed check user:jimmy document:firstdoc reader
true
$ zed delete user:jimmy document:firstdoc writer
CAESAwiMBA==
$ zed check user:jimmy document:firstdoc reader
false
$ zed check user:jimmy document:firstdoc writer
false