test/lib/testhelper/auth.rb
# TODO: pass in the API server for which we want the dist point pw
# must be connected to api
# and make it like API connection above, 1 per keychain.
pass in the API server for which we want the dist point pw
must be connected to api
and make it like API connection above, 1 per keychain.
pass in the API server for which we want the dist point pw must be connected to api and make it like API connection above 1 per keychain .
def dist_point_pw
      keychain_creds = rw_credentials_from_keychain(:db, @api_server, KEYCHAIN_DIST_ACCT)
      if keychain_creds
        @distpw = keychain_creds[:password]
        return @distpw if JSS::DistributionPoint.master_distribution_point.check_pw :rw, distpw
      end
      prmpt = "Enter the RW password for the Master Distribution Point on JSS #{@api_server}"
      @distpw = prompt_for_password prompt: prmpt do |apw|
        JSS::DistributionPoint.master_distribution_point.check_pw :rw, apw
      end 
      raise JSS::AuthenticationError, "Incorrect RW password for the Master Distribution Point on JSS #{@api_server}" unless @distpw
      save_rw_credentials KEYCHAIN_DIST_LABEL, KEYCHAIN_DIST_ACCT, @api_server, @distpw
      @distpw
    end
def dist_point_pw keychain_creds = rw_credentials_from_keychain ( :db , @api_server , KEYCHAIN_DIST_ACCT ) if keychain_creds @distpw = keychain_creds [ :password ] return @distpw if JSS :: DistributionPoint . master_distribution_point . check_pw :rw , distpw end prmpt = "Enter the RW password for the Master Distribution Point on JSS #{@api_server}" @distpw = prompt_for_password prompt : prmpt do | apw | JSS :: DistributionPoint . master_distribution_point . check_pw :rw , apw end raise JSS :: AuthenticationError , "Incorrect RW password for the Master Distribution Point on JSS #{@api_server}" unless @distpw save_rw_credentials KEYCHAIN_DIST_LABEL , KEYCHAIN_DIST_ACCT , @api_server , @distpw @distpw end
TODO: pass in the API server for which we want the dist point pw
must be connected to api
and make it like API connection above, 1 per keychain.
TODO : pass in the API server for which we want the dist point pw must be connected to api and make it like API connection above 1 per keychain .
# if we're here, there was no stored pw or it was incorrect # If we're here, we need to get the passwd for the master dist point # do apw # store the pw