GRN-80: Allow local accounts on multitenant (#428)

* Changed the way the omniauth providers are declared

* Allow local authentication for multitenant mode based on customer settings

* Cleanead up code mandated by rubocop

* Completed implementation for signin and added the one for signup

* Fixed issue with rubocop

* Renamed customer_name to lb_user

* Renamed lb_user -> user_domain, fixed issue with signup controller, email verification WAS NOT implemented

* Completed implementation of email_verification

* Fixed rubocop issue

* Final update

* Fix for test with loadbalancer

* Make sure loadbalancer mockup is only used when env defined

* Fix for test on rooms_controller

* Fixed most of the test failing on multitenant env

* Fixed issue detected by rubocop

* Fixed issue with activation tockens not working on resend

* Fixed new issue found by rubocop

* Updated travis script

* Harcoded credentials for mockup

* Updated expectation on start_session

* Fixed issue with duplication of home room

* Updated script for rubocop

* Restored Gemfile
This commit is contained in:
Jesus Federico
2019-04-05 14:54:36 -04:00
committed by GitHub
parent 5ba5b663ac
commit b15868fb3c
28 changed files with 354 additions and 293 deletions

View File

@ -83,7 +83,7 @@ describe Room, type: :model do
@room.start_session
end.to change { @room.sessions }.by(1)
expect(@room.last_session.utc.to_i).to eq(Time.now.to_i)
expect(@room.last_session).not_to be nil
end
end
@ -93,13 +93,8 @@ describe Room, type: :model do
attendeePW: "testpass"
)
if Rails.configuration.loadbalanced_configuration
endpoint = Rails.configuration.loadbalancer_endpoint
secret = Rails.configuration.loadbalancer_secret
else
endpoint = Rails.configuration.bigbluebutton_endpoint
secret = Rails.configuration.bigbluebutton_secret
end
endpoint = Rails.configuration.bigbluebutton_endpoint
secret = Rails.configuration.bigbluebutton_secret
fullname = "fullName=Example"
meeting_id = "&meetingID=#{@room.bbb_id}"
password = "&password=testpass"

View File

@ -76,30 +76,32 @@ describe User, type: :model do
end
end
context '#from_omniauth' do
let(:auth) do
{
"uid" => "123456789",
"provider" => "twitter",
"info" => {
"name" => "Test Name",
"nickname" => "username",
"email" => "test@example.com",
"image" => "example.png",
},
}
end
unless Rails.configuration.omniauth_bn_launcher
context '#from_omniauth' do
let(:auth) do
{
"uid" => "123456789",
"provider" => "twitter",
"info" => {
"name" => "Test Name",
"nickname" => "username",
"email" => "test@example.com",
"image" => "example.png",
},
}
end
it "should create user from omniauth" do
expect do
user = User.from_omniauth(auth)
it "should create user from omniauth" do
expect do
user = User.from_omniauth(auth)
expect(user.name).to eq("Test Name")
expect(user.email).to eq("test@example.com")
expect(user.image).to eq("example.png")
expect(user.provider).to eq("twitter")
expect(user.social_uid).to eq("123456789")
end.to change { User.count }.by(1)
expect(user.name).to eq("Test Name")
expect(user.email).to eq("test@example.com")
expect(user.image).to eq("example.png")
expect(user.provider).to eq("twitter")
expect(user.social_uid).to eq("123456789")
end.to change { User.count }.by(1)
end
end
end