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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +32 -0
  3. data/.gitignore +0 -1
  4. data/CHANGELOG.md +65 -44
  5. data/Gemfile +8 -0
  6. data/README.md +85 -89
  7. data/app/controllers/devise/cas_sessions_controller.rb +25 -69
  8. data/app/views/devise/cas_sessions/unregistered.html.erb +3 -3
  9. data/devise_cas_authenticatable.gemspec +19 -26
  10. data/lib/devise_cas_authenticatable/model.rb +21 -28
  11. data/lib/devise_cas_authenticatable/routes.rb +22 -44
  12. data/lib/devise_cas_authenticatable/strategy.rb +14 -30
  13. data/lib/devise_cas_authenticatable.rb +27 -79
  14. data/spec/model_spec.rb +29 -35
  15. data/spec/routes_spec.rb +26 -26
  16. data/spec/scenario/app/assets/config/manifest.js +0 -0
  17. data/spec/scenario/app/controllers/home_controller.rb +2 -2
  18. data/spec/scenario/app/views/layouts/application.html.erb +1 -3
  19. data/spec/scenario/config/application.rb +1 -27
  20. data/spec/scenario/config/initializers/backtrace_silencers.rb +1 -1
  21. data/spec/scenario/config/initializers/devise.rb +2 -2
  22. data/spec/scenario/config/routes.rb +0 -4
  23. data/spec/scenario/db/migrate/20100401102949_create_tables.rb +3 -3
  24. data/spec/scenario/db/migrate/20111002012903_add_sessions_table.rb +1 -1
  25. data/spec/scenario/db/migrate/20121009092400_add_deactivated_flag_to_users.rb +1 -1
  26. data/spec/spec_helper.rb +38 -8
  27. data/spec/strategy_spec.rb +43 -82
  28. data/spec/support/migrations.rb +1 -1
  29. metadata +21 -126
  30. data/.travis.yml +0 -45
  31. data/Gemfile.devise12 +0 -11
  32. data/Gemfile.devise13 +0 -11
  33. data/Gemfile.devise14 +0 -11
  34. data/Gemfile.devise15 +0 -11
  35. data/Gemfile.devise20 +0 -11
  36. data/Gemfile.devise21 +0 -13
  37. data/Gemfile.devise30 +0 -12
  38. data/Gemfile.devise42 +0 -13
  39. data/lib/devise_cas_authenticatable/exceptions.rb +0 -10
  40. data/lib/devise_cas_authenticatable/memcache_checker.rb +0 -42
  41. data/lib/devise_cas_authenticatable/railtie.rb +0 -14
  42. data/lib/devise_cas_authenticatable/schema.rb +0 -20
  43. data/lib/devise_cas_authenticatable/session_store_identifier.rb +0 -29
  44. data/lib/devise_cas_authenticatable/single_sign_out/rack.rb +0 -39
  45. data/lib/devise_cas_authenticatable/single_sign_out/strategies/base.rb +0 -11
  46. data/lib/devise_cas_authenticatable/single_sign_out/strategies/rails_cache.rb +0 -31
  47. data/lib/devise_cas_authenticatable/single_sign_out/strategies/redis_cache.rb +0 -38
  48. data/lib/devise_cas_authenticatable/single_sign_out/strategies.rb +0 -58
  49. data/lib/devise_cas_authenticatable/single_sign_out/warden_failure_app.rb +0 -46
  50. data/lib/devise_cas_authenticatable/single_sign_out/with_conn.rb +0 -14
  51. data/lib/devise_cas_authenticatable/single_sign_out.rb +0 -69
  52. data/spec/config_spec.rb +0 -27
  53. data/spec/memcache_checker_spec.rb +0 -49
  54. data/spec/scenario/config/castronaut.yml +0 -32
  55. data/spec/scenario/config/initializers/castronaut.rb +0 -1
  56. data/spec/scenario/config/initializers/session_store.rb +0 -8
  57. data/spec/single_sign_out_spec.rb +0 -51
  58. data/spec/support/urls.rb +0 -19
  59. 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