homeassistant: Check invalid characters in user

This commit is contained in:
Timo Makinen 2023-01-29 21:41:01 +00:00
parent c5802078c4
commit 9946bd838b

View file

@ -2,6 +2,10 @@
set -eu
if [ "$(echo "$username" | sed -r 's/^[a-z]+$/x/')" != "x" ]; then
exit 2
fi
curl -sf -X POST -H "Content-Type: application/json" -d @- \
https://id.foo.sh/authcheck <<EOF
{"username": "${username}", "password": "${password}", "group": "foosh"}