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.
37 lines
859 B
Bash
37 lines
859 B
Bash
load _authorized_actions
|
|
|
|
function create_vault_ssh_certificate_library() {
|
|
boundary credential-libraries \
|
|
create vault-ssh-certificate $@
|
|
}
|
|
|
|
function create_vault_generic_library() {
|
|
boundary credential-libraries \
|
|
create vault-generic $@
|
|
}
|
|
|
|
function create_vault_library() {
|
|
boundary credential-libraries \
|
|
create vault $@
|
|
}
|
|
|
|
function read_credential_library() {
|
|
boundary credential-libraries read -id $1 -format json
|
|
}
|
|
|
|
function delete_credential_library() {
|
|
boundary credential-libraries delete -id $1 -format json
|
|
}
|
|
|
|
function list_credential_libraries() {
|
|
local csid=$1
|
|
boundary credential-libraries list -credential-store-id $1 -format json
|
|
}
|
|
|
|
function credential_library_id() {
|
|
local name=$1
|
|
local csid=$2
|
|
|
|
strip $(list_credential_libraries $csid | jq -c ".items[] | select(.name | contains(\"$name\")) | .[\"id\"]")
|
|
}
|