authlogic_cloudfuji 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. data/.gitignore +17 -0
  2. data/.rspec +2 -0
  3. data/Gemfile +4 -0
  4. data/Rakefile +2 -0
  5. data/app/controllers/authlogic/cas/cas_authentication_controller.rb +7 -0
  6. data/app/controllers/authlogic/cas/cas_client_controller.rb +7 -0
  7. data/authlogic_bushido.gemspec +22 -0
  8. data/config/routes.rb +3 -0
  9. data/lib/authlogic_bushido.rb +1 -0
  10. data/lib/authlogic_cas.rb +104 -0
  11. data/lib/authlogic_cas/controller_actions/service.rb +72 -0
  12. data/lib/authlogic_cas/controller_actions/session.rb +32 -0
  13. data/lib/authlogic_cas/engine.rb +6 -0
  14. data/lib/authlogic_cas/rails_routes.rb +16 -0
  15. data/lib/authlogic_cas/single_sign_out/cache.rb +38 -0
  16. data/spec/authlogic_cas_spec.rb +150 -0
  17. data/spec/controllers/service_controller_spec.rb +51 -0
  18. data/spec/controllers/session_controller_spec.rb +31 -0
  19. data/spec/scenario/.gitignore +15 -0
  20. data/spec/scenario/Gemfile +5 -0
  21. data/spec/scenario/Rakefile +7 -0
  22. data/spec/scenario/app/assets/images/rails.png +0 -0
  23. data/spec/scenario/app/assets/javascripts/application.js +9 -0
  24. data/spec/scenario/app/assets/javascripts/main_controller.js.coffee +3 -0
  25. data/spec/scenario/app/assets/javascripts/user_sessions.js.coffee +3 -0
  26. data/spec/scenario/app/assets/javascripts/users.js.coffee +3 -0
  27. data/spec/scenario/app/assets/stylesheets/application.css +7 -0
  28. data/spec/scenario/app/assets/stylesheets/main_controller.css.scss +3 -0
  29. data/spec/scenario/app/assets/stylesheets/scaffolds.css.scss +56 -0
  30. data/spec/scenario/app/assets/stylesheets/user_sessions.css.scss +3 -0
  31. data/spec/scenario/app/assets/stylesheets/users.css.scss +3 -0
  32. data/spec/scenario/app/controllers/application_controller.rb +17 -0
  33. data/spec/scenario/app/controllers/main_controller.rb +8 -0
  34. data/spec/scenario/app/controllers/user_sessions_controller.rb +50 -0
  35. data/spec/scenario/app/controllers/users_controller.rb +86 -0
  36. data/spec/scenario/app/helpers/application_helper.rb +2 -0
  37. data/spec/scenario/app/helpers/main_controller_helper.rb +2 -0
  38. data/spec/scenario/app/helpers/user_sessions_helper.rb +2 -0
  39. data/spec/scenario/app/helpers/users_helper.rb +2 -0
  40. data/spec/scenario/app/mailers/.gitkeep +0 -0
  41. data/spec/scenario/app/models/.gitkeep +0 -0
  42. data/spec/scenario/app/models/user.rb +3 -0
  43. data/spec/scenario/app/models/user_session.rb +2 -0
  44. data/spec/scenario/app/views/layouts/application.html.erb +25 -0
  45. data/spec/scenario/app/views/main/another_cool_page.html.erb +3 -0
  46. data/spec/scenario/app/views/main/index.html.erb +2 -0
  47. data/spec/scenario/app/views/user_sessions/_form.html.erb +25 -0
  48. data/spec/scenario/app/views/user_sessions/edit.html.erb +3 -0
  49. data/spec/scenario/app/views/user_sessions/index.html.erb +25 -0
  50. data/spec/scenario/app/views/user_sessions/new.html.erb +5 -0
  51. data/spec/scenario/app/views/user_sessions/show.html.erb +15 -0
  52. data/spec/scenario/app/views/users/_form.html.erb +34 -0
  53. data/spec/scenario/app/views/users/edit.html.erb +6 -0
  54. data/spec/scenario/app/views/users/index.html.erb +27 -0
  55. data/spec/scenario/app/views/users/new.html.erb +5 -0
  56. data/spec/scenario/app/views/users/show.html.erb +20 -0
  57. data/spec/scenario/config.ru +4 -0
  58. data/spec/scenario/config/application.rb +54 -0
  59. data/spec/scenario/config/boot.rb +6 -0
  60. data/spec/scenario/config/environment.rb +17 -0
  61. data/spec/scenario/config/environments/development.rb +30 -0
  62. data/spec/scenario/config/environments/production.rb +60 -0
  63. data/spec/scenario/config/environments/test.rb +39 -0
  64. data/spec/scenario/config/initializers/authlogic_cas.rb +5 -0
  65. data/spec/scenario/config/initializers/backtrace_silencers.rb +7 -0
  66. data/spec/scenario/config/initializers/inflections.rb +10 -0
  67. data/spec/scenario/config/initializers/mime_types.rb +5 -0
  68. data/spec/scenario/config/initializers/secret_token.rb +7 -0
  69. data/spec/scenario/config/initializers/session_store.rb +8 -0
  70. data/spec/scenario/config/initializers/wrap_parameters.rb +14 -0
  71. data/spec/scenario/config/locales/en.yml +5 -0
  72. data/spec/scenario/config/routes.rb +16 -0
  73. data/spec/scenario/db/migrate/20120223141435_create_users.rb +17 -0
  74. data/spec/scenario/db/migrate/20120226154646_add_sessions_table.rb +16 -0
  75. data/spec/scenario/db/schema.rb +40 -0
  76. data/spec/scenario/db/seeds.rb +7 -0
  77. data/spec/scenario/script/rails +6 -0
  78. data/spec/single_sign_out/cache_spec.rb +47 -0
  79. data/spec/spec_helper.rb +22 -0
  80. metadata +256 -0
