Class: Hanko::Configuration
- Inherits:
-
Object
- Object
- Hanko::Configuration
- Defined in:
- lib/hanko/configuration.rb
Overview
Holds configuration options for the Hanko SDK.
Set values via configure or pass them directly to Hanko::Client#initialize.
Constant Summary collapse
- ATTRIBUTES =
i[ api_url api_key timeout open_timeout retry_count clock_skew jwks_cache_ttl logger log_level ].freeze
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Creates a new Configuration with sensible defaults.
-
#inspect ⇒ String
Returns a human-readable representation with the API key redacted.
Constructor Details
#initialize ⇒ Configuration
Creates a new Configuration with sensible defaults.
43 44 45 46 47 48 49 50 |
# File 'lib/hanko/configuration.rb', line 43 def initialize @timeout = 5 @open_timeout = 2 @retry_count = 1 @clock_skew = 0 @jwks_cache_ttl = 3600 @log_level = :info end |
Instance Method Details
#inspect ⇒ String
Returns a human-readable representation with the API key redacted.
55 56 57 58 59 60 61 62 |
# File 'lib/hanko/configuration.rb', line 55 def inspect attrs = ATTRIBUTES.map do |key| value = send(key) value = '[REDACTED]' if key == :api_key && value "#{key}=#{value.inspect}" end "#<#{self.class} #{attrs.join(', ')}>" end |