Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
class DeviceUnblacklistMessage(_VerificationMessage):
pass
@attr.s
class SasMessage(_VerificationMessage):
pass
@attr.s
class StartSasMessage(SasMessage):
pass
@attr.s
class CancelSasMessage(SasMessage):
pass
@attr.s
class ConfirmSasMessage(SasMessage):
pass
@attr.s
class AcceptSasMessage(SasMessage):
pass
@attr.s
class _SasSignal:
pan_user = attr.ib()
class DeviceBlacklistMessage(_VerificationMessage):
pass
@attr.s
class DeviceUnblacklistMessage(_VerificationMessage):
pass
@attr.s
class SasMessage(_VerificationMessage):
pass
@attr.s
class StartSasMessage(SasMessage):
pass
@attr.s
class CancelSasMessage(SasMessage):
pass
@attr.s
class ConfirmSasMessage(SasMessage):
pass
@attr.s
class AcceptSasMessage(SasMessage):
pass
class SasMessage(_VerificationMessage):
pass
@attr.s
class StartSasMessage(SasMessage):
pass
@attr.s
class CancelSasMessage(SasMessage):
pass
@attr.s
class ConfirmSasMessage(SasMessage):
pass
@attr.s
class AcceptSasMessage(SasMessage):
pass
@attr.s
class _SasSignal:
pan_user = attr.ib()
user_id = attr.ib()
device_id = attr.ib()
transaction_id = attr.ib()
)
logger.info(msg)
return
if isinstance(message, DeviceVerifyMessage):
await self._verify_device(message.message_id, client, device)
elif isinstance(message, DeviceUnverifyMessage):
await self._unverify_device(message.message_id, client, device)
elif isinstance(message, DeviceBlacklistMessage):
await self._blacklist_device(message.message_id, client, device)
elif isinstance(message, DeviceUnblacklistMessage):
await self._unblacklist_device(message.message_id, client, device)
elif isinstance(message, StartSasMessage):
await client.start_sas(message, device)
elif isinstance(message, SasMessage):
if isinstance(message, AcceptSasMessage):
await client.accept_sas(message)
elif isinstance(message, ConfirmSasMessage):
await client.confirm_sas(message)
elif isinstance(message, CancelSasMessage):
await client.cancel_sas(message)
elif isinstance(message, ExportKeysMessage):
path = os.path.abspath(os.path.expanduser(message.file_path))
logger.info(f"Exporting keys to {path}")
try:
await client.export_keys(path, message.passphrase)
except OSError as e:
info_msg = (
f"Error exporting keys for {client.user_id} to" f" {path} {e}"
class StartSasMessage(SasMessage):
pass
@attr.s
class CancelSasMessage(SasMessage):
pass
@attr.s
class ConfirmSasMessage(SasMessage):
pass
@attr.s
class AcceptSasMessage(SasMessage):
pass
@attr.s
class _SasSignal:
pan_user = attr.ib()
user_id = attr.ib()
device_id = attr.ib()
transaction_id = attr.ib()
@attr.s
class InviteSasSignal(_SasSignal):
pass
)
logger.info(msg)
return
if isinstance(message, DeviceVerifyMessage):
await self._verify_device(message.message_id, client, device)
elif isinstance(message, DeviceUnverifyMessage):
await self._unverify_device(message.message_id, client, device)
elif isinstance(message, DeviceBlacklistMessage):
await self._blacklist_device(message.message_id, client, device)
elif isinstance(message, DeviceUnblacklistMessage):
await self._unblacklist_device(message.message_id, client, device)
elif isinstance(message, StartSasMessage):
await client.start_sas(message, device)
elif isinstance(message, SasMessage):
if isinstance(message, AcceptSasMessage):
await client.accept_sas(message)
elif isinstance(message, ConfirmSasMessage):
await client.confirm_sas(message)
elif isinstance(message, CancelSasMessage):
await client.cancel_sas(message)
elif isinstance(message, ExportKeysMessage):
path = os.path.abspath(os.path.expanduser(message.file_path))
logger.info(f"Exporting keys to {path}")
try:
await client.export_keys(path, message.passphrase)
except OSError as e:
info_msg = (
f"Error exporting keys for {client.user_id} to" f" {path} {e}"