class_docstr: Implementation of ZAP authentication for zmq connections.
  
  Note:
  
  - libzmq provides four levels of security: default NULL (which the Authenticator does
    not see), and authenticated NULL, PLAIN, CURVE, and GSSAPI, which the Authenticator can see.
  - until you add policies, all incoming NULL connections are allowed.
    (classic ZeroMQ behavior), and all PLAIN and CURVE connections are denied.
  - GSSAPI requires no configuration.
docstr: PLAIN ZAP authentication
docstr_tok: ["PLAIN","ZAP","authentication"]
code: def _authenticate_plain(self, domain, username, password):
      """PLAIN ZAP authentication"""
      allowed = False
      reason = b""
      if self.passwords:
          # If no domain is not specified then use the default domain
          if not domain:
              domain = "*"
  
          if domain in self.passwords:
              if username in self.passwords[domain]:
                  if password == self.passwords[domain][username]:
                      allowed = True
                  else:
                      reason = b"Invalid password"
              else:
                  reason = b"Invalid username"
          else:
              reason = b"Invalid domain"
  
          if allowed:
              self.log.debug(
                  "ALLOWED (PLAIN) domain=%s username=%s password=%s",
                  domain,
                  username,
                  password,
              )
          else:
              self.log.debug("DENIED %s", reason)
  
      else:
          reason = b"No passwords defined"
          self.log.debug("DENIED (PLAIN) %s", reason)
  
      return allowed, reason
  
imports: import logging
  import zmq
  from zmq.utils import z85
  from zmq.utils.strtypes import bytes, unicode, b, u
  from zmq.error import _check_version
  from .certs import load_certificates
label_desc: Use image node_id 12 for calling the Authenticator obj's underlying member method code with example usage: obj._authenticate_plain(domain, username, password) and returns: allowed,  reason