Merge branch 'master' of git.callpipe.com:finn/signald-test-infrastructure

This commit is contained in:
Finn Herzfeld 2018-12-05 01:13:17 -08:00
commit e752e32825
3 changed files with 64 additions and 0 deletions

View file

@ -0,0 +1,6 @@
#!/bin/bash
set -euo pipefail
for patch in /tmp/signal-server-patches/*.patch; do
echo "patch -p1 < \$patch"
patch -p1 < $patch
done

View file

@ -0,0 +1,56 @@
diff --git a/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java b/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java
index 8b62e0f..0e68bb0 100644
--- a/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java
+++ b/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java
@@ -16,15 +16,12 @@
*/
package org.whispersystems.textsecuregcm.sms;
-
-import com.twilio.sdk.TwilioRestException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.Optional;
-@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
public class SmsSender {
static final String SMS_IOS_VERIFICATION_TEXT = "Your Signal verification code: %s\n\nOr tap: sgnl://verify/%s";
@@ -33,11 +30,8 @@ public class SmsSender {
private final Logger logger = LoggerFactory.getLogger(SmsSender.class);
- private final TwilioSmsSender twilioSender;
+ public SmsSender(TwilioSmsSender twilioSender) {
- public SmsSender(TwilioSmsSender twilioSender)
- {
- this.twilioSender = twilioSender;
}
public void deliverSmsVerification(String destination, Optional<String> clientType, String verificationCode)
@@ -48,20 +42,12 @@ public class SmsSender {
destination = "+521" + destination.substring(3);
}
- try {
- twilioSender.deliverSmsVerification(destination, clientType, verificationCode);
- } catch (TwilioRestException e) {
- logger.info("Twilio SMS Failed: " + e.getErrorMessage());
- }
+ logger.info("Sending SMS verification code to " + destination + ": " + destination);
}
public void deliverVoxVerification(String destination, String verificationCode)
throws IOException
{
- try {
- twilioSender.deliverVoxVerification(destination, verificationCode);
- } catch (TwilioRestException e) {
- logger.info("Twilio Vox Failed: " + e.getErrorMessage());
- }
+ logger.info("Sending voice verification code to " + destination + ": " + verificationCode);
}
}

View file

@ -2,6 +2,8 @@ FROM debian:9 as build
RUN apt-get update && apt-get install -y openjdk-8-jdk-headless maven git
RUN git -C /usr/local/src clone https://github.com/signalapp/Signal-Server
WORKDIR /usr/local/src/Signal-Server
COPY signal-server-patches /tmp/signal-server-patches
RUN /tmp/signal-server-patches/apply-patches.sh
RUN mvn install -DskipTests
RUN ls -lha target