bartt-ssl_requirement 1.2.7 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/ssl_requirement.rb +11 -3
- metadata +16 -8
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.3.0
|
data/lib/ssl_requirement.rb
CHANGED
@@ -21,13 +21,17 @@ require "#{File.dirname(__FILE__)}/url_for"
|
|
21
21
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
22
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
23
|
module SslRequirement
|
24
|
-
mattr_writer :ssl_host, :non_ssl_host, :disable_ssl_check
|
24
|
+
mattr_writer :ssl_host, :ssl_port, :non_ssl_host, :disable_ssl_check
|
25
25
|
mattr_accessor :redirect_status
|
26
26
|
|
27
27
|
def self.ssl_host
|
28
28
|
determine_host(@@ssl_host) rescue nil
|
29
29
|
end
|
30
30
|
|
31
|
+
def self.ssl_port
|
32
|
+
@@ssl_port
|
33
|
+
end
|
34
|
+
|
31
35
|
def self.non_ssl_host
|
32
36
|
determine_host(@@non_ssl_host) rescue nil
|
33
37
|
end
|
@@ -37,6 +41,10 @@ module SslRequirement
|
|
37
41
|
SslRequirement.ssl_host
|
38
42
|
end
|
39
43
|
|
44
|
+
def ssl_port
|
45
|
+
SslRequirement.ssl_port
|
46
|
+
end
|
47
|
+
|
40
48
|
def non_ssl_host
|
41
49
|
SslRequirement.non_ssl_host
|
42
50
|
end
|
@@ -119,7 +127,7 @@ module SslRequirement
|
|
119
127
|
request_port = request.port
|
120
128
|
|
121
129
|
if ssl
|
122
|
-
"#{(ssl_host || request_host)}#{determine_port_string(request_port)}"
|
130
|
+
"#{(ssl_host || request_host)}#{ssl_port || determine_port_string(request_port)}"
|
123
131
|
else
|
124
132
|
"#{(non_ssl_host || request_host)}#{determine_port_string(request_port)}"
|
125
133
|
end
|
@@ -144,4 +152,4 @@ module SslRequirement
|
|
144
152
|
def port_normal?(port)
|
145
153
|
NORMAL_PORTS.include?(port)
|
146
154
|
end
|
147
|
-
end
|
155
|
+
end
|
metadata
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bartt-ssl_requirement
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
4
5
|
prerelease:
|
5
|
-
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 1.3.0
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
13
|
- RailsJedi
|
@@ -18,8 +23,7 @@ autorequire:
|
|
18
23
|
bindir: bin
|
19
24
|
cert_chain: []
|
20
25
|
|
21
|
-
date: 2011-
|
22
|
-
default_executable:
|
26
|
+
date: 2011-09-03 00:00:00 Z
|
23
27
|
dependencies: []
|
24
28
|
|
25
29
|
description: SSL requirement adds a declarative way of specifying that certain actions should only be allowed to run under SSL, and if they're accessed without it, they should be redirected.
|
@@ -42,7 +46,6 @@ files:
|
|
42
46
|
- shoulda_macros/ssl_requirement_macros.rb
|
43
47
|
- test/ssl_requirement_test.rb
|
44
48
|
- test/url_for_test.rb
|
45
|
-
has_rdoc: true
|
46
49
|
homepage: http://github.com/bartt/ssl_requirement
|
47
50
|
licenses: []
|
48
51
|
|
@@ -56,20 +59,25 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
56
59
|
requirements:
|
57
60
|
- - ">="
|
58
61
|
- !ruby/object:Gem::Version
|
62
|
+
hash: 3
|
63
|
+
segments:
|
64
|
+
- 0
|
59
65
|
version: "0"
|
60
66
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
67
|
none: false
|
62
68
|
requirements:
|
63
69
|
- - ">="
|
64
70
|
- !ruby/object:Gem::Version
|
71
|
+
hash: 3
|
72
|
+
segments:
|
73
|
+
- 0
|
65
74
|
version: "0"
|
66
75
|
requirements: []
|
67
76
|
|
68
77
|
rubyforge_project:
|
69
|
-
rubygems_version: 1.6
|
78
|
+
rubygems_version: 1.8.6
|
70
79
|
signing_key:
|
71
80
|
specification_version: 3
|
72
81
|
summary: Allow controller actions to force SSL on specific parts of the site.
|
73
|
-
test_files:
|
74
|
-
|
75
|
-
- test/url_for_test.rb
|
82
|
+
test_files: []
|
83
|
+
|