|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.svrCore.props.SimplepassProps
public final class SimplepassProps
Encapsulates the simplepass password file. This can not be serialised and can only be constructed from the file indicated by LocalProps.getSimplePassfile().
| Field Summary | |
|---|---|
private static int |
SIMPLEPASS_FAILURE_PAUSE
How long to wait (ms) on an unsuccessful lookup. |
private static java.lang.String |
SIMPLEPASS_PREFIX
The "simplepass" prefix, including the trailing dot. |
private java.util.Map<java.lang.String,java.lang.String> |
simplepassMap
The immutable private map from author initials to plaintext password. |
private static SimplepassProps |
singleton
The current singleton SimplepassProps object, if any. |
long |
timestamp
Timestamp of this properties set. |
private static boolean |
USE_SIMPLEPASS
If true, allow use of pg2k.upload.simplepass.XXX simple passwords. |
| Constructor Summary | |
|---|---|
private |
SimplepassProps(java.io.File pf)
Construct a new, immutable, properties set. |
| Method Summary | |
|---|---|
boolean |
authorUploadPasswordCorrect(java.lang.String auth,
java.lang.String pass)
Returns true if presented author upload password is correct. |
private static SimplepassProps |
getSimplepassProps()
Get the current SimplepassProps object, if any. |
static boolean |
isAuthorUploadPasswordCorrect(java.lang.String auth,
java.lang.String pass)
Returns true if the quoted password is correct for the given author. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static SimplepassProps singleton
public final long timestamp
private static final boolean USE_SIMPLEPASS
These will only be used in any case if a more advanced and safer password store is not available.
Note that these passwords are:
private static final java.lang.String SIMPLEPASS_PREFIX
private final java.util.Map<java.lang.String,java.lang.String> simplepassMap
This map is threadsafe because it is read-only.
The map is String to String.
Will be null if USE_SIMPLEPASS is false.
We don't directly disclose passwords, just check if they are valid or not. We hold a lock on the password while checking a password, and if it is wrong we wait a while still holding the lock, to make dictionary attacks harder at the risk of making some denial of service attacks easier.
private static final int SIMPLEPASS_FAILURE_PAUSE
| Constructor Detail |
|---|
private SimplepassProps(java.io.File pf)
throws java.io.IOException
Minor problems with the properties themselves will be silently ignored, and defaults substituted for broken or missing values.
This is only designed to be fetched by the factory method.
pf - is the passfile
java.io.IOException| Method Detail |
|---|
public static final boolean isAuthorUploadPasswordCorrect(java.lang.String auth,
java.lang.String pass)
Will return false if either parameter is null or zero-length.
auth - the author initials; must be correct syntacticallypass - the password; must be of a valid length
private static SimplepassProps getSimplepassProps()
public final boolean authorUploadPasswordCorrect(java.lang.String auth,
java.lang.String pass)
|
DHD Multimedia Gallery V1.60.69 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||