warden 1.2.7 → 1.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +5 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/{History.rdoc → CHANGELOG.md} +7 -3
- data/Gemfile +1 -1
- data/Gemfile.lock +40 -0
- data/LICENSE +1 -1
- data/README.md +18 -0
- data/Rakefile +3 -8
- data/lib/warden.rb +1 -1
- data/lib/warden/config.rb +1 -1
- data/lib/warden/errors.rb +2 -2
- data/lib/warden/hooks.rb +1 -1
- data/lib/warden/manager.rb +2 -2
- data/lib/warden/mixins/common.rb +1 -1
- data/lib/warden/proxy.rb +15 -4
- data/lib/warden/session_serializer.rb +1 -1
- data/lib/warden/strategies/base.rb +1 -1
- data/lib/warden/test/helpers.rb +2 -2
- data/lib/warden/test/mock.rb +5 -5
- data/lib/warden/test/warden_helpers.rb +1 -1
- data/lib/warden/version.rb +2 -2
- data/warden.gemspec +20 -18
- metadata +18 -33
- data/README.textile +0 -9
- data/spec/helpers/request_helper.rb +0 -52
- data/spec/helpers/strategies/fail_with_user.rb +0 -11
- data/spec/helpers/strategies/failz.rb +0 -9
- data/spec/helpers/strategies/invalid.rb +0 -9
- data/spec/helpers/strategies/pass.rb +0 -9
- data/spec/helpers/strategies/pass_with_message.rb +0 -9
- data/spec/helpers/strategies/password.rb +0 -14
- data/spec/helpers/strategies/single.rb +0 -13
- data/spec/spec_helper.rb +0 -26
- data/spec/warden/authenticated_data_store_spec.rb +0 -115
- data/spec/warden/config_spec.rb +0 -49
- data/spec/warden/errors_spec.rb +0 -48
- data/spec/warden/hooks_spec.rb +0 -374
- data/spec/warden/manager_spec.rb +0 -341
- data/spec/warden/proxy_spec.rb +0 -1051
- data/spec/warden/scoped_session_serializer.rb +0 -124
- data/spec/warden/session_serializer_spec.rb +0 -54
- data/spec/warden/strategies/base_spec.rb +0 -314
- data/spec/warden/strategies_spec.rb +0 -95
- data/spec/warden/test/helpers_spec.rb +0 -94
- data/spec/warden/test/mock_spec.rb +0 -16
- data/spec/warden/test/test_mode_spec.rb +0 -76
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 98bbb4bde4e4b1168fd883823a9e63f81cb6be40c117d92fd461299f4de0f86a
|
4
|
+
data.tar.gz: 03ac0df2de9c151a6f5387700141248be127a82177d21da1f1fc2d00db10bc64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d8d0d43d9f1a28d12ca7044608e175b08444a46c81c42a6c1ad351d517e45919a653005522c576bd4fe4d8de1d3b2472c52c5b524b32606bb2e69d82a533a33
|
7
|
+
data.tar.gz: 044152b6566f94d9bcdcd4fda5297decb19ed5146adaaee3bdd07b154d9b1e3b9d840c8da21b110add36f8f856f1879cf2547e12298f710b75c734269c86daff
|
data/.rspec
ADDED
data/.travis.yml
ADDED
@@ -1,3 +1,9 @@
|
|
1
|
+
== Version 1.2.8 / 2018-11-15
|
2
|
+
* Bugfix: Flips two lines to allow scopes authenticating from another without stepping on each other's toes. (PR #144)
|
3
|
+
* Update `rack` dependency to >= 2.0.6 due to security vulnerability
|
4
|
+
* Internal: Add Rubocop Lint checking
|
5
|
+
* Internal: Update RSpec to use `.rspec` file
|
6
|
+
|
1
7
|
== Version 1.2.7 / 2016-10-12
|
2
8
|
* Added 'frozen_string_literal' comment, bump ruby to 2.3
|
3
9
|
|
@@ -137,7 +143,7 @@
|
|
137
143
|
|
138
144
|
=== Version 0.5.1 / 2009-10-25
|
139
145
|
* enhancements
|
140
|
-
* Adds
|
146
|
+
* Adds yielding to authenticated? and unauthenticated? methods (hassox)
|
141
147
|
* Adds an option to silence missing strategies (josevalim)
|
142
148
|
* Add an option to authenticate(!) to prevent storage of a user into the session (hassox)
|
143
149
|
* allow custom :action to be thrown (josevalim)
|
@@ -155,5 +161,3 @@
|
|
155
161
|
|
156
162
|
* enhancements
|
157
163
|
* add a hook for plugins to specify how they can clear the whole section
|
158
|
-
|
159
|
-
|
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
warden (1.2.8)
|
5
|
+
rack (>= 2.0.6)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
diff-lcs (1.3)
|
11
|
+
rack (2.0.6)
|
12
|
+
rack-test (0.7.0)
|
13
|
+
rack (>= 1.0, < 3)
|
14
|
+
rake (12.1.0)
|
15
|
+
rspec (3.6.0)
|
16
|
+
rspec-core (~> 3.6.0)
|
17
|
+
rspec-expectations (~> 3.6.0)
|
18
|
+
rspec-mocks (~> 3.6.0)
|
19
|
+
rspec-core (3.6.0)
|
20
|
+
rspec-support (~> 3.6.0)
|
21
|
+
rspec-expectations (3.6.0)
|
22
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
23
|
+
rspec-support (~> 3.6.0)
|
24
|
+
rspec-mocks (3.6.0)
|
25
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
26
|
+
rspec-support (~> 3.6.0)
|
27
|
+
rspec-support (3.6.0)
|
28
|
+
|
29
|
+
PLATFORMS
|
30
|
+
ruby
|
31
|
+
|
32
|
+
DEPENDENCIES
|
33
|
+
rack (>= 2.0.6)
|
34
|
+
rack-test
|
35
|
+
rake
|
36
|
+
rspec (~> 3)
|
37
|
+
warden!
|
38
|
+
|
39
|
+
BUNDLED WITH
|
40
|
+
1.17.1
|
data/LICENSE
CHANGED
data/README.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Warden
|
2
|
+
|
3
|
+
## Getting Started
|
4
|
+
|
5
|
+
Please see the [Warden Wiki](https://wiki.github.com/hassox/warden) for overview documentation.
|
6
|
+
|
7
|
+
## Maintainers
|
8
|
+
|
9
|
+
* Daniel Neighman (hassox)
|
10
|
+
* José Valim (josevalim)
|
11
|
+
* Justin Smestad (jsmestad)
|
12
|
+
* Whitney Smestad (whithub)
|
13
|
+
|
14
|
+
[A list of all contributors is available on Github.](https://github.com/hassox/warden/contributors)
|
15
|
+
|
16
|
+
## LICENSE
|
17
|
+
|
18
|
+
See `LICENSE` file.
|
data/Rakefile
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
# frozen_string_literal: true
|
3
|
-
require
|
4
|
-
require
|
5
|
-
$:.unshift File.join(File.dirname(__FILE__), "lib")
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rspec/core/rake_task"
|
6
5
|
|
7
|
-
|
8
|
-
require 'rspec/core/rake_task'
|
6
|
+
RSpec::Core::RakeTask.new(:spec)
|
9
7
|
|
10
8
|
task :default => :spec
|
11
|
-
|
12
|
-
desc "Run all specs in spec directory"
|
13
|
-
RSpec::Core::RakeTask.new(:spec)
|
data/lib/warden.rb
CHANGED
data/lib/warden/config.rb
CHANGED
data/lib/warden/errors.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
1
|
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
3
|
module Warden
|
4
4
|
class Proxy
|
5
5
|
# Lifted from DataMapper's dm-validations plugin :)
|
@@ -39,7 +39,7 @@ module Warden
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def each
|
42
|
-
errors.map.each do |
|
42
|
+
errors.map.each do |_k,v|
|
43
43
|
next if blank?(v)
|
44
44
|
yield(v)
|
45
45
|
end
|
data/lib/warden/hooks.rb
CHANGED
data/lib/warden/manager.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
1
|
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
3
|
require 'warden/hooks'
|
4
4
|
require 'warden/config'
|
5
5
|
|
@@ -22,7 +22,6 @@ module Warden
|
|
22
22
|
@app, @config = app, Warden::Config.new(options)
|
23
23
|
@config.default_strategies(*default_strategies) if default_strategies
|
24
24
|
yield @config if block_given?
|
25
|
-
self
|
26
25
|
end
|
27
26
|
|
28
27
|
# Invoke the application guarding for throw :warden.
|
@@ -33,6 +32,7 @@ module Warden
|
|
33
32
|
|
34
33
|
env['warden'] = Proxy.new(env, self)
|
35
34
|
result = catch(:warden) do
|
35
|
+
env['warden'].on_request
|
36
36
|
@app.call(env)
|
37
37
|
end
|
38
38
|
|
data/lib/warden/mixins/common.rb
CHANGED
data/lib/warden/proxy.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
1
|
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Warden
|
5
5
|
class UserNotSet < RuntimeError; end
|
@@ -29,6 +29,11 @@ module Warden
|
|
29
29
|
@env, @users, @winning_strategies, @locked = env, {}, {}, false
|
30
30
|
@manager, @config = manager, manager.config.dup
|
31
31
|
@strategies = Hash.new { |h,k| h[k] = {} }
|
32
|
+
end
|
33
|
+
|
34
|
+
# Run the on_request callbacks
|
35
|
+
# :api: private
|
36
|
+
def on_request
|
32
37
|
manager._run_callbacks(:on_request, self)
|
33
38
|
end
|
34
39
|
|
@@ -172,7 +177,13 @@ module Warden
|
|
172
177
|
|
173
178
|
if opts[:store] != false && opts[:event] != :fetch
|
174
179
|
options = env[ENV_SESSION_OPTIONS]
|
175
|
-
|
180
|
+
if options
|
181
|
+
if options.frozen?
|
182
|
+
env[ENV_SESSION_OPTIONS] = options.merge(:renew => true).freeze
|
183
|
+
else
|
184
|
+
options[:renew] = true
|
185
|
+
end
|
186
|
+
end
|
176
187
|
session_serializer.store(user, scope)
|
177
188
|
end
|
178
189
|
|
@@ -319,7 +330,7 @@ module Warden
|
|
319
330
|
user = nil
|
320
331
|
|
321
332
|
# Look for an existing user in the session for this scope.
|
322
|
-
# If there was no user in the session
|
333
|
+
# If there was no user in the session, see if we can get one from the request.
|
323
334
|
return user, opts if user = user(opts.merge(:scope => scope))
|
324
335
|
_run_strategies_for(scope, args)
|
325
336
|
|
@@ -355,8 +366,8 @@ module Warden
|
|
355
366
|
strategy = _fetch_strategy(name, scope)
|
356
367
|
next unless strategy && !strategy.performed? && strategy.valid?
|
357
368
|
|
358
|
-
self.winning_strategy = @winning_strategies[scope] = strategy
|
359
369
|
strategy._run!
|
370
|
+
self.winning_strategy = @winning_strategies[scope] = strategy
|
360
371
|
break if strategy.halted?
|
361
372
|
end
|
362
373
|
end
|
data/lib/warden/test/helpers.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
1
|
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Warden
|
5
5
|
module Test
|
@@ -7,7 +7,7 @@ module Warden
|
|
7
7
|
# These provide the ability to login and logout on any given request
|
8
8
|
# Note: During the teardown phase of your specs you should include: Warden.test_reset!
|
9
9
|
module Helpers
|
10
|
-
def self.included(
|
10
|
+
def self.included(_base)
|
11
11
|
::Warden.test_mode!
|
12
12
|
end
|
13
13
|
|
data/lib/warden/test/mock.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
1
|
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require 'rack'
|
5
5
|
|
@@ -8,7 +8,7 @@ module Warden
|
|
8
8
|
# A mock of an application to get a Warden object to test on
|
9
9
|
# Note: During the teardown phase of your specs you should include: Warden.test_reset!
|
10
10
|
module Mock
|
11
|
-
def self.included(
|
11
|
+
def self.included(_base)
|
12
12
|
::Warden.test_mode!
|
13
13
|
end
|
14
14
|
|
@@ -37,7 +37,7 @@ module Warden
|
|
37
37
|
def app
|
38
38
|
@app ||= begin
|
39
39
|
opts = {
|
40
|
-
failure_app: lambda {
|
40
|
+
failure_app: lambda { |_e|
|
41
41
|
[401, { 'Content-Type' => 'text/plain' }, ['You Fail!']]
|
42
42
|
},
|
43
43
|
default_strategies: :password,
|
@@ -46,7 +46,7 @@ module Warden
|
|
46
46
|
Rack::Builder.new do
|
47
47
|
use Warden::Test::Mock::Session
|
48
48
|
use Warden::Manager, opts, &proc {}
|
49
|
-
run lambda { |
|
49
|
+
run lambda { |_e|
|
50
50
|
[200, { 'Content-Type' => 'text/plain' }, ['You Win']]
|
51
51
|
}
|
52
52
|
end
|
@@ -55,7 +55,7 @@ module Warden
|
|
55
55
|
|
56
56
|
class Session
|
57
57
|
attr_accessor :app
|
58
|
-
def initialize(app,
|
58
|
+
def initialize(app, _configs={})
|
59
59
|
@app = app
|
60
60
|
end
|
61
61
|
|
data/lib/warden/version.rb
CHANGED
data/warden.gemspec
CHANGED
@@ -1,25 +1,27 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
4
|
+
lib = File.expand_path("../lib", __FILE__)
|
5
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
6
|
+
require 'warden/version'
|
5
7
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
Gem::Specification.new do |spec|
|
9
|
+
spec.name = "warden"
|
10
|
+
spec.version = Warden::VERSION.dup
|
11
|
+
spec.authors = ["Daniel Neighman", "Justin Smestad", "Whitney Smestad", "José Valim"]
|
12
|
+
spec.email = %q{hasox.sox@gmail.com justin.smestad@gmail.com whitcolorado@gmail.com}
|
13
|
+
spec.homepage = "https://github.com/hassox/warden"
|
14
|
+
spec.summary = "An authentication library compatible with all Rack-based frameworks"
|
15
|
+
spec.license = "MIT"
|
16
|
+
spec.extra_rdoc_files = [
|
13
17
|
"LICENSE",
|
14
|
-
|
18
|
+
"README.md"
|
15
19
|
]
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
s.add_dependency "rack", ">= 1.0"
|
20
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
21
|
+
f.match(%r{^(test|spec|features)/})
|
22
|
+
end
|
23
|
+
spec.rdoc_options = ["--charset=UTF-8"]
|
24
|
+
spec.require_paths = ["lib"]
|
25
|
+
spec.rubyforge_project = %q{warden}
|
26
|
+
spec.add_dependency "rack", ">= 2.0.6"
|
24
27
|
end
|
25
|
-
|
metadata
CHANGED
@@ -1,14 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warden
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Neighman
|
8
|
+
- Justin Smestad
|
9
|
+
- Whitney Smestad
|
10
|
+
- José Valim
|
8
11
|
autorequire:
|
9
12
|
bindir: bin
|
10
13
|
cert_chain: []
|
11
|
-
date:
|
14
|
+
date: 2018-11-15 00:00:00.000000000 Z
|
12
15
|
dependencies:
|
13
16
|
- !ruby/object:Gem::Dependency
|
14
17
|
name: rack
|
@@ -16,26 +19,30 @@ dependencies:
|
|
16
19
|
requirements:
|
17
20
|
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
22
|
+
version: 2.0.6
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
29
|
+
version: 2.0.6
|
27
30
|
description:
|
28
|
-
email:
|
31
|
+
email: hasox.sox@gmail.com justin.smestad@gmail.com whitcolorado@gmail.com
|
29
32
|
executables: []
|
30
33
|
extensions: []
|
31
34
|
extra_rdoc_files:
|
32
35
|
- LICENSE
|
33
|
-
- README.
|
36
|
+
- README.md
|
34
37
|
files:
|
38
|
+
- ".gitignore"
|
39
|
+
- ".rspec"
|
40
|
+
- ".travis.yml"
|
41
|
+
- CHANGELOG.md
|
35
42
|
- Gemfile
|
36
|
-
-
|
43
|
+
- Gemfile.lock
|
37
44
|
- LICENSE
|
38
|
-
- README.
|
45
|
+
- README.md
|
39
46
|
- Rakefile
|
40
47
|
- lib/warden.rb
|
41
48
|
- lib/warden/config.rb
|
@@ -51,30 +58,8 @@ files:
|
|
51
58
|
- lib/warden/test/mock.rb
|
52
59
|
- lib/warden/test/warden_helpers.rb
|
53
60
|
- lib/warden/version.rb
|
54
|
-
- spec/helpers/request_helper.rb
|
55
|
-
- spec/helpers/strategies/fail_with_user.rb
|
56
|
-
- spec/helpers/strategies/failz.rb
|
57
|
-
- spec/helpers/strategies/invalid.rb
|
58
|
-
- spec/helpers/strategies/pass.rb
|
59
|
-
- spec/helpers/strategies/pass_with_message.rb
|
60
|
-
- spec/helpers/strategies/password.rb
|
61
|
-
- spec/helpers/strategies/single.rb
|
62
|
-
- spec/spec_helper.rb
|
63
|
-
- spec/warden/authenticated_data_store_spec.rb
|
64
|
-
- spec/warden/config_spec.rb
|
65
|
-
- spec/warden/errors_spec.rb
|
66
|
-
- spec/warden/hooks_spec.rb
|
67
|
-
- spec/warden/manager_spec.rb
|
68
|
-
- spec/warden/proxy_spec.rb
|
69
|
-
- spec/warden/scoped_session_serializer.rb
|
70
|
-
- spec/warden/session_serializer_spec.rb
|
71
|
-
- spec/warden/strategies/base_spec.rb
|
72
|
-
- spec/warden/strategies_spec.rb
|
73
|
-
- spec/warden/test/helpers_spec.rb
|
74
|
-
- spec/warden/test/mock_spec.rb
|
75
|
-
- spec/warden/test/test_mode_spec.rb
|
76
61
|
- warden.gemspec
|
77
|
-
homepage:
|
62
|
+
homepage: https://github.com/hassox/warden
|
78
63
|
licenses:
|
79
64
|
- MIT
|
80
65
|
metadata: {}
|
@@ -95,8 +80,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
80
|
version: '0'
|
96
81
|
requirements: []
|
97
82
|
rubyforge_project: warden
|
98
|
-
rubygems_version: 2.6
|
83
|
+
rubygems_version: 2.7.6
|
99
84
|
signing_key:
|
100
85
|
specification_version: 4
|
101
|
-
summary:
|
86
|
+
summary: An authentication library compatible with all Rack-based frameworks
|
102
87
|
test_files: []
|