diff --git a/Hologram/HologramCloud.py b/Hologram/HologramCloud.py index f2bf44d..6bd7229 100755 --- a/Hologram/HologramCloud.py +++ b/Hologram/HologramCloud.py @@ -12,7 +12,6 @@ import json import sys from Hologram.CustomCloud import CustomCloud -from HologramAuth import TOTPAuthentication, SIMOTPAuthentication from Hologram.Authentication import CSRPSKAuthentication from Exceptions.HologramError import HologramError @@ -40,9 +39,7 @@ class HologramCloud(CustomCloud): _authentication_handlers = { - 'csrpsk' : CSRPSKAuthentication.CSRPSKAuthentication, - 'totp' : TOTPAuthentication.TOTPAuthentication, - 'sim-otp' : SIMOTPAuthentication.SIMOTPAuthentication, + 'csrpsk' : CSRPSKAuthentication.CSRPSKAuthentication } _errorCodeDescription = { @@ -60,7 +57,7 @@ class HologramCloud(CustomCloud): } def __init__(self, credentials, enable_inbound=False, network='', - authentication_type='totp'): + authentication_type='csrpsk'): super().__init__(credentials, send_host=HOLOGRAM_HOST_SEND, send_port=HOLOGRAM_PORT_SEND, @@ -71,9 +68,6 @@ def __init__(self, credentials, enable_inbound=False, network='', self.setAuthenticationType(credentials, authentication_type=authentication_type) - if self.authenticationType == 'totp': - self.__populate_totp_credentials() - # EFFECTS: Authentication Configuration def setAuthenticationType(self, credentials, authentication_type='csrpsk'): @@ -91,10 +85,6 @@ def sendMessage(self, message, topics=None, timeout=DEFAULT_SEND_MESSAGE_TIMEOUT self.addPayloadToBuffer(message) return '' - # Set the appropriate credentials required for sim otp authentication. - if self.authenticationType == 'sim-otp': - self.__populate_sim_otp_credentials() - modem_type = None modem_id = None if self.network is not None: @@ -119,21 +109,6 @@ def __parse_result(self, result): return resultList[0] - def __populate_totp_credentials(self): - try: - self.authentication.credentials['device_id'] = self.network.iccid - self.authentication.credentials['private_key'] = self.network.imsi - except Exception as e: - self.logger.error('Unable to fetch device id or private key') - - def __populate_sim_otp_credentials(self): - nonce = self.request_hex_nonce() - command = self.authentication.generate_sim_otp_command(imsi=self.network.imsi, - iccid=self.network.iccid, - nonce=nonce) - modem_response = self.network.get_sim_otp_response(command) - self.authentication.generate_sim_otp_token(modem_response) - def sendSMS(self, destination_number, message): self.__enforce_authentication_type_supported_for_sms() diff --git a/requirements.txt b/requirements.txt index 573eedc..af2a3b8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,6 @@ mock~=3.0.5 pyroute2==0.5.* pyserial~=3.4.0 python-pppd==1.0.3 -python-sdk-auth~=0.3.0 pyudev~=0.21.0 pyusb~=1.0.2 psutil~=5.6.3