From 5e97ab0c9c5886b10fcb6bb12eb90bd6aadba9b0 Mon Sep 17 00:00:00 2001 From: Rafael Tenfen Date: Mon, 12 Aug 2024 13:43:51 -0300 Subject: [PATCH] chore: update regex to verify email and add exit 1 if email verification fails (#270) --- bbn-1/finality-providers/scripts/verify-valid-fp.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bbn-1/finality-providers/scripts/verify-valid-fp.sh b/bbn-1/finality-providers/scripts/verify-valid-fp.sh index bc4bb2c3..f613bfda 100755 --- a/bbn-1/finality-providers/scripts/verify-valid-fp.sh +++ b/bbn-1/finality-providers/scripts/verify-valid-fp.sh @@ -7,7 +7,7 @@ # valid finality provider registration. CWD="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" -regexEmail="^[a-z0-9!#\$%&'*+/=?^_\`{|}~-]+(\.[a-z0-9!#$%&'*+/=?^_\`{|}~-]+)*@([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]([a-z0-9-]*[a-z0-9])?\$" +regexEmail="^(([A-Za-z0-9]+((\.|\-|\_|\+)?[A-Za-z0-9]?)*[A-Za-z0-9]+)|[A-Za-z0-9]+)@(([A-Za-z0-9]+)+((\.|\-|\_)?([A-Za-z0-9]+)+)*)+\.([A-Za-z]{2,})+$" NICKNAME=${1:-""} EOTSD_BIN="${EOTSD_BIN:-eotsd}" @@ -59,6 +59,7 @@ fi if ! [[ $securityContact =~ $regexEmail ]]; then echo "$securityContact is not a valid email. Check whether you passed a valid finality provider email." + exit 1 fi commission=$(cat "$fpFilePath" | jq -r '.commission')