mojolingo / sippy_cup

Create SIP load test scenarios the easy way
http://mojolingo.github.io/sippy_cup
MIT License
219 stars 78 forks source link

Add Authentication Required and Proxy Authentication Required. #107

Open ssether-usinternet opened 5 years ago

ssether-usinternet commented 5 years ago

I found this fork of Sippy Cup that adds these two very useful features. Authentation and Proxy Auth are difficult enough in sipp that (previously) I just gave up and didn't require authentication in my test infrastructure. This addition makes the auth effortless.

Auth becomes as simple as:

require 'sippy_cup'
scenario = SippyCup::Scenario.new 'Sippy Cup',from_user: "theUsername" do |s|
  s.invite
  s.auth_required
  s.ack_answer
  s.invite headers: ["[authentication username=theUsername password=thePassword]"]
  s.wait_for_answer
  s.ack_answer
  s.sleep 20
  s.hangup
end

Proxy auth would mean using s.proxy_auth_required instead of s.auth_required

This isn't my code, and I don't know why a pull request was ever created for this, but the only real potential problem as I see it is the method signature for adding a header is now an array, not a string to allow for multiple headers. If necessary to accept this merge request, it could be removed. The following commit is where it was added: https://github.com/Enflick/sippy_cup/commit/6ae9db5884d74c3f9079ff6af324f331fe133fa3

bklang commented 4 years ago

@Karn Wanted to bring this PR to your attention. Someone else in the community opened it. Are you willing to have us merge this back into the main SippyCup repo?

bklang commented 4 years ago

@Karn Would you let us know if you are willing to have your work merged into the upstream Sippy Cup code base?

Karn commented 4 years ago

Hey @bklang, apologies for the late reply. We can totally look at merging this back upstream, give me a few days to clean up the code and get it into a reviewing state!