class ResoTransport::Authentication::AuthStrategy

This base class defines the basic interface support by all client authentication implementations.

Attributes

access[R]

Public Instance Methods

authenticate(*) click to toggle source

@abstract Perform requests to authenticate the client with the API @return [Access] The access token object

# File lib/reso_transport/authentication/auth_strategy.rb, line 9
def authenticate(*)
  raise NotImplementedError, 'Implement me!'
end
ensure_valid_access!() click to toggle source

Ensure that a valid access token is present or raise an exception @raise [ResoWebApi::Errors::AccessDenied] If authentication fails

# File lib/reso_transport/authentication/auth_strategy.rb, line 15
def ensure_valid_access!
  @access = authenticate unless access && access.valid?
  access
end
reset() click to toggle source

Resets access

# File lib/reso_transport/authentication/auth_strategy.rb, line 21
def reset
  @access = nil
end