Class SpincastFormsProtectionConfigDefault
java.lang.Object
org.spincast.plugins.formsprotection.config.SpincastFormsProtectionConfigDefault
- All Implemented Interfaces:
SpincastFormsProtectionConfig
public class SpincastFormsProtectionConfigDefault
extends Object
implements SpincastFormsProtectionConfig
Default configurations for Spincast Forms Protection plugin.
-
Field Summary
Fields inherited from interface org.spincast.plugins.formsprotection.config.SpincastFormsProtectionConfig
SESSION_VARIABLE_NAME_CSRF_TOKEN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Should this plugin automatically register a scheduled task that will callSpincastFormsDoubleSubmitProtectionRepository.deleteOldFormsProtectionIds(int)
for cleanup?int
IfSpincastFormsProtectionConfig.autoRegisterDeleteOldDoubleSubmitProtectionIdsScheduledTask()
is enabled, the cleanup of old saved protection ids should runs every X minutes.The "name" of the hidden field in which a generated CSRF protection id will be saved in the HTML form.The "name" of the hidden field to add to disable the Double Submit protection on a specific form.int
If theSpincastFormsDoubleSubmitProtectionFilter
filter is used, this is the number of minutes maximum of form will be considered as valid.The "name" of the hidden field in which a generated Double Submit protection id will be saved in the HTML form.
-
Constructor Details
-
SpincastFormsProtectionConfigDefault
public SpincastFormsProtectionConfigDefault()
-
-
Method Details
-
getFormCsrfProtectionIdFieldName
Description copied from interface:SpincastFormsProtectionConfig
The "name" of the hidden field in which a generated CSRF protection id will be saved in the HTML form.- Specified by:
getFormCsrfProtectionIdFieldName
in interfaceSpincastFormsProtectionConfig
-
getFormDoubleSubmitProtectionIdFieldName
Description copied from interface:SpincastFormsProtectionConfig
The "name" of the hidden field in which a generated Double Submit protection id will be saved in the HTML form.- Specified by:
getFormDoubleSubmitProtectionIdFieldName
in interfaceSpincastFormsProtectionConfig
-
getFormDoubleSubmitDisableProtectionIdFieldName
Description copied from interface:SpincastFormsProtectionConfig
The "name" of the hidden field to add to disable the Double Submit protection on a specific form. (use any value such as "1" for the field.)- Specified by:
getFormDoubleSubmitDisableProtectionIdFieldName
in interfaceSpincastFormsProtectionConfig
-
autoRegisterDeleteOldDoubleSubmitProtectionIdsScheduledTask
public boolean autoRegisterDeleteOldDoubleSubmitProtectionIdsScheduledTask()Description copied from interface:SpincastFormsProtectionConfig
Should this plugin automatically register a scheduled task that will callSpincastFormsDoubleSubmitProtectionRepository.deleteOldFormsProtectionIds(int)
for cleanup?Note that wathever the value, the scheduled task will only be registered if a proper implementation of
SpincastFormsDoubleSubmitProtectionFilter
was bound in the first place.If disabled, you are responsible to register the scheduled task by yourself, or at least delete those old ids by yourself.
Defaults to
true
.- Specified by:
autoRegisterDeleteOldDoubleSubmitProtectionIdsScheduledTask
in interfaceSpincastFormsProtectionConfig
-
getDeleteOldDoubleSubmitProtectionIdsScheduledTaskRunEveryNbrMinutes
public int getDeleteOldDoubleSubmitProtectionIdsScheduledTaskRunEveryNbrMinutes()Description copied from interface:SpincastFormsProtectionConfig
IfSpincastFormsProtectionConfig.autoRegisterDeleteOldDoubleSubmitProtectionIdsScheduledTask()
is enabled, the cleanup of old saved protection ids should runs every X minutes.- Specified by:
getDeleteOldDoubleSubmitProtectionIdsScheduledTaskRunEveryNbrMinutes
in interfaceSpincastFormsProtectionConfig
-
getFormDoubleSubmitFormValidForNbrMinutes
public int getFormDoubleSubmitFormValidForNbrMinutes()Description copied from interface:SpincastFormsProtectionConfig
If theSpincastFormsDoubleSubmitProtectionFilter
filter is used, this is the number of minutes maximum of form will be considered as valid. Older than that, it will be refused.If
SpincastFormsProtectionConfig.autoRegisterDeleteOldDoubleSubmitProtectionIdsScheduledTask()
is enabled, the scheduled task will also use this value to decide when to delete old protection ids.Defaults to 120 minutes (2 hours).
- Specified by:
getFormDoubleSubmitFormValidForNbrMinutes
in interfaceSpincastFormsProtectionConfig
-