lib/jamf/api/connection/token.rb
def token_connection(rsrc, token: nil, pw: nil, timeout: nil, ssl_opts: nil)
        Faraday.new("#{@base_url}/#{rsrc}", ssl: ssl_opts) do |con|
          con.headers[Jamf::Connection::HTTP_ACCEPT_HEADER] = Jamf::Connection::MIME_JSON
          con.response :json, parser_options: { symbolize_names: true }
          con.options[:timeout] = timeout
          con.options[:open_timeout] = timeout
          if token
            con.headers[:authorization] = token
          else
            con.basic_auth @user, pw
          end
          con.adapter Faraday::Adapter::NetHttp
        end # Faraday.new
      end
# a generic, one-time Faraday connection for token
# acquision & manipulation
#
a generic, one-time Faraday connection for token
acquision & manipulation
a generic one - time Faraday connection for token acquision & manipulation
def token_connection(rsrc, token: nil, pw: nil, timeout: nil, ssl_opts: nil)
        Faraday.new("#{@base_url}/#{rsrc}", ssl: ssl_opts) do |con|
          con.headers[Jamf::Connection::HTTP_ACCEPT_HEADER] = Jamf::Connection::MIME_JSON
          con.response :json, parser_options: { symbolize_names: true }
          con.options[:timeout] = timeout
          con.options[:open_timeout] = timeout
          if token
            con.headers[:authorization] = token
          else
            con.basic_auth @user, pw
          end
          con.adapter Faraday::Adapter::NetHttp
        end 
      end
def token_connection ( rsrc , token : nil , pw : nil , timeout : nil , ssl_opts : nil ) Faraday . new ( "#{@base_url}/#{rsrc}" , ssl : ssl_opts ) do | con | con . headers [ Jamf :: Connection :: HTTP_ACCEPT_HEADER ] = Jamf :: Connection :: MIME_JSON con . response :json , parser_options : { symbolize_names : true } con . options [ :timeout ] = timeout con . options [ :open_timeout ] = timeout if token con . headers [ :authorization ] = token else con . basic_auth @user , pw end con . adapter Faraday :: Adapter :: NetHttp end end
a generic, one-time Faraday connection for token
acquision & manipulation
a generic one - time Faraday connection for token acquision & manipulation
# Faraday.new
rsrc
token
pw
timeout
ssl_opts