Module: Booth

Defined in:
lib/booth/method_object.rb,
lib/booth/mode.rb,
lib/booth/test.rb,
lib/booth/engine.rb,
lib/booth/errors.rb,
lib/booth/logger.rb,
lib/booth/logging.rb,
lib/booth/request.rb,
lib/booth/version.rb,
lib/booth/userland.rb,
lib/booth/adminland.rb,
lib/booth/configure.rb,
lib/booth/to_struct.rb,
lib/booth/modes/base.rb,
lib/booth/geolocation.rb,
lib/booth/requests/ip.rb,
lib/booth/syntaxes/ip.rb,
lib/booth/contests/get.rb,
lib/booth/models/audit.rb,
lib/booth/syntaxes/otp.rb,
lib/booth/test/helpers.rb,
lib/booth/configuration.rb,
lib/booth/cooldowns/otp.rb,
lib/booth/requests/sudo.rb,
lib/booth/syntaxes/uuid.rb,
lib/booth/test/userland.rb,
lib/booth/models/contest.rb,
lib/booth/models/session.rb,
lib/booth/requests/agent.rb,
lib/booth/sessions/index.rb,
lib/booth/syntaxes/email.rb,
lib/booth/syntaxes/scope.rb,
lib/booth/concerns/action.rb,
lib/booth/models/recovery.rb,
lib/booth/routes/userland.rb,
lib/booth/sessions/revoke.rb,
lib/booth/contests/respond.rb,
lib/booth/credentials/mode.rb,
lib/booth/onboardings/find.rb,
lib/booth/onboardings/step.rb,
lib/booth/requests/session.rb,
lib/booth/requests/storage.rb,
lib/booth/hooks/after_fetch.rb,
lib/booth/models/credential.rb,
lib/booth/models/onboarding.rb,
lib/booth/models/user_agent.rb,
lib/booth/recoveries/create.rb,
lib/booth/syntaxes/username.rb,
lib/booth/cooldowns/password.rb,
lib/booth/credentials/create.rb,
lib/booth/userland/otps/edit.rb,
lib/booth/userland/otps/show.rb,
lib/booth/userland/otps/sudo.rb,
lib/booth/authenticators/step.rb,
lib/booth/concerns/transition.rb,
lib/booth/hooks/before_logout.rb,
lib/booth/models/registration.rb,
lib/booth/syntaxes/secret_key.rb,
lib/booth/userland/logins/new.rb,
lib/booth/models/authenticator.rb,
lib/booth/password_resets/find.rb,
lib/booth/password_resets/step.rb,
lib/booth/requests/return_path.rb,
lib/booth/sessions/to_passport.rb,
lib/booth/test/webauthn/enable.rb,
lib/booth/userland/otps/update.rb,
lib/booth/models/password_reset.rb,
lib/booth/requests/storages/otp.rb,
lib/booth/syntaxes/contest_code.rb,
lib/booth/test/webauthn/disable.rb,
lib/booth/userland/otps/destroy.rb,
lib/booth/userland/webauths/new.rb,
lib/booth/audits/register/logout.rb,
lib/booth/authenticators/confirm.rb,
lib/booth/contests/set_for_login.rb,
lib/booth/password_resets/create.rb,
lib/booth/userland/logins/create.rb,
lib/booth/userland/sessions/show.rb,
lib/booth/userland/webauths/sudo.rb,
lib/booth/models/concerns/otpable.rb,
lib/booth/requests/authentication.rb,
lib/booth/requests/storages/login.rb,
lib/booth/userland/logins/destroy.rb,
lib/booth/userland/passwords/edit.rb,
lib/booth/userland/passwords/show.rb,
lib/booth/userland/passwords/sudo.rb,
lib/booth/userland/recoveries/new.rb,
lib/booth/userland/sessions/index.rb,
lib/booth/userland/webauths/index.rb,
lib/booth/webauth/options_for_get.rb,
lib/booth/cooldowns/password_reset.rb,
lib/booth/models/concerns/modeable.rb,
lib/booth/test/support/force_login.rb,
lib/booth/userland/webauths/create.rb,
lib/booth/audits/register/added_otp.rb,
lib/booth/audits/register/wrong_otp.rb,
lib/booth/models/application_record.rb,
lib/booth/requests/storages/webauth.rb,
lib/booth/sessions/create_and_login.rb,
lib/booth/syntaxes/scope_comparison.rb,
lib/booth/test/userland/otps/manage.rb,
lib/booth/userland/onboardings/show.rb,
lib/booth/userland/otps/guards/sudo.rb,
lib/booth/userland/passwords/remove.rb,
lib/booth/userland/passwords/update.rb,
lib/booth/userland/webauths/destroy.rb,
lib/booth/adminland/onboardings/find.rb,
lib/booth/adminland/periodic_cleanup.rb,
lib/booth/cooldowns/distance_of_time.rb,
lib/booth/modes/username_and_webauth.rb,
lib/booth/requests/storages/password.rb,
lib/booth/requests/storages/recovery.rb,
lib/booth/sessions/revoke_all_others.rb,
lib/booth/userland/passwords/destroy.rb,
lib/booth/userland/recoveries/create.rb,
lib/booth/userland/registrations/new.rb,
lib/booth/webauth/options_for_create.rb,
lib/booth/adminland/onboardings/index.rb,
lib/booth/audits/register/changed_otp.rb,
lib/booth/audits/register/correct_otp.rb,
lib/booth/cooldowns/strategies/global.rb,
lib/booth/cooldowns/strategies/result.rb,
lib/booth/modes/username_and_password.rb,
lib/booth/test/support/assert_partial.rb,
lib/booth/userland/onboardings/update.rb,
lib/booth/adminland/credentials/create.rb,
lib/booth/adminland/onboardings/create.rb,
lib/booth/adminland/recoveries/consume.rb,
lib/booth/credentials/find_by_username.rb,
lib/booth/hooks/serialize_from_session.rb,
lib/booth/hooks/serialize_into_session.rb,
lib/booth/models/concerns/passwordable.rb,
lib/booth/userland/password_resets/new.rb,
lib/booth/adminland/onboardings/destroy.rb,
lib/booth/credentials/modes/otp_addable.rb,
lib/booth/credentials/webauth_challenge.rb,
lib/booth/sessions/historical_locations.rb,
lib/booth/test/support/assert_logged_in.rb,
lib/booth/test/userland/onboardings/otp.rb,
lib/booth/userland/password_resets/show.rb,
lib/booth/userland/registrations/create.rb,
lib/booth/userland/webauths/guards/sudo.rb,
lib/booth/audits/register/wrong_password.rb,
lib/booth/credentials/otp_authentication.rb,
lib/booth/requests/storages/registration.rb,
lib/booth/test/support/assert_logged_out.rb,
lib/booth/test/support/get_session_value.rb,
lib/booth/userland/passwords/guards/sudo.rb,
lib/booth/credentials/modes/otp_removable.rb,
lib/booth/modes/username_password_and_otp.rb,
lib/booth/test/support/soft_reset_session.rb,
lib/booth/userland/extract_flash_messages.rb,
lib/booth/userland/otps/guards/manageable.rb,
lib/booth/userland/password_resets/create.rb,
lib/booth/userland/password_resets/update.rb,
lib/booth/userland/personal_contests/show.rb,
lib/booth/audits/register/correct_password.rb,
lib/booth/cooldowns/strategies/exponential.rb,
lib/booth/credentials/modes/otp_changeable.rb,
lib/booth/credentials/modes/otp_manageable.rb,
lib/booth/requests/storages/password_reset.rb,
lib/booth/webauth/demand_user_verification.rb,
lib/booth/credentials/modes/webauth_addable.rb,
lib/booth/test/userland/onboardings/timeout.rb,
lib/booth/userland/personal_contests/update.rb,
lib/booth/credentials/create_with_onboarding.rb,
lib/booth/credentials/modes/password_addable.rb,
lib/booth/test/support/otp_code_from_session.rb,
lib/booth/test/userland/onboardings/password.rb,
lib/booth/credentials/modes/webauth_removable.rb,
lib/booth/credentials/password_authentication.rb,
lib/booth/modes/username_password_and_webauth.rb,
lib/booth/onboardings/propagate_to_credential.rb,
lib/booth/test/userland/password_resets/reset.rb,
lib/booth/userland/passwords/guards/removable.rb,
lib/booth/userland/webauths/guards/manageable.rb,
lib/booth/webauth/authentication_verification.rb,
lib/booth/audits/register/completed_onboarding.rb,
lib/booth/credentials/modes/password_removable.rb,
lib/booth/credentials/modes/webauth_manageable.rb,
lib/booth/userland/passwords/guards/manageable.rb,
lib/booth/credentials/modes/password_changeable.rb,
lib/booth/credentials/modes/password_manageable.rb,
lib/booth/userland/otps/transitions/update/reset.rb,
lib/booth/userland/sessions/destroy_one_or_other.rb,
lib/booth/models/contests/scopes/recently_created.rb,
lib/booth/password_resets/propagate_to_credential.rb,
lib/booth/test/userland/logins/missing_onboarding.rb,
lib/booth/audits/register/requested_password_reset.rb,
lib/booth/userland/logins/transitions/new/fallible.rb,
lib/booth/userland/otps/transitions/update/confirm.rb,
lib/generators/booth/migration/migration_generator.rb,
lib/booth/models/contests/scopes/recently_responded.rb,
lib/booth/test/userland/logins/username_and_webauth.rb,
lib/booth/userland/logins/transitions/new/timed_out.rb,
lib/booth/userland/otps/transitions/update/register.rb,
lib/booth/test/userland/logins/username_and_password.rb,
lib/booth/userland/password_resets/guards/logged_out.rb,
lib/booth/userland/passwords/transitions/remove/step.rb,
lib/booth/userland/webauths/transitions/create/reset.rb,
lib/booth/test/userland/logins/missing_authenticators.rb,
lib/booth/test/userland/onboardings/already_logged_in.rb,
lib/booth/test/webauthn/virtual_authenticators/create.rb,
lib/booth/test/webauthn/virtual_authenticators/destroy.rb,
lib/booth/userland/logins/transitions/create/enter_otp.rb,
lib/booth/test/support/assert_all_partials_were_covered.rb,
lib/booth/test/userland/logins/username_password_and_otp.rb,
lib/booth/userland/logins/transitions/create/skip_remotes.rb,
lib/booth/userland/logins/transitions/new/mode_first_time.rb,
lib/booth/userland/sessions/transitions/show/enter_webauth.rb,
lib/booth/authenticators/credential_mode_after_confirmation.rb,
lib/booth/userland/logins/transitions/new/already_logged_in.rb,
lib/booth/userland/onboardings/transitions/update/reset_otp.rb,
lib/booth/test/userland/logins/username_password_and_webauth.rb,
lib/booth/userland/logins/transitions/create/choose_username.rb,
lib/booth/userland/logins/transitions/create/verify_password.rb,
lib/booth/userland/logins/transitions/new/no_username_chosen.rb,
lib/booth/userland/onboardings/transitions/update/choose_mode.rb,
lib/booth/userland/onboardings/transitions/update/confirm_otp.rb,
lib/booth/userland/sessions/transitions/destroy/enter_webauth.rb,
lib/booth/userland/onboardings/transitions/update/register_otp.rb,
lib/booth/userland/sessions/transitions/destroy/enter_password.rb,
lib/booth/userland/webauths/transitions/create/choose_nickname.rb,
lib/booth/userland/onboardings/transitions/update/reset_webauth.rb,
lib/booth/userland/passwords/transitions/update/choose_password.rb,
lib/booth/userland/sessions/transitions/destroy/verify_password.rb,
lib/booth/userland/onboardings/transitions/update/reset_password.rb,
lib/booth/userland/passwords/transitions/update/confirm_password.rb,
lib/booth/userland/onboardings/transitions/update/choose_password.rb,
lib/booth/userland/logins/transitions/new/remote_session_available.rb,
lib/booth/userland/onboardings/transitions/update/confirm_password.rb,
lib/booth/userland/logins/transitions/new/mode_username_and_webauth.rb,
lib/booth/userland/logins/transitions/new/mode_username_and_password.rb,
lib/booth/userland/password_resets/transitions/update/reset_password.rb,
lib/booth/userland/password_resets/transitions/update/choose_password.rb,
lib/booth/userland/password_resets/transitions/update/confirm_password.rb,
lib/booth/userland/webauths/transitions/create/registration_initiation.rb,
lib/booth/userland/webauths/transitions/sudo/authentication_initiation.rb,
lib/booth/userland/logins/transitions/new/mode_username_password_and_otp.rb,
lib/booth/userland/webauths/transitions/create/authentication_initiation.rb,
lib/booth/userland/webauths/transitions/create/registration_verification.rb,
lib/booth/userland/webauths/transitions/sudo/authentication_verification.rb,
lib/booth/userland/onboardings/transitions/update/choose_webauth_nickname.rb,
lib/booth/userland/webauths/transitions/create/authentication_verification.rb,
lib/booth/userland/logins/transitions/new/mode_username_password_and_webauth.rb,
lib/booth/credentials/modes/password_removal_requires_user_verifiable_webauth.rb,
lib/booth/userland/logins/transitions/create/webauth_authentication_initiation.rb,
lib/booth/userland/logins/transitions/create/webauth_authentication_verification.rb,
lib/booth/userland/onboardings/transitions/update/webauth_registration_initiation.rb,
lib/booth/userland/sessions/transitions/destroy/webauth_authentication_initiation.rb,
lib/booth/userland/onboardings/transitions/update/webauth_authentication_initiation.rb,
lib/booth/userland/onboardings/transitions/update/webauth_registration_verification.rb,
lib/booth/userland/sessions/transitions/destroy/webauth_authentication_verification.rb,
lib/booth/userland/onboardings/transitions/update/webauth_authentication_verification.rb

