rails_warden 0.5.8 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (7) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE +2 -2
  3. data/README.md +41 -0
  4. data/lib/rails_warden.rb +21 -6
  5. metadata +18 -17
  6. data/README.textile +0 -42
  7. data/TODO +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: a7727506f01c1addc52ebd0a485dca159d0967a6
4
- data.tar.gz: e857c3e217778e0dd441a577591c3f7db466a82f
2
+ SHA256:
3
+ metadata.gz: 350d12501ae6763cb927d33aeeb522ec31275b3c10c23e591aa0517964ec72c2
4
+ data.tar.gz: fb0aaf21f734dfb8b0d877df045004e5e797588a001c59d396ea9ff6c51dc60c
5
5
  SHA512:
6
- metadata.gz: 82279c073deb6a51b74b4a9e8bdff7d4a2e95c50186ac046e187df1e05284e5f0d68f3ee515a71d23b34e6fc01a6137ea66a8ecf3632614a111830f9795aad66
7
- data.tar.gz: 946abce52c2e07140547a781fc5360adc3ec11d067e686cea508fc74b1a7cbb6c66f1225e5f05e0566e7b6461ea9ad5cb873cc47b415ac8ae3ea5c30df9e0273
6
+ metadata.gz: 1bdb6ea4cebb61007118596441c47c918fd51ea85838fa89a5fed50b2799b38bb9f91f08a1eb51e8fffdaf80725880114029700b6d6690734c5909228f64577f
7
+ data.tar.gz: 61898c226690c8b24f09325e0727717bc3142a503efb3133ee35e8938fec0b2c502658d2d92bdfe1e61b0996066f5f3d2bf4d20f9334a72d135bb874d9e7b620
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Daniel Neighman
1
+ Copyright (c) 2009-2017 Daniel Neighman
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
17
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
18
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
19
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,41 @@
1
+ # Rails Warden
2
+
3
+
4
+ This application adds some nice helpers on-top of the base [Warden](https://github.com/hassox/warden) Rack layer. It aims to make Warden easier to use in Rails-based environments without something as heavy-weight as devise.
5
+
6
+ Require the gem:
7
+
8
+ ```ruby
9
+ gem 'rails_warden'
10
+ ```
11
+
12
+ Setup an initializer:
13
+
14
+ ```ruby
15
+ # config/initializers/warden.rb
16
+
17
+ Rails.configuration.middleware.use RailsWarden::Manager do |manager|
18
+ manager.default_strategies :my_strategy
19
+ manager.failure_app = LoginController
20
+ end
21
+
22
+ # Setup Session Serialization
23
+ class Warden::SessionSerializer
24
+ def serialize(record)
25
+ [record.class.name, record.id]
26
+ end
27
+
28
+ def deserialize(keys)
29
+ klass, id = keys
30
+ klass.find(:first, :conditions => { :id => id })
31
+ end
32
+ end
33
+
34
+ # Declare your strategies here, or require a file that defines one.
35
+ #Warden::Strategies.add(:my_strategy) do
36
+ # def authenticate!
37
+ # # do stuff
38
+ # end
39
+ #end
40
+
41
+ ```
@@ -2,7 +2,6 @@
2
2
  require 'warden'
3
3
  require 'active_support'
4
4
 
5
-
6
5
  $:.unshift File.expand_path(File.dirname(__FILE__))
7
6
  require "rails_warden/manager"
8
7
  require "rails_warden/rails_settings"
@@ -89,13 +88,29 @@ if !defined?(Rails::Railtie)
89
88
  else
90
89
  class RailsWarden::Railtie < Rails::Railtie
91
90
  include_block = Proc.new {
92
- ::ActionController::Base.class_eval do
93
- include RailsWarden::Mixins::HelperMethods
94
- include RailsWarden::Mixins::ControllerOnlyMethods
91
+
92
+ ActiveSupport.on_load(:action_controller) do
93
+ ::ActionController::Base.class_eval do
94
+ include RailsWarden::Mixins::HelperMethods
95
+ include RailsWarden::Mixins::ControllerOnlyMethods
96
+ end
97
+ if defined? ::ActionController::API
98
+ ::ActionController::API.class_eval do
99
+ include RailsWarden::Mixins::HelperMethods
100
+
101
+ if defined? helper
102
+ helper RailsWarden::Mixins::ControllerOnlyMethods
103
+ else
104
+ include RailsWarden::Mixins::ControllerOnlyMethods
105
+ end
106
+ end
107
+ end
95
108
  end
96
109
 
97
- ::ActionView::Base.class_eval do
98
- include RailsWarden::Mixins::HelperMethods
110
+ ActiveSupport.on_load(:action_view) do
111
+ ::ActionView::Base.class_eval do
112
+ include RailsWarden::Mixins::HelperMethods
113
+ end
99
114
  end
100
115
  }
101
116
 
metadata CHANGED
@@ -1,45 +1,46 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_warden
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.8
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Neighman
8
+ - Justin Smestad
9
+ - Whitney Smestad
8
10
  autorequire:
9
11
  bindir: bin
10
12
  cert_chain: []
11
- date: 2014-02-25 00:00:00.000000000 Z
13
+ date: 2018-02-27 00:00:00.000000000 Z
12
14
  dependencies:
13
15
  - !ruby/object:Gem::Dependency
14
16
  name: warden
15
17
  requirement: !ruby/object:Gem::Requirement
16
18
  requirements:
17
- - - '>='
19
+ - - ">="
18
20
  - !ruby/object:Gem::Version
19
- version: 1.0.0
21
+ version: 1.2.0
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
23
25
  requirements:
24
- - - '>='
26
+ - - ">="
25
27
  - !ruby/object:Gem::Version
26
- version: 1.0.0
27
- description: A gem that provides authenitcation via the Warden framework
28
+ version: 1.2.0
29
+ description: A gem that provides authentication Rails helpers when using Warden for
30
+ authentication
28
31
  email: has.sox@gmail.com
29
32
  executables: []
30
33
  extensions: []
31
34
  extra_rdoc_files:
32
35
  - LICENSE
33
- - README.textile
34
- - TODO
36
+ - README.md
35
37
  files:
38
+ - LICENSE
39
+ - README.md
40
+ - lib/rails_warden.rb
36
41
  - lib/rails_warden/controller_mixin.rb
37
42
  - lib/rails_warden/manager.rb
38
43
  - lib/rails_warden/rails_settings.rb
39
- - lib/rails_warden.rb
40
- - LICENSE
41
- - README.textile
42
- - TODO
43
44
  homepage: https://github.com/hassox/rails_warden
44
45
  licenses: []
45
46
  metadata: {}
@@ -49,18 +50,18 @@ require_paths:
49
50
  - lib
50
51
  required_ruby_version: !ruby/object:Gem::Requirement
51
52
  requirements:
52
- - - '>='
53
+ - - ">="
53
54
  - !ruby/object:Gem::Version
54
55
  version: '0'
55
56
  required_rubygems_version: !ruby/object:Gem::Requirement
56
57
  requirements:
57
- - - '>='
58
+ - - ">="
58
59
  - !ruby/object:Gem::Version
59
60
  version: '0'
60
61
  requirements: []
61
62
  rubyforge_project:
62
- rubygems_version: 2.0.14
63
+ rubygems_version: 2.7.6
63
64
  signing_key:
64
65
  specification_version: 4
65
- summary: A gem that provides authenitcation via the Warden framework
66
+ summary: A gem that provides authentication Rails helpers when using Warden for authentication
66
67
  test_files: []
@@ -1,42 +0,0 @@
1
- h1. Rails Warden
2
-
3
- Provides authentication for Rails applications via the "Warden":http://github.com/hassox/warden Rack authentication framework.
4
-
5
- Require the gem:
6
-
7
- config/environment.rb
8
-
9
- <pre><code>
10
- config.gem "rails_warden"
11
- </code></pre>
12
-
13
- Setup an initializer:
14
-
15
- config/initializers/warden.rb
16
-
17
- <pre><code>
18
- Rails.configuration.middleware.use RailsWarden::Manager do |manager|
19
- manager.default_strategies :my_strategy
20
- manager.failure_app = LoginController
21
- end
22
-
23
- # Setup Session Serialization
24
- class Warden::SessionSerializer
25
- def serialize(record)
26
- [record.class.name, record.id]
27
- end
28
-
29
- def deserialize(keys)
30
- klass, id = keys
31
- klass.find(:first, :conditions => { :id => id })
32
- end
33
- end
34
-
35
- # Declare your strategies here
36
- #Warden::Strategies.add(:my_strategy) do
37
- # def authenticate!
38
- # # do stuff
39
- # end
40
- #end
41
-
42
- </code></pre>
data/TODO DELETED
@@ -1 +0,0 @@
1
- TODO: