contour 0.5.0 → 0.5.1
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.
- data/CHANGELOG.rdoc +8 -0
- data/README.rdoc +17 -0
- data/lib/contour/fixes/omniauth.rb +3 -3
- data/lib/contour/fixes/rack.rb +3 -2
- data/lib/contour/version.rb +1 -1
- metadata +6 -6
data/CHANGELOG.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -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
|
data/lib/contour/fixes/rack.rb
CHANGED
@@ -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.
|
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
|
data/lib/contour/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2011-09-12 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: devise
|
16
|
-
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: *
|
24
|
+
version_requirements: *70170518340580
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: omniauth
|
27
|
-
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: *
|
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: []
|