Module: RobustServerSocket
- Extended by:
- Configuration
- Defined in:
- lib/version.rb,
lib/robust_server_socket.rb,
lib/robust_server_socket/cacher.rb,
lib/robust_server_socket/client_token.rb,
lib/robust_server_socket/rate_limiter.rb,
lib/robust_server_socket/configuration.rb,
lib/robust_server_socket/secure_token/decrypt.rb,
lib/robust_server_socket/modules/rate_limit_protection.rb,
lib/robust_server_socket/modules/client_auth_protection.rb,
lib/robust_server_socket/modules/replay_attack_protection.rb
Defined Under Namespace
Modules: Cacher, Configuration, Modules, SecureToken Classes: ClientToken, ConfigStore, RateLimiter
Constant Summary collapse
- VERSION =
'0.4.3'
Constants included from Configuration
Configuration::ConfigurationError, Configuration::MIN_KEY_SIZE
Instance Attribute Summary
Attributes included from Configuration
Class Method Summary collapse
-
.load! ⇒ Object
rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength.
Methods included from Configuration
_push_bang_modules_check_code, _push_modules_check_code, configure, configured?, correct_configuration?
Class Method Details
.load! ⇒ Object
rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/robust_server_socket.rb', line 17 def load! # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength raise 'You must correctly configure RobustServerSocket first!' unless configured? configuration.using_modules.each do |mod| raise ArgumentError, 'Module must be a Symbol!' unless mod.is_a?(Symbol) require_relative "robust_server_socket/modules/#{mod}" ClientToken.include const_get(mod.to_s.split('_').map(&:capitalize).unshift('Modules::').join) end ClientToken.class_eval(<<~METHOD, __FILE__, __LINE__ + 1) def modules_checks #{(RobustServerSocket.configuration._modules_check_rows.empty? ? ['true'] : RobustServerSocket.configuration._modules_check_rows.map(&:strip)).join(' && ')} end def modules_checks! #{(RobustServerSocket.configuration._bang_modules_check_rows.empty? ? ['true'] : RobustServerSocket.configuration._bang_modules_check_rows).join} end METHOD end |