add attic action, attic token script

Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
2025-01-25 22:31:01 -05:00
parent 32190dec68
commit 9de9cdeab3
4 changed files with 49 additions and 3 deletions

31
utils/attic-token.bash Normal file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env bash
cache=""
cache_pattern=""
token_type=""
case $token_type in
"cache-creator")
atticd-atticadm make-token --sub "$cache-cache-creator" --validity "1y" \
--pull "$cache_pattern" --push "$cache_pattern" --delete "$cache_pattern" \
--create-cache "$cache_pattern" --configure-cache "$cache_pattern" \
--configure-cache-retention "$cache_pattern" --destroy-cache "$cache_pattern"
;;
"admin")
atticd-atticadm make-token --sub "$cache-admin" --validity "1y" --pull "$cache_pattern" \
--push "$cache_pattern" --configure-cache "$cache_pattern" \
--configure-cache-pattern "$cache_pattern"
;;
"writer")
atticd-atticadm make-token --sub "$cache-writer" --validity "1y" --pull "$cache_pattern" \
--push "$cache_pattern"
;;
"reader")
atticd-atticadm make-token --sub "$cache-reader" --validity "1y" --pull "$cache_pattern"
;;
*)
echo "invalid token type: $token_type"
echo "available options: cache-creator, admin, writer, reader"
exit 1
;;
esac