Merge pull request #22567 from edx/feanil/fix_id_verification_errors

Ensure that photo verification data is correctly typed.
This commit is contained in:
Feanil Patel
2019-12-18 16:31:52 -05:00
committed by GitHub
3 changed files with 3 additions and 3 deletions

View File

@@ -31,7 +31,7 @@ class Command(BaseCommand):
dest='verification_ids',
action='store',
nargs='+',
type=int,
type=str,
help='verifications id used to retry verification'
)

View File

@@ -837,7 +837,7 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
face_aes_key = codecs.decode(face_aes_key_str, 'hex')
rsa_key_str = settings.VERIFY_STUDENT["SOFTWARE_SECURE"]["RSA_PUBLIC_KEY"]
rsa_encrypted_face_aes_key = rsa_encrypt(face_aes_key, rsa_key_str)
return base64.b64encode(rsa_encrypted_face_aes_key)
return base64.b64encode(rsa_encrypted_face_aes_key).decode('utf-8')
def create_request(self, copy_id_photo_from=None):
"""

View File

@@ -176,7 +176,7 @@ def generate_signed_message(method, headers_dict, body_dict, access_key, secret_
# hmac needs a byte string for it's starting key, can't be unicode.
hashed = hmac.new(secret_key.encode('utf-8'), message.encode('utf-8'), sha256)
signature = binascii.b2a_base64(hashed.digest()).rstrip(b'\n')
signature = binascii.b2a_base64(hashed.digest()).rstrip(b'\n').decode('utf-8')
authorization_header = u"SSI {}:{}".format(access_key, signature)
message += '\n'