Module: ApiKeys
- Defined in:
- lib/api_keys.rb,
lib/api_keys/engine.rb,
lib/api_keys/logging.rb,
lib/api_keys/version.rb,
lib/api_keys/controller.rb,
lib/api_keys/configuration.rb,
lib/api_keys/authentication.rb,
lib/api_keys/models/api_key.rb,
lib/api_keys/services/digestor.rb,
lib/api_keys/tenant_resolution.rb,
lib/api_keys/jobs/callbacks_job.rb,
lib/api_keys/jobs/update_stats_job.rb,
lib/api_keys/services/authenticator.rb,
lib/api_keys/services/token_generator.rb,
app/controllers/api_keys/keys_controller.rb,
lib/api_keys/models/concerns/has_api_keys.rb,
lib/generators/api_keys/install_generator.rb,
app/controllers/api_keys/security_controller.rb,
app/controllers/api_keys/application_controller.rb
Overview
——— Core ApiKeys Module Definition ——— Define the ApiKeys module itself and its primary interface methods early. This ensures that ApiKeys.configuration and ApiKeys.configure are available when other gem files are loaded and potentially use them at load time.
Defined Under Namespace
Modules: Authentication, Controller, Generators, Jobs, Logging, Models, Services, TenantResolution Classes: ApiKey, ApplicationController, Configuration, Engine, Error, KeysController, SecurityController
Constant Summary collapse
- VERSION =
"0.2.1"
Class Attribute Summary collapse
-
.configuration ⇒ Object
Provides access to the gem’s configuration.
Class Method Summary collapse
-
.configure {|configuration| ... } ⇒ Object
Main configuration block for the gem.
-
.reset_configuration! ⇒ Object
Resets the configuration to its default values.
Class Attribute Details
.configuration ⇒ Object
Provides access to the gem’s configuration. Initializes with default settings if not already configured. Note: ApiKeys::Configuration class must be loaded before this method is called in a way that triggers instantiation (e.g. first call).
25 26 27 28 29 |
# File 'lib/api_keys.rb', line 25 def configuration # Ensure @configuration is initialized with an instance of ApiKeys::Configuration. # The ApiKeys::Configuration class itself is defined in 'api_keys/configuration.rb'. @configuration ||= ::ApiKeys::Configuration.new end |
Class Method Details
.configure {|configuration| ... } ⇒ Object
Main configuration block for the gem. Example:
ApiKeys.configure do |config|
config.token_prefix = "my_app_"
end
36 37 38 |
# File 'lib/api_keys.rb', line 36 def configure yield(configuration) end |
.reset_configuration! ⇒ Object
Resets the configuration to its default values. Useful primarily for testing environments.
42 43 44 |
# File 'lib/api_keys.rb', line 42 def reset_configuration! @configuration = ::ApiKeys::Configuration.new end |