How to use the pantalaimon.thread_messages.SasMessage function in pantalaimon

To help you get started, we’ve selected a few pantalaimon examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matrix-org / pantalaimon / pantalaimon / thread_messages.py View on Github external
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()
github matrix-org / pantalaimon / pantalaimon / thread_messages.py View on Github external
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
github matrix-org / pantalaimon / pantalaimon / thread_messages.py View on Github external
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()
github matrix-org / pantalaimon / pantalaimon / daemon.py View on Github external
)
                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}"
github matrix-org / pantalaimon / pantalaimon / thread_messages.py View on Github external
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
github matrix-org / pantalaimon / pantalaimon / daemon.py View on Github external
)
                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}"