use ego-mgr for username/email instead of CLI flags

This commit is contained in:
lyn
2026-03-24 19:18:20 +00:00
parent 2d37e9d55f
commit b9785b6295
5 changed files with 48 additions and 69 deletions

View File

@@ -3,29 +3,12 @@
# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# Optional explicit username
username=""
while [[ $# -gt 0 ]]; do
case $1 in
--username)
username="$2"
shift 2
;;
*)
echo "Unknown option: $1"
echo "Usage: $0 [--username <username>]"
exit 1
;;
esac
done
# Get username from ego-mgr
username=$(ego-mgr get default-username)
# Default to secret-mgr if not provided
# Check if username is provided
if [[ -z "$username" ]]; then
username=$(secret-mgr get-username --key keycloak)
fi
if [[ -z "$username" ]]; then
echo "Error: No keycloak username found in secret-mgr"
echo "Error: default-username not set in ego-mgr, please contact ard"
exit 1
fi