class_docstr: Implementation of ZAP authentication for zmq connections.
  
  This authenticator class does not register with an event loop. As a result,
  you will need to manually call `handle_zap_message`::
  
      auth = zmq.Authenticator()
      auth.allow("127.0.0.1")
      auth.start()
      while True:
          await auth.handle_zap_msg(auth.zap_socket.recv_multipart())
  
  Alternatively, you can register `auth.zap_socket` with a poller.
  
  Since many users will want to run ZAP in a way that does not block the
  main thread, other authentication classes (such as :mod:`zmq.auth.thread`)
  are provided.
  
  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.
class_docstr_tok: ["Implementation","of","ZAP","authentication","for","zmq","connections",".","This","authenticator","class","does","not","register","with","an","event","loop",".","As","a","result",",","you","will","need","to","manually","call","`","handle_zap_message","`",":",":","auth","=","zmq.Authenticator","(",")","auth.allow","(","``","127.0.0.1","''",")","auth.start","(",")","while","True",":","await","auth.handle_zap_msg","(","auth.zap_socket.recv_multipart","(",")",")","Alternatively",",","you","can","register","`","auth.zap_socket","`","with","a","poller",".","Since","many","users","will","want","to","run","ZAP","in","a","way","that","does","not","block","the","main","thread",",","other","authentication","classes","(","such","as",":","mod",":","`","zmq.auth.thread","`",")","are","provided",".","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: Configure CURVE authentication for a given domain.
  
  CURVE authentication uses a directory that holds all public client certificates,
  i.e. their public keys.
  
  To cover all domains, use "*".
  
  You can add and remove certificates in that directory at any time. configure_curve must be called
  every time certificates are added or removed, in order to update the Authenticator's state
  
  To allow all client keys without checking, specify CURVE_ALLOW_ANY for the location.
docstr_tok: ["Configure","CURVE","authentication","for","a","given","domain",".","CURVE","authentication","uses","a","directory","that","holds","all","public","client","certificates",",","i.e",".","their","public","keys",".","To","cover","all","domains",",","use","``","*","''",".","You","can","add","and","remove","certificates","in","that","directory","at","any","time",".","configure_curve","must","be","called","every","time","certificates","are","added","or","removed",",","in","order","to","update","the","Authenticator","'s","state","To","allow","all","client","keys","without","checking",",","specify","CURVE_ALLOW_ANY","for","the","location","."]
code: def configure_curve(
      self, domain: str = "*", location: Union[str, os.PathLike] = "."
  ) -> None:
      """Configure CURVE authentication for a given domain.
  
      CURVE authentication uses a directory that holds all public client certificates,
      i.e. their public keys.
  
      To cover all domains, use "*".
  
      You can add and remove certificates in that directory at any time. configure_curve must be called
      every time certificates are added or removed, in order to update the Authenticator's state
  
      To allow all client keys without checking, specify CURVE_ALLOW_ANY for the location.
      """
      # If location is CURVE_ALLOW_ANY then allow all clients. Otherwise
      # treat location as a directory that holds the certificates.
      self.log.debug("Configure curve: %s[%s]", domain, location)
      if location == CURVE_ALLOW_ANY:
          self.allow_any = True
      else:
          self.allow_any = False
          try:
              self.certs[domain] = load_certificates(location)
          except Exception as e:
              self.log.error(
                  "Failed to load CURVE certs from %s: %s", location, e
              )
  
imports: import logging
  import os
  from typing import Any, Awaitable, Dict, List, Optional, Set, Tuple, Union
  import zmq
  from zmq.error import _check_version
  from zmq.utils import z85
  from .certs import load_certificates
label_desc: Use image node_id 7 for calling the Authenticator obj's underlying member method code with example usage: obj.configure_curve(domain, location) without return types