Revert baypass_static_pages config

pull/14087/head
rubenmoya 6 years ago
parent 302740c779
commit 1fbaddc9fd

@ -28,7 +28,7 @@ class Admin::UsersController < Admin::AdminController
PASSWORD_DOES_NOT_MATCH_MESSAGE = 'Password does not match'.freeze
def profile
if !Cartodb.config[:bypass_static_pages].present?
if current_user.has_feature_flag?('dashboard_migration')
return render(file: "public/static/profile/index.html", layout: false)
end
@ -40,7 +40,7 @@ class Admin::UsersController < Admin::AdminController
end
def account
if !Cartodb.config[:bypass_static_pages].present?
if current_user.has_feature_flag?('dashboard_migration')
return render(file: "public/static/account/index.html", layout: false)
end

@ -58,7 +58,7 @@ class Admin::VisualizationsController < Admin::AdminController
skip_before_filter :verify_authenticity_token, only: [:show_protected_public_map, :show_protected_embed_map]
def index
if Cartodb.config[:bypass_static_pages].blank?
if current_user.has_feature_flag?('dashboard_migration')
return render(file: "public/static/dashboard/index.html", layout: false)
end

@ -732,7 +732,6 @@ defaults: &defaults
isolines: false
routing: false
data_observatory: false
# bypass_static_pages: true
development:

@ -206,7 +206,6 @@ describe Admin::PagesController do
end
it 'extracts username from redirection for dashboard with subdomainless' do
Cartodb.with_config(bypass_static_pages: true) do
username = 'endedwithu'
anyuser = prepare_user(username)
host! 'localhost.lan'
@ -229,7 +228,6 @@ describe Admin::PagesController do
anyuser.delete
end
end
it 'redirects to login without login' do
host! 'localhost.lan'

@ -44,13 +44,11 @@ describe Admin::TablesController do
describe 'GET /dashboard' do
it 'returns a list of tables' do
Cartodb.with_config(bypass_static_pages: true) do
login_as(@user, scope: @user.username)
get "/dashboard", {}, @headers
last_response.status.should == 200
end
end
end # GET /tables
describe 'GET /tables/:id' do

@ -57,13 +57,11 @@ describe Admin::VisualizationsController do
describe 'GET /viz' do
it 'returns a list of visualizations' do
Cartodb.with_config(bypass_static_pages: true) do
login_as(@user, scope: @user.username)
get "/viz", {}, @headers
last_response.status.should == 200
end
end
it 'returns 403 if user not logged in' do
get "/viz", {}, @headers
@ -634,13 +632,11 @@ describe Admin::VisualizationsController do
end
it 'invokes user metadata redis caching' do
Cartodb.with_config(bypass_static_pages: true) do
Carto::UserDbSizeCache.any_instance.expects(:update_if_old).with(@user).once
login_as(@user, scope: @user.username)
get dashboard_path, {}, @headers
end
end
end
describe 'find visualizations by name' do
before(:all) do

@ -47,13 +47,11 @@ describe ApplicationController do
end
it 'loads the dashboard for a known user email' do
Cartodb.with_config(bypass_static_pages: true) do
stub_load_common_data
get dashboard_url, {}, authentication_headers(@user.email)
response.status.should == 200
response.body.should_not include("Log in")
end
end
it 'does not load the dashboard for an unknown user email' do
get dashboard_url, {}, authentication_headers('wadus@wadus.com')
@ -72,13 +70,11 @@ describe ApplicationController do
end
it 'loads the dashboard for a known user username' do
Cartodb.with_config(bypass_static_pages: true) do
stub_load_common_data
get dashboard_url, {}, authentication_headers(@user.username)
response.status.should == 200
response.body.should_not include("Log in")
end
end
it 'does not load the dashboard for an unknown user username' do
get dashboard_url, {}, authentication_headers("unknownuser")
@ -97,13 +93,11 @@ describe ApplicationController do
end
it 'loads the dashboard for a known user id' do
Cartodb.with_config(bypass_static_pages: true) do
stub_load_common_data
get dashboard_url, {}, authentication_headers(@user.id)
response.status.should == 200
response.body.should_not include("Log in")
end
end
it 'does not load the dashboard for an unknown user id' do
get dashboard_url, {}, authentication_headers(UUIDTools::UUID.timestamp_create.to_s)
@ -122,31 +116,25 @@ describe ApplicationController do
end
it 'loads the dashboard for a known user id' do
Cartodb.with_config(bypass_static_pages: true) do
stub_load_common_data
get dashboard_url, {}, authentication_headers(@user.id)
response.status.should == 200
response.body.should_not include("Log in")
end
end
it 'loads the dashboard for a known user username' do
Cartodb.with_config(bypass_static_pages: true) do
stub_load_common_data
get dashboard_url, {}, authentication_headers(@user.username)
response.status.should == 200
response.body.should_not include("Log in")
end
end
it 'loads the dashboard for a known user email' do
Cartodb.with_config(bypass_static_pages: true) do
stub_load_common_data
get dashboard_url, {}, authentication_headers(@user.email)
response.status.should == 200
response.body.should_not include("Log in")
end
end
it 'does not load the dashboard for an unknown user id' do
get dashboard_url, {}, authentication_headers(UUIDTools::UUID.timestamp_create.to_s)

@ -313,7 +313,6 @@ describe SessionsController do
end
it "authenticates users with casing differences in email" do
Cartodb.with_config(bypass_static_pages: true) do
Carto::SamlService.any_instance.stubs(:enabled?).returns(true)
Carto::SamlService.any_instance.stubs(:get_user_email).returns(@user.email.upcase)
@ -325,7 +324,6 @@ describe SessionsController do
get response.redirect_url
response.status.should eq 200
end
end
describe 'SAML logout' do
it 'calls SamlService#sp_logout_request from user-initiated logout' do

@ -39,7 +39,6 @@ feature "Sessions" do
end
scenario "Login in the application" do
Cartodb.with_config(bypass_static_pages: true) do
visit login_path
fill_in 'email', :with => @user.email
fill_in 'password', :with => 'blablapassword'
@ -53,7 +52,6 @@ feature "Sessions" do
click_link_or_button 'Log in'
page.should be_dashboard
end
end
scenario "Get the session information via OAuth" do
client_application = create_client_application :user => @user, :url => CartoDB.hostname, :callback_url => CartoDB.hostname
@ -115,12 +113,10 @@ feature "Sessions" do
include_context 'organization with users helper'
it 'allows login to organization users' do
Cartodb.with_config(bypass_static_pages: true) do
visit org_login_url(@org_user_1.organization)
send_login_form(@org_user_1)
page.should be_dashboard
end
end
it 'does not allow user+password login to organization users if auth_username_password_enabled is false' do
@organization.auth_username_password_enabled = false

@ -181,14 +181,12 @@ describe "UserState" do
Admin::UsersController.any_instance.stubs(:render)
login(@locked_user)
host! "#{@locked_user.username}.localhost.lan"
Cartodb.with_config(bypass_static_pages: true) do
@dashboard_endpoints.each do |endpoint|
get endpoint, {}, @headers
follow_redirects
request.path.should_not == '/lockout'
response.status.should == 200
end
end
@user_endpoints.each do |endpoint|
get endpoint, {}, @headers
follow_redirects
@ -225,7 +223,6 @@ describe "UserState" do
end
end
it 'non locked user accessing a locked user resources' do
Cartodb.with_config(bypass_static_pages: true) do
login(@non_locked_user)
@user_endpoints.each do |endpoint|
host! "#{@locked_user.username}.localhost.lan"
@ -239,7 +236,6 @@ describe "UserState" do
follow_redirects
response.status.should == 200
end
end
@tables_endpoints.each do |endpoint|
host! "#{@locked_user.username}.localhost.lan"
get endpoint, {}, @headers

@ -74,7 +74,7 @@ describe 'Warden' do
end
it 'allows access for non-expired session' do
Cartodb.with_config(passwords: { 'expiration_in_d' => nil }, bypass_static_pages: true) do
Cartodb.with_config(passwords: { 'expiration_in_d' => nil }) do
login
host! "#{@user.username}.localhost.lan"

Loading…
Cancel
Save