Skip to content

Commit d767c4d

Browse files
committed
remove extra auth types
until a better method for distributing the sdk auth package exists this is a pain point that would be better served as a plugin/addon
1 parent a63eaba commit d767c4d

File tree

2 files changed

+2
-28
lines changed

2 files changed

+2
-28
lines changed

Hologram/HologramCloud.py

+2-27
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import json
1313
import sys
1414
from Hologram.CustomCloud import CustomCloud
15-
from HologramAuth import TOTPAuthentication, SIMOTPAuthentication
1615
from Hologram.Authentication import CSRPSKAuthentication
1716
from Exceptions.HologramError import HologramError
1817

@@ -40,9 +39,7 @@
4039
class HologramCloud(CustomCloud):
4140

4241
_authentication_handlers = {
43-
'csrpsk' : CSRPSKAuthentication.CSRPSKAuthentication,
44-
'totp' : TOTPAuthentication.TOTPAuthentication,
45-
'sim-otp' : SIMOTPAuthentication.SIMOTPAuthentication,
42+
'csrpsk' : CSRPSKAuthentication.CSRPSKAuthentication
4643
}
4744

4845
_errorCodeDescription = {
@@ -60,7 +57,7 @@ class HologramCloud(CustomCloud):
6057
}
6158

6259
def __init__(self, credentials, enable_inbound=False, network='',
63-
authentication_type='totp'):
60+
authentication_type='csrpsk'):
6461
super().__init__(credentials,
6562
send_host=HOLOGRAM_HOST_SEND,
6663
send_port=HOLOGRAM_PORT_SEND,
@@ -71,9 +68,6 @@ def __init__(self, credentials, enable_inbound=False, network='',
7168

7269
self.setAuthenticationType(credentials, authentication_type=authentication_type)
7370

74-
if self.authenticationType == 'totp':
75-
self.__populate_totp_credentials()
76-
7771
# EFFECTS: Authentication Configuration
7872
def setAuthenticationType(self, credentials, authentication_type='csrpsk'):
7973

@@ -91,10 +85,6 @@ def sendMessage(self, message, topics=None, timeout=DEFAULT_SEND_MESSAGE_TIMEOUT
9185
self.addPayloadToBuffer(message)
9286
return ''
9387

94-
# Set the appropriate credentials required for sim otp authentication.
95-
if self.authenticationType == 'sim-otp':
96-
self.__populate_sim_otp_credentials()
97-
9888
modem_type = None
9989
modem_id = None
10090
if self.network is not None:
@@ -119,21 +109,6 @@ def __parse_result(self, result):
119109

120110
return resultList[0]
121111

122-
def __populate_totp_credentials(self):
123-
try:
124-
self.authentication.credentials['device_id'] = self.network.iccid
125-
self.authentication.credentials['private_key'] = self.network.imsi
126-
except Exception as e:
127-
self.logger.error('Unable to fetch device id or private key')
128-
129-
def __populate_sim_otp_credentials(self):
130-
nonce = self.request_hex_nonce()
131-
command = self.authentication.generate_sim_otp_command(imsi=self.network.imsi,
132-
iccid=self.network.iccid,
133-
nonce=nonce)
134-
modem_response = self.network.get_sim_otp_response(command)
135-
self.authentication.generate_sim_otp_token(modem_response)
136-
137112
def sendSMS(self, destination_number, message):
138113

139114
self.__enforce_authentication_type_supported_for_sms()

requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ mock~=3.0.5
33
pyroute2==0.5.*
44
pyserial~=3.4.0
55
python-pppd==1.0.3
6-
python-sdk-auth~=0.3.0
76
pyudev~=0.21.0
87
pyusb~=1.0.2
98
psutil~=5.6.3

0 commit comments

Comments
 (0)