1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#!/usr/bin/env bash
case "${1}" in
get)
read REGISTRY
case "${REGISTRY}" in
("registry-a.com") echo "{\"ServerURL\":\"${REGISTRY}\",\"Username\":\"foo\",\"Secret\":\"bar\"}" ;;
("registry-b.com") echo "{\"ServerURL\":\"${REGISTRY}\",\"Username\":\"<token>\",\"Secret\":\"fizzbuzz\"}" ;;
("registry-no-creds.com") echo "credentials not found in native keychain" && exit 1 ;;
(*) echo "{}" ;;
esac
exit 0
;;
store)
read UNUSED
exit 0
;;
list)
read UNUSED
echo "{\"registry-a.com\":\"foo\"}"
exit 0
;;
*)
echo "not implemented"
exit 1
;;
esac
|