You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running cloud service query against a service whose query endpoint hasn't been enabled (or doesn't list the caller's API key) returns HTTP 401 with a helpful hint (added in #115), but the user still has to run two more commands to fix it:
cloud key list # find my key ID
cloud service query-endpoint create <service-id> --open-api-key <key-id>
Proposed behaviour
When cloud service query hits 401 and the resolved auth source is an API key:
Look up the caller's API key in openapi_key_get_list by matching on the configured key string (we need a way to map a key string back to its UUID — see "How can I know what API key I'm authenticated with?" follow-up).
On an interactive TTY, prompt: Authorize your API key (<name> <uuid>) for this service's query endpoint? [y/N].
Problem
Running
cloud service queryagainst a service whose query endpoint hasn't been enabled (or doesn't list the caller's API key) returns HTTP 401 with a helpful hint (added in #115), but the user still has to run two more commands to fix it:Proposed behaviour
When
cloud service queryhits 401 and the resolved auth source is an API key:openapi_key_get_listby matching on the configured key string (we need a way to map a key string back to its UUID — see "How can I know what API key I'm authenticated with?" follow-up).Authorize your API key (<name> <uuid>) for this service's query endpoint? [y/N].--json,--no-interactive, or non-TTY stdin.Depends on
query-endpoint createso we don't blow away existing authorizations.Related