atomic_p2p.mixin.authenticator package

Submodules

atomic_p2p.mixin.authenticator.default_authenticator module

class atomic_p2p.mixin.authenticator.default_authenticator.DefaultAuthenticatorMixin

Bases: atomic_p2p.abc.authenticator.AuthenticatorABC

This class provide a peer’s ability to decide a packet is allow to be process

by higer layer in Peer or not.

The class which inherit this mixin should contain some fileds and methods:
  1. fields: (1) program_hash: a hash str for recognize packet is safe or not.

    Usually a hash of whole program can prevent Man-in-Middle attack.

    1. logger: logger for everything.

  2. methods: (1) _on_packet: The method to keep process packet to higher level when

    authenticate success.

    1. pend_packet: The method to queue a socket to process schedule of a Peer.

Module contents

class atomic_p2p.mixin.authenticator.DefaultAuthenticatorMixin

Bases: atomic_p2p.abc.authenticator.AuthenticatorABC

This class provide a peer’s ability to decide a packet is allow to be process

by higer layer in Peer or not.

The class which inherit this mixin should contain some fileds and methods:
  1. fields: (1) program_hash: a hash str for recognize packet is safe or not.

    Usually a hash of whole program can prevent Man-in-Middle attack.

    1. logger: logger for everything.

  2. methods: (1) _on_packet: The method to keep process packet to higher level when

    authenticate success.

    1. pend_packet: The method to queue a socket to process schedule of a Peer.