From 9dc5388e053ff4f70ba0b5d52e69f80cf9a90813 Mon Sep 17 00:00:00 2001 From: Tanner Stirrat Date: Fri, 20 Sep 2024 08:47:26 -0700 Subject: [PATCH 1/2] Update README.md --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a6951e6f..9e1875da 100644 --- a/README.md +++ b/README.md @@ -75,16 +75,26 @@ sudo dnf install -y zed Contexts store connection credentials for accessing SpiceDB clusters securely in the OS keychain. Before performing most commands, a context must be set. -Alternatively, you can provide context values via environment variables which will override the existing context for that execution. The `zed context` subcommand has operations for setting the current, creating, listing, deleting contexts: ```sh zed context set prod grpc.authzed.com:443 tc_zed_my_laptop_deadbeefdeadbeefdeadbeefdeadbeef -zed context set dev localhost:80 testpresharedkey +zed context set dev localhost:80 testpresharedkey --insecure zed context list ``` +### Overriding Context +You can also provide context values via environment variables or CLI flags. If values are provided this way, they override +the context values in a piecemeal fashion: + +```sh +zed context set prod grpc.authzed.com:443 tc_zed_my_laptop_deadbeefdeadbeefdeadbeefdeadbeef + +# This will use the token and TLS values set above, but swap out the endpoint for the one provided. +zed permission check --endpoint my.authzed.domain:443 document:firstdoc writer user:emilia +``` + ### Headless usage If you provide all context values (e.g. `ZED_ENDPOINT`, `ZED_TOKEN`) as environment variables or flags (e.g. `--endpoint`, `--token`), you do not need to set a context. From 871e4202d5363aa2503654e3373195ad3354210d Mon Sep 17 00:00:00 2001 From: Tanner Stirrat Date: Fri, 20 Sep 2024 08:59:35 -0700 Subject: [PATCH 2/2] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9e1875da..d5754e84 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ zed context list ``` ### Overriding Context + You can also provide context values via environment variables or CLI flags. If values are provided this way, they override the context values in a piecemeal fashion: