warden 1.2.8 → 1.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98bbb4bde4e4b1168fd883823a9e63f81cb6be40c117d92fd461299f4de0f86a
4
- data.tar.gz: 03ac0df2de9c151a6f5387700141248be127a82177d21da1f1fc2d00db10bc64
3
+ metadata.gz: b7e6c341f27479e6f36339e5d2c211277b4c0e664c960827c2044dd36b5c1c23
4
+ data.tar.gz: 62e22ba4d81a887444d60ff033c7a6b0a0a8e723771d15cee045ee83baece801
5
5
  SHA512:
6
- metadata.gz: 5d8d0d43d9f1a28d12ca7044608e175b08444a46c81c42a6c1ad351d517e45919a653005522c576bd4fe4d8de1d3b2472c52c5b524b32606bb2e69d82a533a33
7
- data.tar.gz: 044152b6566f94d9bcdcd4fda5297decb19ed5146adaaee3bdd07b154d9b1e3b9d840c8da21b110add36f8f856f1879cf2547e12298f710b75c734269c86daff
6
+ metadata.gz: a6b602f560ebc6f04848c0c7e2d9017af8bf55c6cd6e6fec978e28e0463960761eaf488fabdba1b14d78bcf16e352a97d9b95b361142c3a4c14672517ca9e5b5
7
+ data.tar.gz: 9a6397e9d84063c8f7cf221c878b0657151a0cf01a6f98172b2ca0dfd1d5e7eddf7da9ce616f550928f5f14dcb073553379add7a006acc875fb162a7ce2a8210
@@ -0,0 +1,27 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Tests
9
+ on: [push, pull_request]
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ matrix:
16
+ ruby: [ '2.5', '2.6', '2.7' ]
17
+ name: Ruby ${{ matrix.ruby }}
18
+ steps:
19
+ - uses: actions/checkout@v2
20
+ - name: Set up Ruby
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: 2.6
24
+ - name: Install dependencies
25
+ run: bundle install
26
+ - name: Run tests
27
+ run: bundle exec rake
data/.gitignore CHANGED
@@ -3,3 +3,4 @@ pkg
3
3
  .*~
4
4
 
5
5
  *.gem
