Class DefaultCaptchaManager
- java.lang.Object
-
- com.atlassian.confluence.security.DefaultCaptchaManager
-
- All Implemented Interfaces:
CaptchaManager,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean
public class DefaultCaptchaManager extends Object implements CaptchaManager, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
-
-
Field Summary
-
Fields inherited from interface com.atlassian.confluence.security.CaptchaManager
DEBUG_CAPTCHA
-
-
Constructor Summary
Constructors Constructor Description DefaultCaptchaManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CollectionaddCaptchaGroups(Collection groupList)Method adds a Collection of group names to the existing groups for the captcha group setting.voidafterPropertiesSet()voiddestroy()voidexcludeGroups()voidexcludeNone()voidexcludeRegisteredUsers()booleanforceValidateCaptcha(String captchaId, String captchaResponse)StringgenerateCaptchaId()StringgetExclude()com.octo.captcha.service.image.ImageCaptchaServicegetImageCaptchaService()Deprecated.since 8.7UserAccessorgetUserAccessor()Deprecated.since 8.7booleanisCaptchaAvailable()booleanisCaptchaEnabled()booleanisDebugEnabled()voidremoveCaptchaGroup(String group)Removes a group from the list of captcha groupsvoidsetCaptchaEnabled(boolean value)voidsetCaptchaEngineClassName(String captchaEngineClassName)voidsetCaptchaGroups(Collection groupList)voidsetCaptchaStore(com.octo.captcha.service.captchastore.CaptchaStore captchaStore)voidsetDebugMode(boolean value)If true the captcha manager will accept "DEBUG" for every generated capthca and reject all other tokens.voidsetEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher)voidsetExclude(String value)voidsetImageCaptchaService(com.octo.captcha.service.image.ImageCaptchaService imageCaptchaService)Deprecated.since 8.7voidsetSettingsManager(SettingsManager settingsManager)voidsetUserAccessor(UserAccessor userAccessor)booleanshowCaptchaForCurrentUser()Determines whether a capture has to be shown for the currently logged in usersbooleanvalidateCaptcha(String captchaId, String captchaResponse)validate captcha response
-
-
-
Method Detail
-
setCaptchaStore
public void setCaptchaStore(com.octo.captcha.service.captchastore.CaptchaStore captchaStore)
-
setCaptchaEngineClassName
public void setCaptchaEngineClassName(String captchaEngineClassName)
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
destroy
public void destroy() throws Exception- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
Exception
-
isCaptchaAvailable
public boolean isCaptchaAvailable()
- Specified by:
isCaptchaAvailablein interfaceCaptchaManager
-
validateCaptcha
public boolean validateCaptcha(String captchaId, String captchaResponse)
Description copied from interface:CaptchaManagervalidate captcha response- Specified by:
validateCaptchain interfaceCaptchaManager- Returns:
- boolean
-
forceValidateCaptcha
public boolean forceValidateCaptcha(String captchaId, String captchaResponse)
- Specified by:
forceValidateCaptchain interfaceCaptchaManager
-
isCaptchaEnabled
public boolean isCaptchaEnabled()
- Specified by:
isCaptchaEnabledin interfaceCaptchaManager
-
setCaptchaEnabled
public void setCaptchaEnabled(boolean value)
- Specified by:
setCaptchaEnabledin interfaceCaptchaManager
-
isDebugEnabled
public boolean isDebugEnabled()
- Specified by:
isDebugEnabledin interfaceCaptchaManager
-
setDebugMode
public void setDebugMode(boolean value)
Description copied from interface:CaptchaManagerIf true the captcha manager will accept "DEBUG" for every generated capthca and reject all other tokens. This is meant primarly for acceptance testing user interface elements with Captcha forms.If true the exclude list is ignored and a Captcha prompt is supplied for all requests
- Specified by:
setDebugModein interfaceCaptchaManager
-
excludeNone
public void excludeNone()
- Specified by:
excludeNonein interfaceCaptchaManager
-
excludeRegisteredUsers
public void excludeRegisteredUsers()
- Specified by:
excludeRegisteredUsersin interfaceCaptchaManager
-
excludeGroups
public void excludeGroups()
- Specified by:
excludeGroupsin interfaceCaptchaManager
-
getExclude
public String getExclude()
- Specified by:
getExcludein interfaceCaptchaManager
-
setExclude
public void setExclude(String value)
- Specified by:
setExcludein interfaceCaptchaManager
-
setCaptchaGroups
public void setCaptchaGroups(Collection groupList)
- Specified by:
setCaptchaGroupsin interfaceCaptchaManager
-
addCaptchaGroups
public Collection addCaptchaGroups(Collection groupList)
Description copied from interface:CaptchaManagerMethod adds a Collection of group names to the existing groups for the captcha group setting.- Specified by:
addCaptchaGroupsin interfaceCaptchaManager- Parameters:
groupList- Collection of group names- Returns:
- Collection of added group names
-
removeCaptchaGroup
public void removeCaptchaGroup(String group)
Description copied from interface:CaptchaManagerRemoves a group from the list of captcha groups- Specified by:
removeCaptchaGroupin interfaceCaptchaManager- Parameters:
group- String
-
showCaptchaForCurrentUser
public boolean showCaptchaForCurrentUser()
Description copied from interface:CaptchaManagerDetermines whether a capture has to be shown for the currently logged in users- Specified by:
showCaptchaForCurrentUserin interfaceCaptchaManager
-
setSettingsManager
public void setSettingsManager(SettingsManager settingsManager)
-
getUserAccessor
@Deprecated public UserAccessor getUserAccessor()
Deprecated.since 8.7
-
setUserAccessor
public void setUserAccessor(UserAccessor userAccessor)
-
setEventPublisher
public void setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher)
-
setImageCaptchaService
@Deprecated public void setImageCaptchaService(com.octo.captcha.service.image.ImageCaptchaService imageCaptchaService)
Deprecated.since 8.7- Specified by:
setImageCaptchaServicein interfaceCaptchaManager
-
getImageCaptchaService
@Deprecated public com.octo.captcha.service.image.ImageCaptchaService getImageCaptchaService()
Deprecated.since 8.7- Specified by:
getImageCaptchaServicein interfaceCaptchaManager
-
generateCaptchaId
public String generateCaptchaId()
- Specified by:
generateCaptchaIdin interfaceCaptchaManager- Returns:
- a new captchaId
-
-