Skip to content

Commit

Permalink
Add assertions for bytes user and key
Browse files Browse the repository at this point in the history
  • Loading branch information
cygnusb committed Apr 5, 2019
1 parent 7ff943d commit b01aee1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pypureomapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,11 @@ def __init__(self, user, key):
@raises binascii.Error: for bad base64 encoding
"""
OmapiAuthenticatorBase.__init__(self)
if user is not None:
assert isinstance(user, bytes)
self.user = user
if key is not None:
assert isinstance(key, bytes)
self.key = binascii.a2b_base64(key)

def auth_object(self):
Expand Down

0 comments on commit b01aee1

Please sign in to comment.