Skip to content

Commit

Permalink
use https for bigbluebutton API
Browse files Browse the repository at this point in the history
test plan: bigbluebutton should still work and requests to
 /bigbluebutton/api/... should go over https instead of http

closes CNVS-38120

Change-Id: I9c648371e521ee4d0a94cf50605a6a7e9420bb97
Reviewed-on: https://gerrit.instructure.com/118609
Tested-by: Jenkins
Reviewed-by: Venk Natarajan <[email protected]>
QA-Review: Deepeeca Soundarrajan <[email protected]>
Product-Review: Jeremy Stanley <[email protected]>
  • Loading branch information
jstanley0 committed Jul 14, 2017
1 parent 65c8824 commit e0668bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/models/big_blue_button_conference.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def delete_recording(recording_id)
def generate_request(action, options)
query_string = options.to_query
query_string << ("&checksum=" + Digest::SHA1.hexdigest(action.to_s + query_string + config[:secret_dec]))
"http://#{config[:domain]}/bigbluebutton/api/#{action}?#{query_string}"
"https://#{config[:domain]}/bigbluebutton/api/#{action}?#{query_string}"
end

def send_request(action, options)
Expand Down
10 changes: 5 additions & 5 deletions spec/models/big_blue_button_conference_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
params = {:fullName => user_factory.name, :meetingID => @conference.conference_key, :userID => user_factory.id}
admin_params = params.merge(:password => 'admin').to_query
user_params = params.merge(:password => 'user').to_query
expect(@conference.admin_join_url(@user)).to eql("http://bbb.instructure.com/bigbluebutton/api/join?#{admin_params}&checksum=" + Digest::SHA1.hexdigest("join#{admin_params}secret"))
expect(@conference.participant_join_url(@user)).to eql("http://bbb.instructure.com/bigbluebutton/api/join?#{user_params}&checksum=" + Digest::SHA1.hexdigest("join#{user_params}secret"))
expect(@conference.admin_join_url(@user)).to eql("https://bbb.instructure.com/bigbluebutton/api/join?#{admin_params}&checksum=" + Digest::SHA1.hexdigest("join#{admin_params}secret"))
expect(@conference.participant_join_url(@user)).to eql("https://bbb.instructure.com/bigbluebutton/api/join?#{user_params}&checksum=" + Digest::SHA1.hexdigest("join#{user_params}secret"))
end

it "should confirm valid config" do
Expand All @@ -69,19 +69,19 @@
it "should recreate the conference" do
expect(@conference).to receive(:send_request).with(:create, anything).and_return(true)

expect(@conference.craft_url(@user)).to match(/\Ahttp:\/\/bbb\.instructure\.com\/bigbluebutton\/api\/join/)
expect(@conference.craft_url(@user)).to match(/\Ahttps:\/\/bbb\.instructure\.com\/bigbluebutton\/api\/join/)

# load a new instance to clear out @conference_active
@conference = WebConference.find(@conference.id)
expect(@conference).to receive(:send_request).with(:create, anything).and_return(true)
expect(@conference.craft_url(@user)).to match(/\Ahttp:\/\/bbb\.instructure\.com\/bigbluebutton\/api\/join/)
expect(@conference.craft_url(@user)).to match(/\Ahttps:\/\/bbb\.instructure\.com\/bigbluebutton\/api\/join/)
end

it "should not recreate the conference if it is active" do
expect(@conference).to receive(:send_request).once.with(:create, anything).and_return(true)
@conference.initiate_conference
expect(@conference.active?).to be_truthy
expect(@conference.craft_url(@user)).to match(/\Ahttp:\/\/bbb\.instructure\.com\/bigbluebutton\/api\/join/)
expect(@conference.craft_url(@user)).to match(/\Ahttps:\/\/bbb\.instructure\.com\/bigbluebutton\/api\/join/)
end

it "return nil if a request times out" do
Expand Down

0 comments on commit e0668bb

Please sign in to comment.