Class: SSO::Client::Warden::Hooks::AfterFetch
- Inherits:
-
Object
- Object
- SSO::Client::Warden::Hooks::AfterFetch
- Includes:
- Benchmarking, Logging, Meter
- Defined in:
- lib/sso/client/warden/hooks/after_fetch.rb
Overview
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#passport ⇒ Object
readonly
Returns the value of attribute passport.
-
#warden ⇒ Object
readonly
Returns the value of attribute warden.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(passport:, warden:, options:) ⇒ AfterFetch
constructor
A new instance of AfterFetch.
Methods included from Meter
#caller_name, #metric, #timing, #track
Methods included from Logging
#debug, #error, #fatal, #info, #logger, #progname, #warn
Methods included from Benchmarking
Constructor Details
#initialize(passport:, warden:, options:) ⇒ AfterFetch
Returns a new instance of AfterFetch.
27 28 29 |
# File 'lib/sso/client/warden/hooks/after_fetch.rb', line 27 def initialize(passport:, warden:, options:) @passport, @warden, @options = passport, warden, end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
17 18 19 |
# File 'lib/sso/client/warden/hooks/after_fetch.rb', line 17 def @options end |
#passport ⇒ Object (readonly)
Returns the value of attribute passport.
17 18 19 |
# File 'lib/sso/client/warden/hooks/after_fetch.rb', line 17 def passport @passport end |
#warden ⇒ Object (readonly)
Returns the value of attribute warden.
17 18 19 |
# File 'lib/sso/client/warden/hooks/after_fetch.rb', line 17 def warden @warden end |
Class Method Details
Instance Method Details
#call ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/sso/client/warden/hooks/after_fetch.rb', line 31 def call return unless passport.is_a?(::SSO::Client::Passport) verify rescue ::Timeout::Error error { 'SSO Server timed out. Continuing with last known authentication/authorization...' } meter :timeout, timeout_ms: verifier.human_readable_timeout_in_ms Operations.failure :server_request_timed_out rescue => exception ::SSO.config.exception_handler.call exception Operations.failure :client_exception_caught end |