class ResoTransport::Authentication::StaticTokenAuth

A simple auth strategy that uses a static, non-expiring token.

Attributes

access_token[R]
token_type[R]

Public Class Methods

new(options) click to toggle source
# File lib/reso_transport/authentication/static_token_auth.rb, line 8
def initialize(options)
  @access_token = options.fetch(:access_token)
  @token_type   = options.fetch(:token_type, "Bearer")
end

Public Instance Methods

authenticate() click to toggle source

Simply returns a static, never expiring access token @return [Access] The access token object

# File lib/reso_transport/authentication/static_token_auth.rb, line 15
def authenticate
  Access.new(
    access_token: access_token,
    token_type: token_type,
    expires_in: 1 << (1.size * 8 - 2) - 1 # Max int value
  )
end