public class ZAuth
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Class and Description |
---|---|
static interface |
ZAuth.Auth |
private static class |
ZAuth.AuthActor
AuthActor is the backend actor which we talk to over a pipe.
|
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 |
---|---|
private ZAgent |
agent |
private static java.lang.String |
ALLOW |
static java.lang.String |
CURVE_ALLOW_ANY |
private static java.lang.String |
DENY |
private ZStar.Exit |
exit |
private ZAgent |
replies |
private static java.lang.String |
REPLIES |
private boolean |
repliesEnabled |
private static java.lang.String |
TERMINATE |
private static java.lang.String |
VERBOSE |
private static java.lang.String |
ZAP_VERSION |
Constructor and Description |
---|
ZAuth(ZContext ctx)
Install authentication for the specified context.
|
ZAuth(ZContext ctx,
java.lang.String actorName) |
ZAuth(ZContext ctx,
java.lang.String actorName,
java.util.Map<java.lang.String,ZAuth.Auth> auths) |
ZAuth(ZContext ctx,
ZCertStore.Fingerprinter fingerprinter) |
Modifier and Type | Method and Description |
---|---|
ZAuth |
allow(java.lang.String address)
Allow (whitelist) a single IP address.
|
void |
close()
Destructor.
|
ZAuth |
configureCurve(java.lang.String location)
Configure CURVE authentication
|
ZAuth |
configurePlain(java.lang.String domain,
java.lang.String filename)
Configure PLAIN authentication for a given domain.
|
private static java.util.Map<java.lang.String,ZAuth.Auth> |
curveVariant(ZCertStore.Fingerprinter fingerprinter) |
ZAuth |
deny(java.lang.String address)
Deny (blacklist) a single IP address.
|
void |
destroy()
Destructor.
|
private static java.util.Map<java.lang.String,ZAuth.Auth> |
makeSimpleAuths() |
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(java.lang.String command,
java.lang.String... datas) |
ZAuth |
setVerbose(boolean verbose)
Enable verbose tracing of commands and activity
|
ZAuth |
verbose(boolean verbose) |
private static final java.lang.String ZAP_VERSION
public static final java.lang.String CURVE_ALLOW_ANY
private static final java.lang.String VERBOSE
private static final java.lang.String REPLIES
private static final java.lang.String ALLOW
private static final java.lang.String DENY
private static final java.lang.String TERMINATE
private final ZAgent agent
private final ZStar.Exit exit
private final ZAgent replies
private boolean repliesEnabled
public ZAuth(ZContext ctx)
ctx
- public ZAuth(ZContext ctx, ZCertStore.Fingerprinter fingerprinter)
public ZAuth(ZContext ctx, java.lang.String actorName)
public ZAuth(ZContext ctx, java.lang.String actorName, java.util.Map<java.lang.String,ZAuth.Auth> auths)
private static java.util.Map<java.lang.String,ZAuth.Auth> makeSimpleAuths()
private static java.util.Map<java.lang.String,ZAuth.Auth> curveVariant(ZCertStore.Fingerprinter fingerprinter)
public ZAuth setVerbose(boolean verbose)
verbose
- public ZAuth verbose(boolean verbose)
public ZAuth allow(java.lang.String address)
address
- public ZAuth deny(java.lang.String address)
address
- public ZAuth configurePlain(java.lang.String domain, java.lang.String filename)
domain
- filename
- public ZAuth configureCurve(java.lang.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 java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public void destroy()
protected ZAuth send(java.lang.String command, java.lang.String... datas)