gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated: Importing the SMS/e-mail commands to s


From: gnunet
Subject: [libeufin] branch master updated: Importing the SMS/e-mail commands to send the TAN.
Date: Mon, 16 Jan 2023 20:38:46 +0100

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new e63854eb Importing the SMS/e-mail commands to send the TAN.
e63854eb is described below

commit e63854eb7b08631c813e2ae79bfea0239993497a
Author: MS <ms@taler.net>
AuthorDate: Mon Jan 16 20:38:04 2023 +0100

    Importing the SMS/e-mail commands to send the TAN.
---
 contrib/libeufin-tan-email.sh |  3 +++
 contrib/libeufin-tan-sms.sh   | 28 ++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/contrib/libeufin-tan-email.sh b/contrib/libeufin-tan-email.sh
new file mode 100755
index 00000000..d27f7832
--- /dev/null
+++ b/contrib/libeufin-tan-email.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+# This file is in the public domain.
+exec mail -s "Libeufin" -r noreply "$1"
diff --git a/contrib/libeufin-tan-sms.sh b/contrib/libeufin-tan-sms.sh
new file mode 100755
index 00000000..ddfc649f
--- /dev/null
+++ b/contrib/libeufin-tan-sms.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+# This file is in the public domain.
+set -eu
+. telesign-secrets
+# Set AUTH_TOKEN=...
+
+MESSAGE=`cat -`
+TMPFILE=`mktemp /tmp/sms-loggingXXXXXX`
+STATUS=$(curl --request POST \
+     --url https://rest-api.telesign.com/v1/messaging \
+     --header 'authorization: Basic $AUTH_TOKEN' \
+     --header 'content-type: application/x-www-form-urlencoded' \
+     --data account_livecycle_event=transact \
+     --data "message=$MESSAGE" \
+     --data message_type=OTP \
+     --data "phone_number=$1" \
+     -w "%{http_code}" -s -o $TMPFILE)
+echo `cat $TMPFILE` >> /var/log/sms.log
+rm -f $TMPFILE
+case $STATUS in
+    200|203|250|290|291|295)
+        exit 0;
+        ;;
+    *)
+        exit 1;
+        ;;
+esac
+exit 1

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]