Skip to content

Instantly share code, notes, and snippets.

@mkm29
Created December 17, 2023 17:08
Show Gist options
  • Save mkm29/a4a0771a21382e8d7f7f770d03d680f7 to your computer and use it in GitHub Desktop.
Save mkm29/a4a0771a21382e8d7f7f770d03d680f7 to your computer and use it in GitHub Desktop.
unlock_bw_if_locked() {
if [[ -z $BW_SESSION ]] ; then
>&2 echo 'bw locked - unlocking into a new session'
export BW_SESSION="$(bw unlock --raw)"
fi
}
load_ironbank() {
unlock_bw_if_locked
# Note that this ironbank_pat_id value will be different for you!
local -r ironbank_pat_id='ab69ee2f-b74f-4262-8105-b0db0111210d'
local ironbank_token
ironbank_token="$(bw get notes $ironbank_pat_id)"
export IRONBANK_HOST="registry1.dso.mil"
export IRONBANK_USERNAME="MitMurphy"
export IRONBANK_TOKEN="$ironbank_token"
}
load_ironbank "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment