Skip to content

Commit

Permalink
Fixes #3840 - Removes unused Signo related code
Browse files Browse the repository at this point in the history
  • Loading branch information
ares committed Sep 8, 2014
1 parent d455f32 commit 7a2b2d7
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 317 deletions.
2 changes: 0 additions & 2 deletions app/models/setting/auth.rb
Expand Up @@ -17,8 +17,6 @@ def self.load_defaults
self.set('trusted_puppetmaster_hosts', N_('Hosts that will be trusted in addition to Smart Proxies for access to fact/report importers and ENC output'), []),
self.set('ssl_client_dn_env', N_('Environment variable containing the subject DN from a client SSL certificate'), 'SSL_CLIENT_S_DN'),
self.set('ssl_client_verify_env', N_('Environment variable containing the verification status of a client SSL certificate'), 'SSL_CLIENT_VERIFY'),
self.set('signo_sso', N_('Use Signo SSO for login'), false),
self.set('signo_url', N_('Signo SSO url'), "https://#{fqdn}/signo"),
self.set('login_delegation_logout_url', N_('Redirect your users to this url on logout (authorize_login_delegation should also be enabled)'), nil),
self.set('authorize_login_delegation_auth_source_user_autocreate', N_('Name of the external auth source where unknown externally authentication users (see authorize_login_delegation) should be created (keep unset to prevent the autocreation)'), nil),
].compact.each { |s| self.create! s.update(:category => "Setting::Auth")}
Expand Down
2 changes: 1 addition & 1 deletion app/services/sso.rb
@@ -1,5 +1,5 @@
module SSO
METHODS = [Apache, SignoBasic, Basic, Oauth, Signo]
METHODS = [Apache, Basic, Oauth]

def self.get_available(controller)
all_methods = all.map { |method| method.new(controller) }
Expand Down
71 changes: 0 additions & 71 deletions app/services/sso/signo.rb

This file was deleted.

45 changes: 0 additions & 45 deletions app/services/sso/signo_basic.rb

This file was deleted.

13 changes: 13 additions & 0 deletions db/migrate/20140908082450_remove_signo_setting.rb
@@ -0,0 +1,13 @@
class RemoveSignoSetting < ActiveRecord::Migration
class FakeSetting < ActiveRecord::Base
self.table_name = 'settings'
end

def up
FakeSetting.delete_all(:name => %w(signo_url signo_sso))
end

def down
# settings would be created by Setting on code version that uses it
end
end
10 changes: 0 additions & 10 deletions test/fixtures/settings.yml
Expand Up @@ -160,16 +160,6 @@ attribute33:
category: Setting::General
default: "true"
description: "Should Foreman use gravatar to display user icons"
attribute34:
name: signo_sso
category: Setting::Auth
default: "false"
description: "Use SSO"
attribute35:
name: signo_url
category: Setting::Auth
default: "https://localhost:3002"
description: "Where Signo runs"
attribute36:
name: puppetrun
category: Setting::Puppet
Expand Down
39 changes: 0 additions & 39 deletions test/functional/dashboard_controller_test.rb
Expand Up @@ -5,43 +5,4 @@ class DashboardControllerTest < ActionController::TestCase
get :index, {}, set_session_user
assert_response :success
end

def user_with_viewer_rights_should_succeed_in_viewing_the_dashboard
@request.session[:user] = users(:one).id
users(:one).roles = [Role.find_by_name('Anonymous'), Role.find_by_name('Viewer')]
get :index
assert_response :success
end

test "should redirect unknown users to signo when SSO allowed" do
configure_sso
@controller.env = @controller.request.env
get :index
assert_response :redirect
assert @response.redirect_url.include?(Setting['signo_url'])
restore_signo
end

test "OpenID request should be made for known users to Signo when SSO allowed" do
configure_sso
request.cookies[:username] = users(:admin).login
@controller.env = @controller.request.env
get :index
assert_response 401
identifier = @response.headers.try(:[], "WWW-Authenticate")
assert_equal "OpenID identifier=\"#{Setting['signo_url']}/user/#{users(:admin).login}\"", identifier
restore_signo
end

def configure_sso
@signo_sso = Setting['signo_sso']
@authorize_login_delegation = Setting["authorize_login_delegation"]
Setting['signo_sso'] = true
Setting["authorize_login_delegation"] = false
end

def restore_signo
Setting['signo_sso'] = @signo_sso
Setting["authorize_login_delegation"] = @authorize_login_delegation
end
end
2 changes: 0 additions & 2 deletions test/functional/hosts_controller_test.rb
Expand Up @@ -371,7 +371,6 @@ def setup_multiple_environments

test "if only authorize_login_delegation is set, REMOTE_USER should be
ignored for API requests" do
Setting[:signo_sso] = false
Setting[:authorize_login_delegation] = true
Setting[:authorize_login_delegation_api] = false
set_remote_user_to users(:admin)
Expand All @@ -385,7 +384,6 @@ def setup_multiple_environments

test "if both authorize_login_delegation{,_api} are unset,
REMOTE_USER should ignored in all cases" do
Setting[:signo_sso] = false
Setting[:authorize_login_delegation] = false
Setting[:authorize_login_delegation_api] = false
set_remote_user_to users(:admin)
Expand Down
47 changes: 0 additions & 47 deletions test/unit/sso/signo_basic_test.rb

This file was deleted.

100 changes: 0 additions & 100 deletions test/unit/sso/signo_test.rb

This file was deleted.

0 comments on commit 7a2b2d7

Please sign in to comment.