rack-ssl-rails 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in rack-ssl-rails.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2011 Jesse Storimer
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ Rack::SSL::Rails
2
+ =========
3
+
4
+ A simple interface to Rack::SSL for Rails.
5
+
6
+ See http://github.com/josh/rack-ssl
7
+
8
+ Usage
9
+ -----
10
+
11
+ Simply add `config.force_ssl = true` to your application configuration to enable the Rack::SSL middleware and force all requests over HTTPS.
12
+
13
+ Reason
14
+ ------
15
+
16
+ This is a response to the fact that Rack::SSL (and the above config option) are included in core in Rails 3.1. Using SSL in your app is a good idea and Rails should support best practices. But now that Rails depends on this gem my app will depend on it, and load the code, even if the code goes unused.
17
+
18
+ There are use cases for not using rack-ssl, with an app that began before Rails 3.1 we already have a solution for forcing SSL in certain areas of the codebase. Besides the fact that I need more fine-grained control over this than a global middleware, I see no reason to switch. Any app that lets users use their own domains will also not be able to use this, at least not without some prior thought.
19
+
20
+ **IMO this is what the Railties API is for. 'Have it your way'. The Railties API can provide the exact same interface and ease of use, but outside of core rails. This gem could be added to the default Gemfile going forward. That way Rails continues to support best practices without increasing my app's deps unnecessarily.**
21
+
22
+ https://github.com/rails/rails/commit/2c0c4d754e34b13379dfc53121a970c25fab5dae#commitcomment-383401
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
data/TODO ADDED
@@ -0,0 +1,4 @@
1
+ - Support the HTTP and HTTPS in parallel using method described http://www.simonecarletti.com/blog/2011/05/configuring-rails-3-https-ssl/
2
+ Overload the config.force_ssl option with symbols
3
+ config.force_ssl = true
4
+ config.force_ssl = :https_only
@@ -0,0 +1 @@
1
+ require 'rack/ssl/rails'
@@ -0,0 +1,2 @@
1
+ require 'rack/ssl'
2
+ require 'rack/ssl/rails/railtie'
@@ -0,0 +1,7 @@
1
+ class Rack::SSL::Railtie < ::Rails::Railtie
2
+ initializer "middleware" do
3
+ if config.respond_to?(:force_ssl) && config.force_ssl
4
+ Rails.application.config.middleware.insert_before ActionDispatch::Static, Rack::SSL
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "rack-ssl-rails"
3
+ s.version = '0.0.2'
4
+ s.platform = Gem::Platform::RUBY
5
+ s.authors = ["Jesse Storimer"]
6
+ s.email = ["jstorimer@gmail.com"]
7
+ s.homepage = ""
8
+ s.summary = %q{Provides a railtie for use with rack-ssl.}
9
+ s.description = %q{Provides a railtie for use with rack-ssl. Includes a handy configuration option that will set up the middleware for you.}
10
+
11
+ s.files = `git ls-files`.split("\n")
12
+ s.require_paths = ["lib"]
13
+
14
+ s.add_runtime_dependency 'rack-ssl'
15
+ end
metadata ADDED
@@ -0,0 +1,90 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rack-ssl-rails
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 2
10
+ version: 0.0.2
11
+ platform: ruby
12
+ authors:
13
+ - Jesse Storimer
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-05-17 00:00:00 -04:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: rack-ssl
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ description: Provides a railtie for use with rack-ssl. Includes a handy configuration option that will set up the middleware for you.
36
+ email:
37
+ - jstorimer@gmail.com
38
+ executables: []
39
+
40
+ extensions: []
41
+
42
+ extra_rdoc_files: []
43
+
44
+ files:
45
+ - .gitignore
46
+ - Gemfile
47
+ - LICENSE
48
+ - README.md
49
+ - Rakefile
50
+ - TODO
51
+ - lib/rack-ssl-rails.rb
52
+ - lib/rack/ssl/rails.rb
53
+ - lib/rack/ssl/rails/railtie.rb
54
+ - rack-ssl-rails.gemspec
55
+ has_rdoc: true
56
+ homepage: ""
57
+ licenses: []
58
+
59
+ post_install_message:
60
+ rdoc_options: []
61
+
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ hash: 3
70
+ segments:
71
+ - 0
72
+ version: "0"
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ hash: 3
79
+ segments:
80
+ - 0
81
+ version: "0"
82
+ requirements: []
83
+
84
+ rubyforge_project:
85
+ rubygems_version: 1.6.0
86
+ signing_key:
87
+ specification_version: 3
88
+ summary: Provides a railtie for use with rack-ssl.
89
+ test_files: []
90
+