When using the json output of the cli (`-format=json`), a successful call to the controller API would place the HTTP status code in the JSON as `status_code`. However, if there was an error from the API the status code would be placed in the JSON as `status`. In order to be consistent, this adds a `status_code` field to the error response case. For backwards compatibility it still populates `status` in the error case. This inconsistency was missed partially due to a bug in the CLI tests. The assertion on status code was not valid and would always be successful. Thus this also fixes the assertions and tests.
35 lines
794 B
Bash
35 lines
794 B
Bash
load _authorized_actions
|
|
|
|
function create_static_credential_store() {
|
|
local name=$1
|
|
local sid=$2
|
|
|
|
boundary credential-stores create static \
|
|
-name $name \
|
|
-description 'test static credential store' \
|
|
-scope-id $sid
|
|
}
|
|
|
|
function create_vault_credential_store() {
|
|
boundary credential-stores create vault $@
|
|
}
|
|
|
|
function read_credential_store() {
|
|
boundary credential-stores read -id $1 -format json
|
|
}
|
|
|
|
function delete_credential_store() {
|
|
boundary credential-stores delete -id $1 -format json
|
|
}
|
|
|
|
function list_credential_stores() {
|
|
boundary credential-stores list -scope-id $1 -format json
|
|
}
|
|
|
|
function credential_store_id() {
|
|
local name=$1
|
|
local sid=$2
|
|
|
|
strip $(list_credential_stores $sid | jq -c ".items[] | select(.name | contains(\"$name\")) | .[\"id\"]")
|
|
}
|