lib/jamf/api/connection.rb
# Turn the connection parameters into instance vars
Turn the connection parameters into instance vars
Turn the connection parameters into instance vars
def parse_connect_params(params)
      @host = params[:host]
      @port = params[:port]
      @user = params[:user]
      @keep_alive = params[:keep_alive].nil? ? false : params[:keep_alive]
      @pw_fallback = params[:pw_fallback].nil? ? true : params[:pw_fallback]
      @token_refresh = params[:token_refresh].to_i
      @timeout = params[:timeout]
      @open_timeout = params[:open_timeout]
      rsrc_base = @host == Token::JAMF_TRYITOUT_HOST ? 'uapi' : RSRC_BASE
      @base_url = URI.parse "https://#{@host}:#{@port}/#{rsrc_base}"
      @ssl_options = {
        verify: params[:verify_cert],
        version: params[:ssl_version]
      }
      @name = "#{@user}@#{@host}:#{@port}" if @name == NOT_CONNECTED
    end
def parse_connect_params ( params ) @host = params [ :host ] @port = params [ :port ] @user = params [ :user ] @keep_alive = params [ :keep_alive ] . nil? ? false : params [ :keep_alive ] @pw_fallback = params [ :pw_fallback ] . nil? ? true : params [ :pw_fallback ] @token_refresh = params [ :token_refresh ] . to_i @timeout = params [ :timeout ] @open_timeout = params [ :open_timeout ] rsrc_base = @host == Token :: JAMF_TRYITOUT_HOST ? 'uapi' : RSRC_BASE @base_url = URI . parse "https://#{@host}:#{@port}/#{rsrc_base}" @ssl_options = { verify : params [ :verify_cert ] , version : params [ :ssl_version ] } @name = "#{@user}@#{@host}:#{@port}" if @name == NOT_CONNECTED end
Turn the connection parameters into instance vars
Turn the connection parameters into instance vars
# TEMPORARY ? the tryitout host still uses `uapi` rather than the # new `api` for regular servers # ssl opts for faraday # TODO: implement all of faraday's options
params