/modules/apps/captcha/captcha-api/src/main/java/com/liferay/captcha/configuration/CaptchaConfiguration.java

https://github.com/danielreuther/liferay-portal · Java · 143 lines · 104 code · 23 blank · 16 comment · 0 complexity · 8c7941b289eec0ea4ba74b265d2b4872 MD5 · raw file

  1. /**
  2. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
  3. *
  4. * This library is free software; you can redistribute it and/or modify it under
  5. * the terms of the GNU Lesser General Public License as published by the Free
  6. * Software Foundation; either version 2.1 of the License, or (at your option)
  7. * any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11. * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  12. * details.
  13. */
  14. package com.liferay.captcha.configuration;
  15. import aQute.bnd.annotation.metatype.Meta;
  16. import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition;
  17. /**
  18. * @author Pei-Jung Lan
  19. */
  20. @ExtendedObjectClassDefinition(category = "security-tools")
  21. @Meta.OCD(
  22. id = "com.liferay.captcha.configuration.CaptchaConfiguration",
  23. localization = "content/Language", name = "captcha-configuration-name"
  24. )
  25. public interface CaptchaConfiguration {
  26. @Meta.AD(
  27. deflt = "1", description = "max-challenges-help",
  28. name = "max-challenges", required = false
  29. )
  30. public int maxChallenges();
  31. @Meta.AD(
  32. deflt = "true", name = "create-account-captcha-enabled",
  33. required = false
  34. )
  35. public boolean createAccountCaptchaEnabled();
  36. @Meta.AD(
  37. deflt = "true", name = "send-password-captcha-enabled", required = false
  38. )
  39. public boolean sendPasswordCaptchaEnabled();
  40. @Meta.AD(
  41. deflt = "false", name = "message-boards-edit-category-captcha-enabled",
  42. required = false
  43. )
  44. public boolean messageBoardsEditCategoryCaptchaEnabled();
  45. @Meta.AD(
  46. deflt = "false", name = "message-boards-edit-message-captcha-enabled",
  47. required = false
  48. )
  49. public boolean messageBoardsEditMessageCaptchaEnabled();
  50. @Meta.AD(
  51. deflt = "com.liferay.captcha.simplecaptcha.SimpleCaptchaImpl",
  52. description = "captcha-engine-help", name = "captcha-engine",
  53. optionLabels = {"SimpleCaptcha", "reCAPTCHA"},
  54. optionValues = {
  55. "com.liferay.captcha.simplecaptcha.SimpleCaptchaImpl",
  56. "com.liferay.captcha.recaptcha.ReCaptchaImpl"
  57. },
  58. required = false
  59. )
  60. public String captchaEngine();
  61. @Meta.AD(name = "recaptcha-public-key", required = false)
  62. public String reCaptchaPublicKey();
  63. @Meta.AD(name = "recaptcha-private-key", required = false)
  64. public String reCaptchaPrivateKey();
  65. @Meta.AD(
  66. deflt = "https://www.google.com/recaptcha/api.js",
  67. name = "recaptcha-script-url", required = false
  68. )
  69. public String reCaptchaScriptURL();
  70. @Meta.AD(
  71. deflt = "https://www.google.com/recaptcha/api/fallback?k=",
  72. name = "recaptcha-no-script-url", required = false
  73. )
  74. public String reCaptchaNoScriptURL();
  75. @Meta.AD(
  76. deflt = "https://www.google.com/recaptcha/api/siteverify",
  77. name = "recaptcha-verify-url", required = false
  78. )
  79. public String reCaptchaVerifyURL();
  80. @Meta.AD(
  81. deflt = "50", description = "simple-captcha-height-help",
  82. name = "simple-captcha-height", required = false
  83. )
  84. public int simpleCaptchaHeight();
  85. @Meta.AD(
  86. deflt = "150", description = "simple-captcha-width-help",
  87. name = "simple-captcha-width", required = false
  88. )
  89. public int simpleCaptchaWidth();
  90. @Meta.AD(
  91. deflt = "nl.captcha.backgrounds.FlatColorBackgroundProducer|nl.captcha.backgrounds.GradiatedBackgroundProducer|nl.captcha.backgrounds.SquigglesBackgroundProducer|nl.captcha.backgrounds.TransparentBackgroundProducer",
  92. description = "simple-captcha-background-producers-help",
  93. name = "simple-captcha-background-producers", required = false
  94. )
  95. public String[] simpleCaptchaBackgroundProducers();
  96. @Meta.AD(
  97. deflt = "com.liferay.captcha.simplecaptcha.gimpy.BlockGimpyRenderer|com.liferay.captcha.simplecaptcha.gimpy.DropShadowGimpyRenderer|nl.captcha.gimpy.FishEyeGimpyRenderer|com.liferay.captcha.simplecaptcha.gimpy.RippleGimpyRenderer|nl.captcha.gimpy.ShearGimpyRenderer",
  98. description = "simple-captcha-gimpy-renderers-help",
  99. name = "simple-captcha-gimpy-renderers", required = false
  100. )
  101. public String[] simpleCaptchaGimpyRenderers();
  102. @Meta.AD(
  103. deflt = "nl.captcha.noise.CurvedLineNoiseProducer|nl.captcha.noise.StraightLineNoiseProducer",
  104. description = "simple-captcha-noise-producers-help",
  105. name = "simple-captcha-noise-producers", required = false
  106. )
  107. public String[] simpleCaptchaNoiseProducers();
  108. @Meta.AD(
  109. deflt = "com.liferay.captcha.simplecaptcha.DictionaryWordTextProducer|com.liferay.captcha.simplecaptcha.PinNumberTextProducer|nl.captcha.text.producer.DefaultTextProducer|nl.captcha.text.producer.FiveLetterFirstNameTextProducer",
  110. description = "simple-captcha-text-producers-help",
  111. name = "simple-captcha-text-producers", required = false
  112. )
  113. public String[] simpleCaptchaTextProducers();
  114. @Meta.AD(
  115. deflt = "nl.captcha.text.renderer.DefaultWordRenderer",
  116. description = "simple-captcha-word-renderers-help",
  117. name = "simple-captcha-word-renderers", required = false
  118. )
  119. public String[] simpleCaptchaWordRenderers();
  120. }