Sha256: e3259e9f4f12f5e339f0a65ca10aa1959c73fb4e1647fa181e587405b65cc412
Contents?: true
Size: 700 Bytes
Versions: 25
Compression:
Stored size: 700 Bytes
Contents
module ResoTransport module Authentication # A simple auth strategy that uses a static, non-expiring token. class StaticTokenAuth < AuthStrategy attr_reader :access_token attr_reader :token_type def initialize(options) @access_token = options.fetch(:access_token) @token_type = options.fetch(:token_type, "Bearer") end # Simply returns a static, never expiring access token # @return [Access] The access token object def authenticate Access.new( access_token: access_token, token_type: token_type, expires_in: 1 << (1.size * 8 - 2) - 1 # Max int value ) end end end end
Version data entries
25 entries across 25 versions & 1 rubygems