secured 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/secured.rb +21 -0
  3. metadata +58 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2c5bc466110444a458ec92091976c3786de46ac0
4
+ data.tar.gz: f09ae6e904348185a8e2e58c99971d346a79c27d
5
+ SHA512:
6
+ metadata.gz: d45e9665dd9ca9e369463fd564755e1bfd14b881781b06476d0a5caf049cc6601c45da5d9c9ce281dc523006f2dbb39386f343da5598bf4e0b1cf5db797bf5c0
7
+ data.tar.gz: fac1083881ac7f08dfde735499dc0cc2e36d98abe62fa688380f7b1a186b7da4e4ecb339171a54edbff0a95d3f50827366a5ca03583092e071527556f17501ef
@@ -0,0 +1,21 @@
1
+ # This is in a pull request to the full devise gem,
2
+ # we may be able to remove it in the future
3
+ #
4
+ # https://github.com/plataformatec/devise/pull/2192
5
+ module ActionDispatch::Routing
6
+ class SslConstraint
7
+ def self.matches?(request)
8
+ request.ssl?
9
+ end
10
+ end
11
+
12
+ class Mapper
13
+ def secured &block
14
+ if Rails.env.development?
15
+ yield
16
+ else
17
+ constraints SslConstraint, &block
18
+ end
19
+ end
20
+ end
21
+ end
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: secured
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Nathaniel Jones
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-07-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '3'
27
+ description: Wrap routes in a 'secured' block to only appear when on an SSL connection
28
+ email: nj@thirdprestige.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - lib/secured.rb
34
+ homepage: https://rubygems.org/gems/secured
35
+ licenses:
36
+ - MIT
37
+ metadata: {}
38
+ post_install_message:
39
+ rdoc_options: []
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubyforge_project:
54
+ rubygems_version: 2.0.0
55
+ signing_key:
56
+ specification_version: 4
57
+ summary: Add secured block routing
58
+ test_files: []