contour 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,11 @@
1
+ == 0.5.1
2
+
3
+ * Refactoring
4
+ * Removed debug output
5
+
6
+ * Documentation
7
+ * Contour Walkthrough from an empty Rails 3.1 application now works correctly (# Devise.config.sign_out_via = :delete)
8
+
1
9
  == 0.5.0
2
10
 
3
11
  * Enhancements
@@ -132,12 +132,29 @@ Add the following to your app/models/user.rb
132
132
  (authentications.empty? || !password.blank?) && super
133
133
  end
134
134
 
135
+ Add the following to your app/models/authentication.rb
136
+
137
+ belongs_to :user
138
+
139
+ def provider_name
140
+ if provider == 'open_id'
141
+ "OpenID"
142
+ else
143
+ provider.titleize
144
+ end
145
+ end
146
+
135
147
  Make sure the devise line in config/routes.rb looks as follows
136
148
 
137
149
  devise_for :users, :controllers => {:registrations => 'contour/registrations', :sessions => 'contour/sessions', :passwords => 'contour/passwords'}, :path_names => { :sign_up => 'register', :sign_in => 'login' }
138
150
 
139
151
  If there is a line that just says 'devise_for :users' or a duplicate, remove it
140
152
 
153
+ Edit config/initializers/devise.rb and comment out the sign_out_via delete line
154
+
155
+ # The default HTTP method used to sign out a resource. Default is :delete.
156
+ # config.sign_out_via = :delete
157
+
141
158
  Start your server and navigate to localhost:3000/users/login
142
159
 
143
160
  rails s
@@ -7,7 +7,7 @@ module OmniAuth
7
7
  # include OmniAuth::Strategy
8
8
 
9
9
  def initialize(app, options = {}, &block)
10
- Rails.logger.debug "Contour::Fixes => Omniauth::Strategies::LDAP::initialize"
10
+ # Rails.logger.debug "Contour::Fixes => Omniauth::Strategies::LDAP::initialize"
11
11
  super(app, options[:name] || :ldap, options.dup, &block)
12
12
  @name_proc = (@options.delete(:name_proc) || Proc.new {|name| name})
13
13
  @adaptor = OmniAuth::Strategies::LDAP::Adaptor.new(options)
@@ -19,13 +19,13 @@ module OmniAuth
19
19
  # Reroutes directly to callback_phase instead of redirecting to callback_path
20
20
  # TODO: Possibility that this could be removed in the future.
21
21
  def request_phase
22
- Rails.logger.info "Request Phase Hook"
22
+ # Rails.logger.info "Contour::Fixes => Omniauth::Strategies::LDAP::request_phase Request Phase Hook"
23
23
  if env['REQUEST_METHOD'] == 'GET'
24
24
  get_credentials
25
25
  else
26
26
  session['omniauth.ldap'] = {'username' => request['username'], 'password' => request['password']}
27
27
  if true
28
- Rails.logger.info "Skipping Redirect"
28
+ # Rails.logger.info "Contour::Fixes => Omniauth::Strategies::LDAP::request_phase Skipping Redirect"
29
29
  callback_phase # Added
30
30
  else
31
31
  redirect callback_path
@@ -2,7 +2,7 @@
2
2
  module Rack
3
3
  class Request
4
4
  def scheme
5
- Rails.logger.debug "Contour::Fixes => Rack::Request::scheme"
5
+ # Rails.logger.debug "Contour::Fixes => Rack::Request::scheme"
6
6
  if @env['HTTPS'] == 'on'
7
7
  'https'
8
8
  elsif @env['HTTP_X_FORWARDED_SSL'] == 'on'
@@ -20,7 +20,8 @@ module Rack
20
20
 
21
21
  def host_with_port
22
22
  if forwarded = @env["HTTP_X_FORWARDED_HOST"]
23
- Rails.logger.debug "@env[HTTP_X_FORWARDED_HOST]: #{@env["HTTP_X_FORWARDED_HOST"]} USING => #{forwarded.split(/,\s?/).first}"
23
+ Rails.logger.info "\n\nContour::Fixes => Rack::Request::host_with_port"
24
+ Rails.logger.info "@env[HTTP_X_FORWARDED_HOST]: #{@env["HTTP_X_FORWARDED_HOST"]} USING => #{forwarded.split(/,\s?/).first}\n\n"
24
25
  # forwarded.split(/,\s?/).last
25
26
  # changed forwarded to first since we don't want the internal IP.
26
27
  forwarded.split(/,\s?/).first
@@ -1,3 +1,3 @@
1
1
  module Contour
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contour
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-08 00:00:00.000000000Z
12
+ date: 2011-09-12 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: devise
16
- requirement: &70117242428300 !ruby/object:Gem::Requirement
16
+ requirement: &70170518340580 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.4.4
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70117242428300
24
+ version_requirements: *70170518340580
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: omniauth
27
- requirement: &70117242427760 !ruby/object:Gem::Requirement
27
+ requirement: &70170518339820 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 0.2.6
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70117242427760
35
+ version_requirements: *70170518339820
36
36
  description: Basic Rails Framework files and assets for layout and authentication
37
37
  email: remosm@gmail.com
38
38
  executables: []