Skip to content

Commit

Permalink
Merge pull request #4 from mochipon/fix/hidekeys
Browse files Browse the repository at this point in the history
Hide secret keys from string rep of a key
  • Loading branch information
mochipon committed Jun 12, 2021
2 parents 97514e1 + 030e8c2 commit d09dbd6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pysesame3/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,4 @@ def __str__(self) -> str:
Returns:
str: The string representation of the object.
"""
return f"SesameLocker(deviceUUID={self.getDeviceUUID()}, deviceModel={self.productModel}, secretKey={self.getSecretKey()}, sesame2PublicKey={self.getSesame2PublicKey()})"
return f"SesameLocker(deviceUUID={self.getDeviceUUID()}, deviceModel={self.productModel}, sesame2PublicKey={self.getSesame2PublicKey()})"
2 changes: 1 addition & 1 deletion pysesame3/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ def __str__(self) -> str:
Returns:
str: The string representation of the object.
"""
return f"CHSesame2(deviceUUID={self.getDeviceUUID()}, deviceModel={self.productModel}, secretKey={self.getSecretKey()}, sesame2PublicKey={self.getSesame2PublicKey()}, mechStatus={self.mechStatus})"
return f"CHSesame2(deviceUUID={self.getDeviceUUID()}, deviceModel={self.productModel}, sesame2PublicKey={self.getSesame2PublicKey()}, mechStatus={self.mechStatus})"
2 changes: 1 addition & 1 deletion tests/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,5 @@ def test_CHDevices(self):

assert (
str(d)
== "SesameLocker(deviceUUID=42918AD1-8154-4AFF-BD1F-F0CDE88A8DE1, deviceModel=CHProductModel.SS2, secretKey=FAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKE, sesame2PublicKey=TestPubKey)"
== "SesameLocker(deviceUUID=42918AD1-8154-4AFF-BD1F-F0CDE88A8DE1, deviceModel=CHProductModel.SS2, sesame2PublicKey=TestPubKey)"
)
2 changes: 1 addition & 1 deletion tests/test_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_CHSesame2(self):
)
assert (
str(self.key_locked)
== "CHSesame2(deviceUUID=126D3D66-9222-4E5A-BCDE-0C6629D48D43, deviceModel=None, secretKey=0b3e5f1665e143b59180c915fa4b06d9, sesame2PublicKey=None, mechStatus=CHSesame2MechStatus(Battery=67% (5.87V), isInLockRange=True, isInUnlockRange=False, Position=11))"
== "CHSesame2(deviceUUID=126D3D66-9222-4E5A-BCDE-0C6629D48D43, deviceModel=None, sesame2PublicKey=None, mechStatus=CHSesame2MechStatus(Battery=67% (5.87V), isInLockRange=True, isInUnlockRange=False, Position=11))"
)

def test_CHSesame2_setDeviceShadowStatus_toggle(self):
Expand Down

0 comments on commit d09dbd6

Please sign in to comment.