Class AuthKeyHints
- java.lang.Object
-
- com.jalios.jcms.authentication.handlers.AuthKeyHints
-
public class AuthKeyHints extends java.lang.Object
Contains elements that may be used to construct an AuthKey- Since:
- JCMS-6.0
- Author:
- dissert
-
-
Constructor Summary
Constructors Constructor Description AuthKeyHints()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getExpiration()
java.lang.String
getIpMask()
java.lang.String
getMethods()
java.lang.String
getVersion()
boolean
isPrefixMode()
void
setExpiration(long expiration)
Specify the expiration date of the authkey, in the epoch standard format.void
setIpMask(java.lang.String ipMask)
An authkey may be generated only for authorized ip.void
setMethods(java.lang.String methods)
Parameter to tell wich HTTP methods are allowed for a given authkey.void
setPrefixMode(boolean prefixMode)
Tells if an authkey has to be generated for only a given URL (default behaviour), or a range of URL beginning with a given prefix (prefix mode).void
setVersion(java.lang.String version)
As the format of the authkey may be modified, to maintain compatibility, a version of the format is embedded in the authkey.
-
-
-
Method Detail
-
isPrefixMode
public boolean isPrefixMode()
- Returns:
- true if the authkey must be generated for a range of URL given a prefix URL.
-
setPrefixMode
public void setPrefixMode(boolean prefixMode)
Tells if an authkey has to be generated for only a given URL (default behaviour), or a range of URL beginning with a given prefix (prefix mode).- Parameters:
prefixMode
-
-
getExpiration
public long getExpiration()
- Returns:
- the expiration date in the epoch format.
-
setExpiration
public void setExpiration(long expiration)
Specify the expiration date of the authkey, in the epoch standard format. If a negative value is set, a default duration is applied, based on the value returned by AuthKeyAuthenticationHandler.getDefaultAuthKeyDuration().- Parameters:
expiration
-
-
getMethods
public java.lang.String getMethods()
- Returns:
- a filter on allowed HTTP methods
-
setMethods
public void setMethods(java.lang.String methods)
Parameter to tell wich HTTP methods are allowed for a given authkey. A request is allowed if the HTTP method of the request is contained (as a substring) in the "methods" field.- Parameters:
methods
-
-
getIpMask
public java.lang.String getIpMask()
- Returns:
- a Perl 5 regexp for authorized IP.
-
setIpMask
public void setIpMask(java.lang.String ipMask)
An authkey may be generated only for authorized ip. The ipmask field defines a Perl 5 regular expression to restrict the authkey to a given mask of IP addresses.- Parameters:
ipMask
- a Perl 5 regexp for authorized IP.
-
getVersion
public java.lang.String getVersion()
- Returns:
- the version used to create a given authkey.
-
setVersion
public void setVersion(java.lang.String version)
As the format of the authkey may be modified, to maintain compatibility, a version of the format is embedded in the authkey.- Parameters:
version
-
-
-