devise_cas_authenticatable 1.10.4 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +32 -0
- data/.gitignore +0 -1
- data/CHANGELOG.md +65 -44
- data/Gemfile +8 -0
- data/README.md +85 -89
- data/app/controllers/devise/cas_sessions_controller.rb +25 -69
- data/app/views/devise/cas_sessions/unregistered.html.erb +3 -3
- data/devise_cas_authenticatable.gemspec +19 -26
- data/lib/devise_cas_authenticatable/model.rb +21 -28
- data/lib/devise_cas_authenticatable/routes.rb +22 -44
- data/lib/devise_cas_authenticatable/strategy.rb +14 -30
- data/lib/devise_cas_authenticatable.rb +27 -79
- data/spec/model_spec.rb +29 -35
- data/spec/routes_spec.rb +26 -26
- data/spec/scenario/app/assets/config/manifest.js +0 -0
- data/spec/scenario/app/controllers/home_controller.rb +2 -2
- data/spec/scenario/app/views/layouts/application.html.erb +1 -3
- data/spec/scenario/config/application.rb +1 -27
- data/spec/scenario/config/initializers/backtrace_silencers.rb +1 -1
- data/spec/scenario/config/initializers/devise.rb +2 -2
- data/spec/scenario/config/routes.rb +0 -4
- data/spec/scenario/db/migrate/20100401102949_create_tables.rb +3 -3
- data/spec/scenario/db/migrate/20111002012903_add_sessions_table.rb +1 -1
- data/spec/scenario/db/migrate/20121009092400_add_deactivated_flag_to_users.rb +1 -1
- data/spec/spec_helper.rb +38 -8
- data/spec/strategy_spec.rb +43 -82
- data/spec/support/migrations.rb +1 -1
- metadata +21 -126
- data/.travis.yml +0 -45
- data/Gemfile.devise12 +0 -11
- data/Gemfile.devise13 +0 -11
- data/Gemfile.devise14 +0 -11
- data/Gemfile.devise15 +0 -11
- data/Gemfile.devise20 +0 -11
- data/Gemfile.devise21 +0 -13
- data/Gemfile.devise30 +0 -12
- data/Gemfile.devise42 +0 -13
- data/lib/devise_cas_authenticatable/exceptions.rb +0 -10
- data/lib/devise_cas_authenticatable/memcache_checker.rb +0 -42
- data/lib/devise_cas_authenticatable/railtie.rb +0 -14
- data/lib/devise_cas_authenticatable/schema.rb +0 -20
- data/lib/devise_cas_authenticatable/session_store_identifier.rb +0 -29
- data/lib/devise_cas_authenticatable/single_sign_out/rack.rb +0 -39
- data/lib/devise_cas_authenticatable/single_sign_out/strategies/base.rb +0 -11
- data/lib/devise_cas_authenticatable/single_sign_out/strategies/rails_cache.rb +0 -31
- data/lib/devise_cas_authenticatable/single_sign_out/strategies/redis_cache.rb +0 -38
- data/lib/devise_cas_authenticatable/single_sign_out/strategies.rb +0 -58
- data/lib/devise_cas_authenticatable/single_sign_out/warden_failure_app.rb +0 -46
- data/lib/devise_cas_authenticatable/single_sign_out/with_conn.rb +0 -14
- data/lib/devise_cas_authenticatable/single_sign_out.rb +0 -69
- data/spec/config_spec.rb +0 -27
- data/spec/memcache_checker_spec.rb +0 -49
- data/spec/scenario/config/castronaut.yml +0 -32
- data/spec/scenario/config/initializers/castronaut.rb +0 -1
- data/spec/scenario/config/initializers/session_store.rb +0 -8
- data/spec/single_sign_out_spec.rb +0 -51
- data/spec/support/urls.rb +0 -19
- data/spec/warden_failure_app_spec.rb +0 -53
@@ -1,51 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe DeviseCasAuthenticatable::SingleSignOut::WardenFailureApp do
|
4
|
-
include RSpec::Rails::RequestExampleGroup
|
5
|
-
include Capybara::DSL
|
6
|
-
|
7
|
-
describe "A logged in user with a timed out session" do
|
8
|
-
|
9
|
-
before do
|
10
|
-
Devise.cas_base_url = "http://www.example.com/cas_server"
|
11
|
-
User.delete_all
|
12
|
-
@user = User.create!(:username => "joeuser")
|
13
|
-
end
|
14
|
-
|
15
|
-
describe "using the default warden failure app" do
|
16
|
-
|
17
|
-
before do
|
18
|
-
sign_into_cas "joeuser", "joepassword"
|
19
|
-
end
|
20
|
-
|
21
|
-
it "redirects to cas_login_url when warden is thrown" do
|
22
|
-
Devise::FailureApp.any_instance.expects(:redirect_url).returns(cas_login_url)
|
23
|
-
Timecop.travel(Devise.timeout_in) do
|
24
|
-
visit root_url
|
25
|
-
end
|
26
|
-
current_url.should == root_url
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
|
31
|
-
describe "using the custom WardenFailureApp" do
|
32
|
-
|
33
|
-
before do
|
34
|
-
|
35
|
-
Devise.warden_config[:failure_app] = DeviseCasAuthenticatable::SingleSignOut::WardenFailureApp
|
36
|
-
sign_into_cas "joeuser", "joepassword"
|
37
|
-
end
|
38
|
-
|
39
|
-
it "uses the redirect_url from the custom failure class" do
|
40
|
-
DeviseCasAuthenticatable::SingleSignOut::WardenFailureApp.any_instance.expects(:redirect_url).returns(destroy_user_session_url)
|
41
|
-
Timecop.travel(Devise.timeout_in) do
|
42
|
-
visit root_url
|
43
|
-
end
|
44
|
-
current_url.should match(/#{cas_logout_url}/)
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
48
|
-
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
data/spec/support/urls.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
def cas_login_url
|
2
|
-
@cas_login_url ||= begin
|
3
|
-
uri = URI.parse(Devise.cas_base_url + "/login")
|
4
|
-
uri.query = Rack::Utils.build_nested_query(:service => user_service_url)
|
5
|
-
uri.to_s
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
def cas_logout_url
|
10
|
-
@cas_logout_url ||= Devise.cas_base_url + "/logout"
|
11
|
-
end
|
12
|
-
|
13
|
-
def sign_into_cas(username, password)
|
14
|
-
visit cas_login_url
|
15
|
-
fill_in "Username", :with => username
|
16
|
-
fill_in "Password", :with => password
|
17
|
-
click_on "Login"
|
18
|
-
current_url.should == root_url
|
19
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe DeviseCasAuthenticatable::SingleSignOut::WardenFailureApp do
|
4
|
-
|
5
|
-
describe "#redirect_url" do
|
6
|
-
|
7
|
-
before do
|
8
|
-
Devise.cas_base_url = "http://www.example.com/cas_server"
|
9
|
-
@failure_app = DeviseCasAuthenticatable::SingleSignOut::WardenFailureApp.new
|
10
|
-
@failure_app.stubs(:flash).returns({})
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "resulting from a timeout" do
|
14
|
-
|
15
|
-
before do
|
16
|
-
@failure_app.stubs(:warden_message).returns(:timeout)
|
17
|
-
end
|
18
|
-
|
19
|
-
it "returns the logout url" do
|
20
|
-
@failure_app.send(:redirect_url).should match(/#{cas_logout_url}/)
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
24
|
-
|
25
|
-
describe "resulting from an inactive" do
|
26
|
-
|
27
|
-
before do
|
28
|
-
@failure_app.stubs(:warden_message).returns(:inactive)
|
29
|
-
end
|
30
|
-
|
31
|
-
it "returns the logout url" do
|
32
|
-
@failure_app.send(:redirect_url).should match(/#{cas_logout_url}/)
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
describe "resulting from a generic warden :throw error" do
|
38
|
-
|
39
|
-
before do
|
40
|
-
@failure_app.stubs(:warden_message).returns(nil)
|
41
|
-
@failure_app.stubs(:flash).returns({})
|
42
|
-
end
|
43
|
-
|
44
|
-
it "calls the scope_path method to retrieve the standard redirect_url" do
|
45
|
-
@failure_app.expects(:scope_path)
|
46
|
-
@failure_app.send(:redirect_url)
|
47
|
-
end
|
48
|
-
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|