Files
threshold/internal/tests/cli/boundary/_credentials.bash
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.1 KiB
Bash
Raw Normal View History

2023-02-02 17:15:17 -08:00
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
2023-02-02 17:15:17 -08:00
load _authorized_actions
function create_username_password_credential() {
local name=$1
local sid=$2
local user=$3
local pass=$4
2023-02-01 20:54:08 +00:00
export BP="${pass}"
boundary credentials create username-password \
-name $name \
-description 'test username password credential' \
-credential-store-id $sid \
-username $user \
-password env://BP
}
2022-09-16 15:00:04 -07:00
function create_json_credential() {
local name=$1
local sid=$2
local args=$3
boundary credentials create json \
-name $name \
-description 'test json credential' \
-credential-store-id $sid \
$args
}
function read_credential() {
boundary credentials read -id $1 -format json
}
function delete_credential() {
2023-02-01 20:54:08 +00:00
boundary credentials delete -id $1 -format json
}
function list_credentials() {
boundary credentials list -credential-store-id $1 -format json
}
function credential_id() {
local name=$1
local sid=$2
2023-02-01 20:54:08 +00:00
strip $(list_credentials $sid | jq -c ".items[] | select(.name | contains(\"$name\")) | .[\"id\"]")
}