public class ZAuth extends Object implements Closeable
| Modifier and Type | Class and Description |
|---|---|
static interface |
ZAuth.Auth |
static class |
ZAuth.SimpleCurveAuth |
static class |
ZAuth.SimpleNullAuth |
static class |
ZAuth.SimplePlainAuth |
static class |
ZAuth.ZapReply |
static class |
ZAuth.ZapRequest
A small class for working with ZAP requests and replies.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
CURVE_ALLOW_ANY |
| Constructor and Description |
|---|
ZAuth(ZContext ctx)
Install authentication for the specified context.
|
ZAuth(ZContext ctx,
String actorName) |
ZAuth(ZContext ctx,
String actorName,
Map<String,ZAuth.Auth> auths) |
ZAuth(ZContext ctx,
ZCertStore.Fingerprinter fingerprinter) |
| Modifier and Type | Method and Description |
|---|---|
ZAuth |
allow(String address)
Allow (whitelist) a single IP address.
|
void |
close()
Destructor.
|
ZAuth |
configureCurve(String location)
Configure CURVE authentication
|
ZAuth |
configurePlain(String domain,
String filename)
Configure PLAIN authentication for a given domain.
|
ZAuth |
deny(String address)
Deny (blacklist) a single IP address.
|
void |
destroy()
Destructor.
|
ZAuth.ZapReply |
nextReply()
Retrieves the next ZAP reply.
|
ZAuth.ZapReply |
nextReply(boolean wait)
Retrieves the next ZAP reply.
|
ZAuth.ZapReply |
nextReply(int timeout)
Retrieves the next ZAP reply.
|
ZAuth |
replies(boolean enable) |
protected ZAuth |
send(String command,
String... datas) |
ZAuth |
setVerbose(boolean verbose)
Enable verbose tracing of commands and activity
|
ZAuth |
verbose(boolean verbose) |
public static final String CURVE_ALLOW_ANY
public ZAuth(ZContext ctx)
ctx - public ZAuth(ZContext ctx, ZCertStore.Fingerprinter fingerprinter)
public ZAuth(ZContext ctx, String actorName, Map<String,ZAuth.Auth> auths)
public ZAuth setVerbose(boolean verbose)
verbose - public ZAuth verbose(boolean verbose)
public ZAuth allow(String address)
address - public ZAuth deny(String address)
address - public ZAuth configurePlain(String domain, String filename)
domain - filename - public ZAuth configureCurve(String location)
location - Can be ZAuth.CURVE_ALLOW_ANY or a directory with public-keys that will be acceptedpublic ZAuth replies(boolean enable)
public ZAuth.ZapReply nextReply()
public ZAuth.ZapReply nextReply(boolean wait)
wait - true to wait for the next reply, false to immediately return if there is no next reply.public ZAuth.ZapReply nextReply(int timeout)
timeout - the timeout in milliseconds to wait for a reply before giving up and returning null.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void destroy()
Copyright © 2020. All rights reserved.