[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: SMS authorization script.
From: |
gnunet |
Subject: |
[libeufin] branch master updated: SMS authorization script. |
Date: |
Thu, 19 Jan 2023 14:58:07 +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 8c15ef1d SMS authorization script.
8c15ef1d is described below
commit 8c15ef1de61e9c6a49961a3d7fae95f5efbef6ac
Author: MS <ms@taler.net>
AuthorDate: Thu Jan 19 14:56:36 2023 +0100
SMS authorization script.
Adjusting the AUthorization header format.
---
contrib/libeufin-tan-sms.sh | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/contrib/libeufin-tan-sms.sh b/contrib/libeufin-tan-sms.sh
index ddfc649f..c4f489fa 100755
--- a/contrib/libeufin-tan-sms.sh
+++ b/contrib/libeufin-tan-sms.sh
@@ -1,21 +1,22 @@
#!/bin/sh
# This file is in the public domain.
+
set -eu
-. telesign-secrets
-# Set AUTH_TOKEN=...
+
+. telesign-secrets # need to be found in the PATH
+# Set CUSTOMER_ID and API_KEY
MESSAGE=`cat -`
TMPFILE=`mktemp /tmp/sms-loggingXXXXXX`
+
STATUS=$(curl --request POST \
+ --user "$CUSTOMER_ID:$API_KEY" \
--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_type=OTP" \
--data "message=$MESSAGE" \
- --data message_type=OTP \
--data "phone_number=$1" \
-w "%{http_code}" -s -o $TMPFILE)
-echo `cat $TMPFILE` >> /var/log/sms.log
+echo `cat $TMPFILE` >> $HOME/sms.log
rm -f $TMPFILE
case $STATUS in
200|203|250|290|291|295)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: SMS authorization script.,
gnunet <=