In #417 we introduced a bug where zed became unusable if there wasn't previously a context set by the user. This wasn't intentional; it should be valid to invoke zed entirely from the command line in isolation. This PR captures that behavior in a unit test and fixes the behavior.
Changes
Separate existence and fetching concerns for tokens
Handle cases where config file or token don't exist
Testing
See that tests go green. See that you can clear out your local context (or run from within a container): /zed schema write ./blah.zed --endpoint 127.0.0.1:50051 --token supersecretdevkey --insecure and not receive an error.
Description
In #417 we introduced a bug where
zed
became unusable if there wasn't previously a context set by the user. This wasn't intentional; it should be valid to invoke zed entirely from the command line in isolation. This PR captures that behavior in a unit test and fixes the behavior.Changes
Testing
See that tests go green. See that you can clear out your local context (or run from within a container):
/zed schema write ./blah.zed --endpoint 127.0.0.1:50051 --token supersecretdevkey --insecure
and not receive an error.