@@ -0,0 +1,3 @@
1
+ <h2>
2
+ Hey dude this is another cool page!
3
+ </h2>
@@ -0,0 +1,2 @@
1
+ <h1>MainController#index</h1>
2
+ <p>Find me in app/views/main_controller/index.html.erb</p>
@@ -0,0 +1,25 @@
1
+ <%= form_for(@user_session) do |f| %>
2
+ <% if @user_session.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@user_session.errors.count, "error") %> prohibited this user_session from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @user_session.errors.full_messages.each do |msg| %>
8
+ <li><%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= f.label :username %><br />
16
+ <%= f.text_field :username %>
17
+ </div>
18
+ <div class="field">
19
+ <%= f.label :password %><br />
20
+ <%= f.password_field :password %>
21
+ </div>
22
+ <div class="actions">
23
+ <%= f.submit %>
24
+ </div>
25
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <h1>Editing user_session</h1>
2
+
3
+ <%= render 'form' %>
@@ -0,0 +1,25 @@
1
+ <h1>Listing user_sessions</h1>
2
+
3
+ <table>
4
+ <tr>
5
+ <th>Username</th>
6
+ <th>Password</th>
7
+ <th></th>
8
+ <th></th>
9
+ <th></th>
10
+ </tr>
11
+
12
+ <% @user_sessions.each do |user_session| %>
13
+ <tr>
14
+ <td><%= user_session.username %></td>
15
+ <td><%= user_session.password %></td>
16
+ <td><%= link_to 'Show', user_session %></td>
17
+ <td><%= link_to 'Edit', edit_user_session_path(user_session) %></td>
18
+ <td><%= link_to 'Destroy', user_session, confirm: 'Are you sure?', method: :delete %></td>
19
+ </tr>
20
+ <% end %>
21
+ </table>
22
+
23
+ <br />
24
+
25
+ <%= link_to 'New User session', new_user_session_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New user_session</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', user_sessions_path %>
@@ -0,0 +1,15 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <b>Username:</b>
5
+ <%= @user_session.username %>
6
+ </p>
7
+
8
+ <p>
9
+ <b>Password:</b>
10
+ <%= @user_session.password %>
11
+ </p>
12
+
13
+
14
+ <%= link_to 'Edit', edit_user_session_path(@user_session) %> |
15
+ <%= link_to 'Back', user_sessions_path %>
@@ -0,0 +1,34 @@
1
+ <%= form_for(@user) do |f| %>
2
+ <% if @user.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @user.errors.full_messages.each do |msg| %>
8
+ <li><%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= f.label :email %><br />
16
+ <%= f.text_field :email %>
17
+ </div>
18
+
19
+ <div class="field">
20
+ <%= f.label :username %><br />
21
+ <%= f.text_field :username %>
22
+ </div>
23
+ <div class="field">
24
+ <%= f.label :password %><br />
25
+ <%= f.password_field :password %>
26
+ </div>
27
+ <div class="field">
28
+ <%= f.label :password_confirmation %><br />
29
+ <%= f.password_field :password_confirmation %>
30
+ </div>
31
+ <div class="actions">
32
+ <%= f.submit %>
33
+ </div>
34
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing user</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @user %> |
6
+ <%= link_to 'Back', users_path %>
@@ -0,0 +1,27 @@
1
+ <h1>Listing users</h1>
2
+
3
+ <table>
4
+ <tr>
5
+ <th>Email</th>
6
+ <th>Password</th>
7
+ <th>Username</th>
8
+ <th></th>
9
+ <th></th>
10
+ <th></th>
11
+ </tr>
12
+
13
+ <% @users.each do |user| %>
14
+ <tr>
15
+ <td><%= user.email %></td>
16
+ <td><%= user.password %></td>
17
+ <td><%= user.username %></td>
18
+ <td><%= link_to 'Show', user %></td>
19
+ <td><%= link_to 'Edit', edit_user_path(user) %></td>
20
+ <td><%= link_to 'Destroy', user, confirm: 'Are you sure?', method: :delete %></td>
21
+ </tr>
22
+ <% end %>
23
+ </table>
24
+
25
+ <br />
26
+
27
+ <%= link_to 'New User', new_user_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New user</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', users_path %>
@@ -0,0 +1,20 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <b>Email:</b>
5
+ <%= @user.email %>
6
+ </p>
7
+
8
+ <p>
9
+ <b>Password:</b>
10
+ <%= @user.password %>
11
+ </p>
12
+
13
+ <p>
14
+ <b>Username:</b>
15
+ <%= @user.username %>
16
+ </p>
17
+
18
+
19
+ <%= link_to 'Edit', edit_user_path(@user) %> |
20
+ <%= link_to 'Back', users_path %>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Altry::Application
@@ -0,0 +1,54 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # Pick the frameworks you want:
4
+ require "active_record/railtie"
5
+ require "action_controller/railtie"
6
+ require "action_mailer/railtie"
7
+ require "active_resource/railtie"
8
+ require "sprockets/railtie"
9
+ # require "rails/test_unit/railtie"
10
+
11
+ if defined?(Bundler)
12
+ # If you precompile assets before deploying to production, use this line
13
+ Bundler.require(*Rails.groups(:assets => %w(development test)))
14
+ # If you want your assets lazily compiled in production, use this line
15
+ # Bundler.require(:default, :assets, Rails.env)
16
+ end
17
+
18
+ module Altry
19
+ class Application < Rails::Application
20
+ # Settings in config/environments/* take precedence over those specified here.
21
+ # Application configuration should go into files in config/initializers
22
+ # -- all .rb files in that directory are automatically loaded.
23
+
24
+ # Custom directories with classes and modules you want to be autoloadable.
25
+ # config.autoload_paths += %W(#{config.root}/extras)
26
+
27
+ # Only load the plugins named here, in the order given (default is alphabetical).
28
+ # :all can be used as a placeholder for all plugins not explicitly named.
29
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
30
+
31
+ # Activate observers that should always be running.
32
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
33
+
34
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
35
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
36
+ # config.time_zone = 'Central Time (US & Canada)'
37
+
38
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
39
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
40
+ # config.i18n.default_locale = :de
41
+
42
+ # Configure the default encoding used in templates for Ruby 1.9.
43
+ config.encoding = "utf-8"
44
+
45
+ # Configure sensitive parameters which will be filtered from the log file.
46
+ config.filter_parameters += [:password]
47
+
48
+ # Enable the asset pipeline
49
+ config.assets.enabled = true
50
+
51
+ # Version of your assets, change this if you want to expire all your assets
52
+ config.assets.version = '1.0'
53
+ end
54
+ end
@@ -0,0 +1,6 @@
1
+ require 'rubygems'
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5
+
6
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -0,0 +1,17 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Altry::Application.initialize!
6
+
7
+ def in_memory_database?
8
+ ENV["RAILS_ENV"] == "test" and
9
+ ActiveRecord::Base.connection.class == ActiveRecord::ConnectionAdapters::SQLiteAdapter and
10
+ Rails::Configuration.new.database_configuration['test']['database'] == ':memory:'
11
+ end
12
+
13
+ if in_memory_database?
14
+ puts "creating sqlite in memory database"
15
+ load "#{RAILS_ROOT}/db/schema.rb" # use db agnostic schema by default
16
+ # ActiveRecord::Migrator.up('db/migrate') # use migrations
17
+ end
@@ -0,0 +1,30 @@
1
+ Altry::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Do not compress assets
26
+ config.assets.compress = false
27
+
28
+ # Expands the lines which load the assets
29
+ config.assets.debug = true
30
+ end
@@ -0,0 +1,60 @@
1
+ Altry::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to Rails.root.join("public/assets")
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Use a different logger for distributed setups
37
+ # config.logger = SyslogLogger.new
38
+
39
+ # Use a different cache store in production
40
+ # config.cache_store = :mem_cache_store
41
+
42
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
43
+ # config.action_controller.asset_host = "http://assets.example.com"
44
+
45
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
46
+ # config.assets.precompile += %w( search.js )
47
+
48
+ # Disable delivery errors, bad email addresses will be ignored
49
+ # config.action_mailer.raise_delivery_errors = false
50
+
51
+ # Enable threaded mode
52
+ # config.threadsafe!
53
+
54
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
55
+ # the I18n.default_locale when a translation can not be found)
56
+ config.i18n.fallbacks = true
57
+
58
+ # Send deprecation notices to registered listeners
59
+ config.active_support.deprecation = :notify
60
+ end
@@ -0,0 +1,39 @@
1
+ Altry::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
33
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
34
+ # like if you have constraints or database-specific column types
35
+ # config.active_record.schema_format = :sql
36
+
37
+ # Print deprecation notices to the stderr
38
+ config.active_support.deprecation = :stderr
39
+ end
@@ -0,0 +1,5 @@
1
+ Authlogic::Cas.actor_model = User
2
+ Authlogic::Cas.authentication_model = UserSession
3
+
4
+ Authlogic::Cas.setup_authentication
5
+
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone