Module: BotChallengePage

Defined in:
app/controllers/bot_challenge_page/bot_challenge_page_controller.rb,
lib/bot_challenge_page.rb,
lib/bot_challenge_page/config.rb,
lib/bot_challenge_page/engine.rb,
lib/bot_challenge_page/version.rb,
lib/generators/bot_challenge_page/install_generator.rb,
app/controllers/concerns/bot_challenge_page/controller.rb,
app/controllers/concerns/bot_challenge_page/guard_action.rb

Overview

This controller has actions for issuing a challenge page for CloudFlare Turnstile product, and then redirecting back to desired page.

It also includes logic for configuring rack attack and a Rails controller filter to enforce redirection to these actions. All the logic related to bot detection with turnstile is mostly in this file – with very flexible configuration in class_attributes – to faciliate future extraction to a re-usable gem if desired.

Defined Under Namespace

Modules: Controller, GuardAction Classes: BotChallengePageController, Config, Engine, InstallGenerator

Constant Summary collapse

VERSION =
"1.0.0"

Class Method Summary collapse

Class Method Details

.configure {|config| ... } ⇒ Object

Just a convenience to allow

BotChallengePage.configure do |config|
  config.foo = "bar"
end

Yields:

  • (config)


14
15
16
# File 'lib/bot_challenge_page.rb', line 14

def self.configure
  yield config
end