Class: FastMcpJwtAuth::Configuration
- Inherits:
-
Object
- Object
- FastMcpJwtAuth::Configuration
- Defined in:
- lib/fast_mcp_jwt_auth/configuration.rb
Overview
Configuration class for FastMcpJwtAuth gem settings
Instance Attribute Summary collapse
-
#current_resetter ⇒ Object
Returns the value of attribute current_resetter.
-
#current_user_setter ⇒ Object
Returns the value of attribute current_user_setter.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#jwt_decoder ⇒ Object
Returns the value of attribute jwt_decoder.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#token_validator ⇒ Object
Returns the value of attribute token_validator.
-
#user_finder ⇒ Object
Returns the value of attribute user_finder.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/fast_mcp_jwt_auth/configuration.rb', line 9 def initialize @enabled = true @logger = defined?(Rails) ? Rails.logger : Logger.new($stdout) @jwt_decoder = nil @user_finder = nil @token_validator = lambda do |decoded_token| decoded_token[:exp].nil? || decoded_token[:exp] >= Time.current.to_i end @current_user_setter = ->(user) { Current.user = user } @current_resetter = -> { Current.reset } end |
Instance Attribute Details
#current_resetter ⇒ Object
Returns the value of attribute current_resetter.
6 7 8 |
# File 'lib/fast_mcp_jwt_auth/configuration.rb', line 6 def current_resetter @current_resetter end |
#current_user_setter ⇒ Object
Returns the value of attribute current_user_setter.
6 7 8 |
# File 'lib/fast_mcp_jwt_auth/configuration.rb', line 6 def current_user_setter @current_user_setter end |
#enabled ⇒ Object
Returns the value of attribute enabled.
6 7 8 |
# File 'lib/fast_mcp_jwt_auth/configuration.rb', line 6 def enabled @enabled end |
#jwt_decoder ⇒ Object
Returns the value of attribute jwt_decoder.
6 7 8 |
# File 'lib/fast_mcp_jwt_auth/configuration.rb', line 6 def jwt_decoder @jwt_decoder end |
#logger ⇒ Object
Returns the value of attribute logger.
6 7 8 |
# File 'lib/fast_mcp_jwt_auth/configuration.rb', line 6 def logger @logger end |
#token_validator ⇒ Object
Returns the value of attribute token_validator.
6 7 8 |
# File 'lib/fast_mcp_jwt_auth/configuration.rb', line 6 def token_validator @token_validator end |
#user_finder ⇒ Object
Returns the value of attribute user_finder.
6 7 8 |
# File 'lib/fast_mcp_jwt_auth/configuration.rb', line 6 def user_finder @user_finder end |