Skip to content

Commit

Permalink
chore: update regex to verify email and add exit 1 if email verificat…
Browse files Browse the repository at this point in the history
…ion fails (babylonlabs-io#270)
  • Loading branch information
RafilxTenfen authored Aug 12, 2024
1 parent 65691c3 commit 5e97ab0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bbn-1/finality-providers/scripts/verify-valid-fp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 5e97ab0

Please sign in to comment.