Class CaptchEtatHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.captchetat.captcha.CaptchEtatHelper
- All Implemented Interfaces:
LogEnabled
,Initializable
,Component
,Serviceable
- Direct Known Subclasses:
CaptchEtatHelper
public class CaptchEtatHelper
extends AbstractLogEnabled
implements Component, Initializable, Serviceable
Captcha implementation with images
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static enum
The type of endpoint available for Captchetat -
Field Summary
Modifier and TypeFieldDescriptionprotected CaptchEtatHelper.Endpoint
the endpoint present in configurationstatic final String
id of the token cachestatic final String
Role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
Get the name of the parameter for identifier when contacting the APIboolean
checkAndInvalidateCaptcha
(String key, String value) Check if the captcha is correctget TokengetToken()
get Tokenvoid
Initializevoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Role -
CAPCHETAT_TOKEN_CACHE
id of the token cache -
_endpoint
the endpoint present in configuration
-
-
Constructor Details
-
CaptchEtatHelper
public CaptchEtatHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
Initialize- Specified by:
initialize
in interfaceInitializable
-
getToken
get Token- Returns:
- token
-
getEndpoint
get Token- Returns:
- token
-
checkAndInvalidateCaptcha
Check if the captcha is correct- Parameters:
key
- the keyvalue
- the value- Returns:
- true if correct
-
_getIdentifierParameterName
Get the name of the parameter for identifier when contacting the API- Returns:
- the parameter name
-