Files
threshold/internal/tests/cli/boundary/_target_credential_sources.bash
T
429247f407 [COMPLIANCE] Update Copyright Headers (#6282)
* [COMPLIANCE] Update Copyright and License Headers

* chore: make gen to generate files with copyright headers

* chore: update missed copyright headers

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Justin Nguyen <justin.nguyen@hashicorp.com>
2026-01-28 11:05:07 -06:00

56 lines
1.2 KiB
Bash

# Copyright IBM Corp. 2020, 2025
# SPDX-License-Identifier: BUSL-1.1
load _authorized_actions
function add_target_brokered_credential_sources() {
for i in "${@:2}"
do
cred+="-brokered-credential-source $i "
done
boundary targets add-credential-sources -id $1 $cred
}
function remove_target_brokered_credential_sources() {
for i in "${@:2}"
do
cred+="-brokered-credential-source $i "
done
boundary targets remove-credential-sources -id $1 $cred
}
function set_target_brokered_credential_sources() {
for i in "${@:2}"
do
cred+="-brokered-credential-source $i "
done
boundary targets set-credential-sources -id $1 $cred
}
function validate_credential_sources() {
targetData=$(boundary targets read -id $1 -format json)
for i in "${@:2}"
do
if ! echo "$targetData" | grep -q $i; then
echo "Credential source id '$i' not found on target"
echo "$targetData"
exit 1
fi
done
}
function validate_credential_sources_not_present() {
targetData=$(boundary targets read -id $1 -format json)
for i in "${@:2}"
do
if echo "$targetData" | grep -q $i; then
echo "Credential source id '$i' unexpectedly found on target"
echo "$targetData"
exit 1
fi
done
}