|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.elkoserver.foundation.server.metadata.AuthDesc
public class AuthDesc
Descriptor containing information required or presented to authorize a connection.
| Field Summary | |
|---|---|
static AuthDesc |
theOpenAuth
Singleton open authorization descriptor. |
| Constructor Summary | |
|---|---|
AuthDesc(String mode,
OptString code,
OptString id)
JSON-driven constructor. |
|
AuthDesc(String mode,
String code,
String id)
Direct constructor. |
|
| Method Summary | |
|---|---|
String |
code()
Get the authorization code. |
JSONLiteral |
encode(EncodeControl control)
Encode this object for transmission or persistence. |
static AuthDesc |
fromProperties(BootProperties props,
String propRoot,
Trace appTrace)
Produce an AuthDesc object from information contained in the server configuration properties. |
String |
id()
Get the authorization ID. |
String |
mode()
Get the authorization mode. |
boolean |
verify(AuthDesc auth)
Check an authorization. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final AuthDesc theOpenAuth
| Constructor Detail |
|---|
public AuthDesc(String mode,
String code,
String id)
mode - Authorization mode.code - Authorization code, or null if not relevant.id - Authorization ID, or null if not relevant.
@JSONMethod(value={"mode","code","id"})
public AuthDesc(String mode,
OptString code,
OptString id)
mode - Authorization mode.code - Optional authorization code.id - Optional authorization ID.| Method Detail |
|---|
public String code()
public static AuthDesc fromProperties(BootProperties props,
String propRoot,
Trace appTrace)
The authorization mode is extracted from propRoot+".auth.mode". Currently, there are three possible authorization mode values that are recognized: "open", "password", and "reservation".
Open mode is unrestricted access. No additional descriptive information is required for open mode.
Password mode requires a secret code string for access. This code string is extracted from propRoot+".auth.code". Additionally, an identifier may also be required, which will be extracted from propRoot+".auth.id" if that property is present.
Reservation mode requires a reservation string for access. The reservation string is communicated via a separate pathway, but it optionally may be associated with an identifier extracted from propRoot+".auth.id".
props - The properties themselves.propRoot - Prefix string for all the properties describing the
authorization information of interest.appTrace - Trace object for error logging.
public String id()
public String mode()
public boolean verify(AuthDesc auth)
auth - Authorization credentials being presented.
public JSONLiteral encode(EncodeControl control)
encode in interface Encodablecontrol - Encode control determining what flavor of encoding
should be done.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||