2023-02-02 17:15:17 -08:00
|
|
|
# Copyright (c) HashiCorp, Inc.
|
|
|
|
|
# SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
2020-10-12 10:26:26 -07:00
|
|
|
function create_account() {
|
2022-08-05 19:52:04 -04:00
|
|
|
export BP="${DEFAULT_PASSWORD}"
|
|
|
|
|
boundary accounts create password -login-name $1 -password env://BP -auth-method-id $DEFAULT_AMPW
|
2020-10-12 10:26:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function read_account() {
|
|
|
|
|
boundary accounts read -id $1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function delete_account() {
|
2023-02-01 20:54:08 +00:00
|
|
|
boundary accounts delete -id $1 -format json
|
2020-10-12 10:26:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function list_accounts() {
|
|
|
|
|
boundary accounts list -auth-method-id $DEFAULT_AMPW -format json
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function account_id() {
|
|
|
|
|
local acct=$1
|
2021-02-25 12:43:17 -05:00
|
|
|
strip $(list_accounts | jq -c ".items[] | select(.attributes.login_name | contains(\"$acct\")) | .[\"id\"]")
|
2020-10-12 10:26:26 -07:00
|
|
|
}
|