6
+ Gemfile.lock
@@ -1,86 +1,114 @@
1
- == Version 1.2.8 / 2018-11-15
1
+ # CHANGELOG
2
+
3
+ ## Version 1.2.9 / 2020-08-31
4
+ * Avoid warning on uninitialized instance variable (#188)
5
+ * Bump rack to 2.2.3 (#190)
6
+ * Remove Gemfile.lock
7
+ * Resolve outstanding TODO entries (#179)
8
+ * A bunch of gem structure cleanup (thanks @olleolleolle)
9
+ * Set winning strategy when :warden is thrown (#174)
10
+ * Bump rack dependency to >= 2.0.9 due to CVEs
11
+
12
+ ## Version 1.2.8 / 2018-11-15
13
+
2
14
  * Bugfix: Flips two lines to allow scopes authenticating from another without stepping on each other's toes. (PR #144)
3
15
  * Update `rack` dependency to >= 2.0.6 due to security vulnerability
4
16
  * Internal: Add Rubocop Lint checking
5
17
  * Internal: Update RSpec to use `.rspec` file
6
18
 
7
- == Version 1.2.7 / 2016-10-12
19
+ ## Version 1.2.7 / 2016-10-12
20
+
8
21
  * Added 'frozen_string_literal' comment, bump ruby to 2.3
9
22
 
10
- == Version 1.2.6 / 2016-01-31
23
+ ## Version 1.2.6 / 2016-01-31
24
+
11
25
  * Separate test helpers to encapsulate Warden object mocking inside it's own class
12
26
 
13
- == Version 1.2.5 / 2016-01-28
27
+ ## Version 1.2.5 / 2016-01-28
28
+
14
29
  * Expands on the test helpers available to make it easier for testing gems
15
30
 
16
- == Version 1.2.3 / 2013-07-14
31
+ ## Version 1.2.3 / 2013-07-14
32
+
17
33
  * Fix an issue with lazy loaded sessions
18
34
 
19
- == Version 1.2.2 / 2013-07-12
35
+ ## Version 1.2.2 / 2013-07-12
36
+
20
37
  * Support nil session stores on logout
21
38
  * Fix strategies blowing up with undefined method base
22
39
 
23
- == Version 1.2.1 / 2012-06-16
40
+ ## Version 1.2.1 / 2012-06-16
41
+
24
42
  * Minor caching and speed improvements
25
43
  * Add support to #lock in the proxy
26
44
  * Add support to after_failed_fetch callback
27
45
 
28
- == Version 1.2.0 / 2012-05-08
46
+ ## Version 1.2.0 / 2012-05-08
47
+
29
48
  * Deprecate warden_cookies since it was never functional
30
49
  * Add support to serialize_from_session and serialize_into_session per scope
31
50
 
32
- == Version 1.1.1 / 2012-02-16
51
+ ## Version 1.1.1 / 2012-02-16
52
+
33
53
  * Allow run_callbacks as an option to set_user and user
34
54
 
35
- == Version 1.1.0 / 2011-11-02
55
+ ## Version 1.1.0 / 2011-11-02
56
+
36
57
  * Use the default scopes action when using a bare throw(:warden)
37
58
 
38
- == Version 1.0.6
59
+ ## Version 1.0.6
60
+
39
61
  * Remove gem files from the packaged gem
40
62
 
41
- == Version 1.0.3
63
+ ## Version 1.0.3
64
+
42
65
  * Do not renew session on user fetch
43
66
 
44
- == Version 1.0.2
67
+ ## Version 1.0.2
68
+
45
69
  * Added :intercept_401 to Warden::Config
46
70
 
47
- == Version 1.0.1
71
+ ## Version 1.0.1
72
+
48
73
  * Bug fix on strategies errors handler
49
74
 
50
- == Version 1.0.0
75
+ ## Version 1.0.0
76
+
51
77
  * Bump!
52
78
  * Allow strategies to configure if user should be stored or not
53
79
  * Force session id renewal when user is set
54
80
 
55
- == Version 0.10.7
81
+ ## Version 0.10.7
82
+
56
83
  * Performance boost. config object to use raw accessors
57
84
  * Add per strategy storage option
58
85
 
59
- == Version 0.10.6 / 0.10.7 / 2010-05-22
86
+ ## Version 0.10.6 / 0.10.7 / 2010-05-22
87
+
60
88
  * Bugfix set_user was not respecting logouts in hooks
61
89
 
62
- == Version 0.10.4 / 0.10.5 / 2010-05-20
90
+ ## Version 0.10.4 / 0.10.5 / 2010-05-20
63
91
  * Add action specifying in scope_defaults
64
92
 
65
- == Version 0.10.3 / 2010-03-01
93
+ ## Version 0.10.3 / 2010-03-01
66
94
  * Bugfix prevent halted winning strategy from being skipped in subsequent runs
67
95
 
68
- == Version 0.10.2 / 2010-03-26
96
+ ## Version 0.10.2 / 2010-03-26
69
97
  * Halt on fail!. Add fail to allow cascading
70
98
  * cache the winning strategy
71
99
  * Make the config object Dupable
72
100
 
73
- == Version 0.10.1 / 2010-03-23
101
+ ## Version 0.10.1 / 2010-03-23
74
102
  * Merge previous from master
75
103
  * tag
76
104
 
77
- == Version 0.10.0 / 2010-03-22
105
+ ## Version 0.10.0 / 2010-03-22
78
106
  * Allow default strategies to be set on the proxy
79
107
  * Provide each scope with it's own default strategies
80
108
  * Provide each scope with default set_user opts
81
109
  * depricate the Proxy#default_strategies= method
82
110
 
83
- == Version 0.9.5 / 2010-02-28
111
+ ## Version 0.9.5 / 2010-02-28
84
112
 
85
113
  * Add Warden.test_mode!
86
114
  * Add Warden.on_next_request
@@ -88,42 +116,42 @@
88
116
  ** login_as
89
117
  ** logout
90
118
 
91
- == Version 0.9.4 / 2010-02-23
119
+ ## Version 0.9.4 / 2010-02-23
92
120
 
93
121
  * Fix an issue where winning_strategy was not cleaned, allowing multiple scopes to sign in, even when the second one should not
94
122
 
95
- == Version 0.9.3 / 2010-02-17
123
+ ## Version 0.9.3 / 2010-02-17
96
124
 
97
125
  * Add prepend_ to all hooks (josevalim)
98
126
 
99
- == Version 0.9.2 / 2010-02-10
127
+ ## Version 0.9.2 / 2010-02-10
100
128
 
101
129
  * Ruby 1.9 compatibility changes (grimen)
102
130
 
103
- == Version 0.9.1 / 2010-02-09
131
+ ## Version 0.9.1 / 2010-02-09
104
132
 
105
133
  * Support for passing a custom message with Warden::Strategy::Base#success! as second optional (grimen)
106
134
 
107
- == Version 0.9.0 / 2010-01-21
135
+ ## Version 0.9.0 / 2010-01-21
108
136
 
109
137
  * Remove serializers and make strategies more powerful, including cache behavior (josevalim)
110
138
 
111
- == Version 0.8.1 / 2010-01-06
139
+ ## Version 0.8.1 / 2010-01-06
112
140
 
113
141
  * Fix a bug when silence missing serializers is set (josevalim)
114
142
 
115
- == Version 0.8.0 / 2010-01-06
143
+ ## Version 0.8.0 / 2010-01-06
116
144
 
117
145
  * enhancements
118
146
  * Add conditionals to callbacks (josevalim)
119
147
  * Extract Warden::Config from Warden::Manager (josevalim)
120
148
 
121
- == Version 0.7.0 / 2010-01-04
149
+ ## Version 0.7.0 / 2010-01-04
122
150
 
123
151
  * enhancements
124
152
  * Expose config in warden proxy (hassox)
125
153
 
126
- == Version 0.6.0 / 2009-11-16
154
+ ## Version 0.6.0 / 2009-11-16
127
155
 
128
156
  * enhancements
129
157
  * added serializers, including session serializer (set by default) and a cookie serializer (josevalim)
@@ -131,24 +159,27 @@
131
159
  * deprecation
132
160
  * serializer_into_session and serializer_from_session are deprecated, overwrite serialize and deserializer in Warden::Serializers::Session instead (josevalim)
133
161
 
134
- == Version 0.5.3 / 2009-11-10
162
+ ## Version 0.5.3 / 2009-11-10
163
+
135
164
  * bug fixes
136
165
  * authenticated? and unauthenticated? should return true or false, not the user or false. (hassox)
137
166
 
138
- == Version 0.5.2 / 2009-11-09
167
+ ## Version 0.5.2 / 2009-11-09
168
+
139
169
  * enhancements
140
170
  * authenticated? always try to serialize the user from session (josevalim)
141
171
  * stored_in_session? checks if user information is stored in session, without serializing (josevalim)
142
172
  * 401 behaves exactly like throw :warden (staugaard)
143
173
 
144
- === Version 0.5.1 / 2009-10-25
174
+ ## Version 0.5.1 / 2009-10-25
175
+
145
176
  * enhancements
146
177
  * Adds yielding to authenticated? and unauthenticated? methods (hassox)
147
178
  * Adds an option to silence missing strategies (josevalim)
148
179
  * Add an option to authenticate(!) to prevent storage of a user into the session (hassox)
149
180
  * allow custom :action to be thrown (josevalim)
150
181
 
151
- === Version 0.4.0 / 2009-10-12
182
+ ## Version 0.4.0 / 2009-10-12
152
183
 
153
184
  * enhancements
154
185
  * add Content-Type header to redirects (staugaard)
@@ -157,7 +188,7 @@
157
188
  * bug fixes
158
189
  * Do not consume opts twice, otherwise just the first will parse the scope (josevalim)
159
190
 
160
- === Version 0.3.2 / 2009-09-15
191
+ ## Version 0.3.2 / 2009-09-15
161
192
 
162
193
  * enhancements
163
194
  * add a hook for plugins to specify how they can clear the whole section
data/Gemfile CHANGED
@@ -4,9 +4,9 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  gem 'rake'
7
- gem 'rack', '>= 2.0.6'
7
+ gem 'pry'
8
8
 
9
9
  group :test do
10
- gem 'rspec', '~>3'
10
+ gem 'rspec', '~> 3'
11
11
  gem 'rack-test'
12
12
  end
data/LICENSE CHANGED
@@ -1,4 +1,5 @@
1
1
  Copyright (c) 2009-2017 Daniel Neighman
2
+ Copyright (c) 2017-2020 Justin Smestad
2
3
 
3
4
  Permission is hereby granted, free of charge, to any person obtaining
4
5
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Getting Started
4
4
 
5
- Please see the [Warden Wiki](https://wiki.github.com/hassox/warden) for overview documentation.
5
+ Please see the [Warden Wiki](https://github.com/wardencommunity/warden/wiki) for overview documentation.
6
6
 
7
7
  ## Maintainers
8
8
 
@@ -111,7 +111,7 @@ module Warden
111
111
  user
112
112
  end
113
113
 
114
- # Same API as authenticated, but returns a boolean instead of a user.
114
+ # Same API as authenticate, but returns a boolean instead of a user.
115
115
  # The difference between this method (authenticate?) and authenticated?
116
116
  # is that the former will run strategies if the user has not yet been
117
117
  # authenticated, and the second relies on already performed ones.
@@ -365,9 +365,12 @@ module Warden
365
365
  (strategies || args).each do |name|
366
366
  strategy = _fetch_strategy(name, scope)
367
367
  next unless strategy && !strategy.performed? && strategy.valid?
368
+ catch(:warden) do
369
+ _update_winning_strategy(strategy, scope)
370
+ end
368
371
 
369
372
  strategy._run!
370
- self.winning_strategy = @winning_strategies[scope] = strategy
373
+ _update_winning_strategy(strategy, scope)
371
374
  break if strategy.halted?
372
375
  end
373
376
  end
@@ -382,6 +385,11 @@ module Warden
382
385
  raise "Invalid strategy #{name}"
383
386
  end
384
387
  end
388
+
389
+ # Updates the winning strategy for a given scope
390
+ def _update_winning_strategy(strategy, scope)
391
+ self.winning_strategy = @winning_strategies[scope] = strategy
392
+ end
385
393
  end # Proxy
386
394
 
387
395
  end # Warden
@@ -45,6 +45,7 @@ module Warden
45
45
  @env, @scope = env, scope
46
46
  @status, @headers = nil, {}
47
47
  @halted, @performed = false, false
48
+ @result = nil
48
49
  end
49
50
 
50
51
  # The method that is called from above. This method calls the underlying authenticate! method
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
  module Warden
4
- VERSION = "1.2.8"
4
+ VERSION = "1.2.9"
5
5
  end
@@ -7,7 +7,7 @@ require 'warden/version'
7
7
 
8
8
  Gem::Specification.new do |spec|
9
9
  spec.name = "warden"
10
- spec.version = Warden::VERSION.dup
10
+ spec.version = Warden::VERSION
11
11
  spec.authors = ["Daniel Neighman", "Justin Smestad", "Whitney Smestad", "José Valim"]
12
12
  spec.email = %q{hasox.sox@gmail.com justin.smestad@gmail.com whitcolorado@gmail.com}
13
13
  spec.homepage = "https://github.com/hassox/warden"
@@ -20,8 +20,6 @@ Gem::Specification.new do |spec|
20
20
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
21
21
  f.match(%r{^(test|spec|features)/})
22
22
  end
23
- spec.rdoc_options = ["--charset=UTF-8"]
24
23
  spec.require_paths = ["lib"]
25
- spec.rubyforge_project = %q{warden}
26
- spec.add_dependency "rack", ">= 2.0.6"
24
+ spec.add_dependency "rack", ">= 2.0.9"
27
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warden
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.8
4
+ version: 1.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Neighman
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-11-15 00:00:00.000000000 Z
14
+ date: 2020-08-31 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rack
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 2.0.6
22
+ version: 2.0.9
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 2.0.6
29
+ version: 2.0.9
30
30
  description:
31
31
  email: hasox.sox@gmail.com justin.smestad@gmail.com whitcolorado@gmail.com
32
32
  executables: []
@@ -35,12 +35,11 @@ extra_rdoc_files:
35
35
  - LICENSE
36
36
  - README.md
37
37
  files:
38
+ - ".github/workflows/ruby.yml"
38
39
  - ".gitignore"
39
40
  - ".rspec"
40
- - ".travis.yml"
41
41
  - CHANGELOG.md
42
42
  - Gemfile
43
- - Gemfile.lock
44
43
  - LICENSE
45
44
  - README.md
46
45
  - Rakefile
@@ -64,8 +63,7 @@ licenses:
64
63
  - MIT
65
64
  metadata: {}
66
65
  post_install_message:
67
- rdoc_options:
68
- - "--charset=UTF-8"
66
+ rdoc_options: []
69
67
  require_paths:
70
68
  - lib
71
69
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -79,8 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
77
  - !ruby/object:Gem::Version
80
78
  version: '0'
81
79
  requirements: []
82
- rubyforge_project: warden
83
- rubygems_version: 2.7.6
80
+ rubygems_version: 3.1.2
84
81
  signing_key:
85
82
  specification_version: 4
86
83
  summary: An authentication library compatible with all Rack-based frameworks
@@ -1,7 +0,0 @@
1
- language: ruby
2
- install:
3
- - bundle install
4
- rvm:
5
- - 2.2
6
- - 2.3
7
- - 2.4.2
@@ -1,40 +0,0 @@
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