Package org.zeromq

Class ZAuth


  • public class ZAuth
    extends Object
    ZAuth takes over authentication for all incoming connections in its context. Note that libzmq provides four levels of security: default NULL (which zauth does not see), and authenticated NULL, PLAIN, and CURVE, which zauth can see. Based on zauth.c in czmq
    • Constructor Detail

      • ZAuth

        public ZAuth​(ZContext ctx)
        Install authentication for the specified context. Note that until you add policies, all incoming NULL connections are allowed (classic ZeroMQ behaviour), and all PLAIN and CURVE connections are denied.
    • Method Detail

      • setVerbose

        public void setVerbose​(boolean verbose)
        Enable verbose tracing of commands and activity
        Parameters:
        verbose -
      • allow

        public void allow​(String address)
        Allow (whitelist) a single IP address. For NULL, all clients from this address will be accepted. For PLAIN and CURVE, they will be allowed to continue with authentication. You can call this method multiple times to whitelist multiple IP addresses. If you whitelist a single address, any non-whitelisted addresses are treated as blacklisted.
      • deny

        public void deny​(String address)
        Deny (blacklist) a single IP address. For all security mechanisms, this rejects the connection without any further authentication. Use either a whitelist, or a blacklist, not not both. If you define both a whitelist and a blacklist, only the whitelist takes effect.
      • configurePlain

        public void configurePlain​(String domain,
                                   String filename)
        Configure PLAIN authentication for a given domain. PLAIN authentication uses a plain-text password file. To cover all domains, use "*". You can modify the password file at any time; it is reloaded automatically.
        Parameters:
        domain -
        filename -
      • destroy

        public void destroy()
        Destructor.
      • configureGSSAPI

        public void configureGSSAPI​(String domain)
      • authenticateGSS

        protected boolean authenticateGSS​(ZAuth.ZAPRequest request)