Overview

Copyright 2018 Bukowskis github.com/bukowskis/method_object

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Defined Under Namespace

Modules: Adminland, Audits, Authenticators, Concerns, Contests, Cooldowns, Credentials, Errors, Generators, Geolocation, Hooks, Logging, Logins, MethodObject, Mode, Models, Modes, Onboardings, PasswordResets, Recoveries, Requests, Routes, Sessions, Syntaxes, Test, Userland, Webauth Classes: Configuration, Engine, Logger, Request, ToStruct

Constant Summary collapse

VERSION =
'0.0.1'.freeze

Class Method Summary collapse

Class Method Details

.configBooth::Configuration

Lazy-loads and returns the global configuration instance.

Examples:

Booth.config.logger = MyLogger.new

Returns:

See Also:



10
11
12
# File 'lib/booth/configure.rb', line 10

def self.config
  @config ||= ::Booth::Configuration.new
end

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

Yields the configuration instance.

Examples:

Booth.configure do |config|
  config.logger = MyLogger.new
end

Yield Parameters:

See Also:



24
25
26
# File 'lib/booth/configure.rb', line 24

def self.configure
  yield config
end

.reset!Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Note:

This is useful for testing, since the configuration is global and persists across tests.

Resets the configuration.



34
35
36
# File 'lib/booth/configure.rb', line 34

def self.reset!
  @configs = nil
end