Skip to content

Commit

Permalink
Add ldap and google to provider whitelist for rooms migration (bigblu…
Browse files Browse the repository at this point in the history
  • Loading branch information
scouillard authored and pachidj87 committed Jul 19, 2023
1 parent c09ffd3 commit 2b1fe65
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/api/v1/migrations/external_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,13 @@ def create_user
# shared_users_emails: [ <list of shared users emails> ] }}
# Returns: { data: Array[serializable objects] , errors: Array[String] }
# Does: Creates a Room and its RoomMeetingOptions.
# rubocop:disable Metrics/CyclomaticComplexity
def create_room
room_hash = room_params.to_h

# Re-write LDAP and Google to greenlight
room_hash[:provider] = %w[greenlight ldap google].include?(room_hash[:provider]) ? 'greenlight' : room_hash[:provider]

unless room_hash[:provider] == 'greenlight' || Tenant.exists?(name: room_hash[:provider])
return render_error(status: :bad_request, errors: 'Provider does not exist')
end
Expand Down Expand Up @@ -165,6 +169,7 @@ def create_room

render_data status: :created
end
# rubocop:enable Metrics/CyclomaticComplexity

# POST /api/v1/migrations/site_settings.json
# Expects: { settings: { site_settings: { :PrimaryColor, :PrimaryColorLight, :PrimaryColorDark,
Expand Down

0 comments on commit 2b1fe65

Please sign in to comment.