strelka 0.9.1 → 0.10.0
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 +4 -4
- checksums.yaml.gz.sig +5 -1
- data.tar.gz.sig +0 -0
- data/ChangeLog +75 -23
- data/History.rdoc +5 -0
- data/lib/strelka.rb +2 -2
- data/lib/strelka/app/auth.rb +19 -0
- data/spec/strelka/app/auth_spec.rb +15 -0
- metadata +24 -24
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b80a99f214a313af79edba1b5f7805e9c0608bb
|
4
|
+
data.tar.gz: 29357b83d58fea5ed8643ae8cd3beebbb2f4a0fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18eeb9cecb966a98ef3b17d6bd42c9205a7fabb6c874d5e0680d96710898e20a87b265da19b03bb1d1d3e16431d992765a459cf7423a65b17c17cf8b176bb013
|
7
|
+
data.tar.gz: 5dd20c7375c9450fc84b96ec5a3167b8468620f4d1fd107b6b91df724950de16c70b42752b1cd66def6ba41f2ddb7e0d1c0687a677da402d0122ccbd6b2c6c3d
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1,5 @@
|
|
1
|
-
|
1
|
+
2y��0'&�m:9r��)���%�
|
2
|
+
'H�
|
3
|
+
�f��'7�q�����J�(�o+�Vcr�'��F�^N�z���M4�X����T�����}��5�*�m��(�@���oL
|
4
|
+
�����&$���%QxY<�,[Jඃ���T�G��[?ځ7�x^=�r�6�ly<�3�K"���hC�>����ec�1O�R��X�Ru2�!��Y;
|
5
|
+
%�`1��.�ݣ��B֞�$��ˍ����@�o
|
data.tar.gz.sig
CHANGED
Binary file
|
data/ChangeLog
CHANGED
@@ -1,8 +1,61 @@
|
|
1
|
+
2015-10-01 Mahlon E. Smith <mahlon@laika.com>
|
2
|
+
|
3
|
+
* .hgsigs:
|
4
|
+
Added signature for changeset 2e4e4c78a588
|
5
|
+
[50bc1d12bad4] [tip]
|
6
|
+
|
7
|
+
* .hgtags:
|
8
|
+
Added tag v0.10.0 for changeset 2aae0e98c859
|
9
|
+
[2e4e4c78a588]
|
10
|
+
|
11
|
+
2015-10-01 Mahlon E. Smith <mahlon@martini.nu>
|
12
|
+
|
13
|
+
* History.rdoc, lib/strelka.rb:
|
14
|
+
Bump version.
|
15
|
+
[2aae0e98c859] [v0.10.0]
|
16
|
+
|
17
|
+
* lib/strelka/app/auth.rb, spec/strelka/app/auth_spec.rb:
|
18
|
+
Provide a built-in method for optional route auth to the
|
19
|
+
authentication plugin.
|
20
|
+
[283577340c31]
|
21
|
+
|
22
|
+
2015-09-20 Michael Granger <ged@FaerieMUD.org>
|
23
|
+
|
24
|
+
* cert/mahlon.pem:
|
25
|
+
Merge with 093cea5ea618
|
26
|
+
[55d4b5210da6]
|
27
|
+
|
28
|
+
2015-04-01 Mahlon E. Smith <mahlon@martini.nu>
|
29
|
+
|
30
|
+
* cert/mahlon.pem:
|
31
|
+
Revert my key to a non-signed, the gem signing stuff is a mess.
|
32
|
+
[093cea5ea618]
|
33
|
+
|
34
|
+
2015-04-01 Michael Granger <ged@FaerieMUD.org>
|
35
|
+
|
36
|
+
* cert/ged.pem:
|
37
|
+
Revert my cert, `gem cert -s` isn't working as advertised.
|
38
|
+
[e29596606445]
|
39
|
+
|
40
|
+
2015-04-01 Mahlon E. Smith <mahlon@martini.nu>
|
41
|
+
|
42
|
+
* .hgtags:
|
43
|
+
Added tag v0.9.1 for changeset d86d6579a43e
|
44
|
+
[cc451faffccf]
|
45
|
+
|
46
|
+
* .hgsigs:
|
47
|
+
Added signature for changeset d8332e8ea7f7
|
48
|
+
[d86d6579a43e] [v0.9.1]
|
49
|
+
|
50
|
+
* History.rdoc, lib/strelka.rb:
|
51
|
+
Version bump to v0.9.1
|
52
|
+
[d8332e8ea7f7]
|
53
|
+
|
1
54
|
2015-04-01 Michael Granger <ged@FaerieMUD.org>
|
2
55
|
|
3
56
|
* cert/mahlon.pem:
|
4
57
|
Sign mahlon's cert
|
5
|
-
[db92e594bfc2]
|
58
|
+
[db92e594bfc2]
|
6
59
|
|
7
60
|
2015-04-01 Mahlon E. Smith <mahlon@martini.nu>
|
8
61
|
|
@@ -82,7 +135,7 @@
|
|
82
135
|
|
83
136
|
* strelka.gemspec:
|
84
137
|
Update the gemspec
|
85
|
-
[92c894486289]
|
138
|
+
[92c894486289] [github/master]
|
86
139
|
|
87
140
|
* Rakefile:
|
88
141
|
Fix the fivefish version
|
@@ -155,6 +208,13 @@
|
|
155
208
|
Update dependencies.
|
156
209
|
[4ddae11c28b8]
|
157
210
|
|
211
|
+
2014-01-22 Mahlon E. Smith <mahlon@laika.com>
|
212
|
+
|
213
|
+
* lib/strelka/httprequest.rb:
|
214
|
+
Don't modify the original request URI object when calling
|
215
|
+
HttpRequest#base_uri.
|
216
|
+
[6e2d1e0e89d1]
|
217
|
+
|
158
218
|
2014-01-29 Michael Granger <ged@FaerieMUD.org>
|
159
219
|
|
160
220
|
* lib/strelka/app.rb:
|
@@ -192,19 +252,19 @@
|
|
192
252
|
Merge improvements to the AbstractClass mixin from elsewhere.
|
193
253
|
[96725c68d4ae]
|
194
254
|
|
195
|
-
2014-01-22 Mahlon E. Smith <mahlon@laika.com>
|
196
|
-
|
197
|
-
* lib/strelka/httprequest.rb:
|
198
|
-
Don't modify the original request URI object when calling
|
199
|
-
HttpRequest#base_uri.
|
200
|
-
[6e2d1e0e89d1]
|
201
|
-
|
202
255
|
2014-01-02 Michael Granger <ged@FaerieMUD.org>
|
203
256
|
|
204
257
|
* lib/strelka.rb:
|
205
258
|
Merged with bdb098771858
|
206
259
|
[140055f6ee81]
|
207
260
|
|
261
|
+
2013-12-02 Mahlon E. Smith <mahlon@martini.nu>
|
262
|
+
|
263
|
+
* .rvm.gems, lib/strelka.rb, lib/strelka/app/auth.rb,
|
264
|
+
spec/strelka/session/default_spec.rb:
|
265
|
+
Restore access to request parameters from the authentication plugin.
|
266
|
+
[bdb098771858]
|
267
|
+
|
208
268
|
2014-01-01 Michael Granger <ged@FaerieMUD.org>
|
209
269
|
|
210
270
|
* History.rdoc, lib/strelka.rb:
|
@@ -246,13 +306,6 @@
|
|
246
306
|
Remove config keys that moved to Discovery
|
247
307
|
[c4b52cde2f47]
|
248
308
|
|
249
|
-
2013-12-02 Mahlon E. Smith <mahlon@martini.nu>
|
250
|
-
|
251
|
-
* .rvm.gems, lib/strelka.rb, lib/strelka/app/auth.rb,
|
252
|
-
spec/strelka/session/default_spec.rb:
|
253
|
-
Restore access to request parameters from the authentication plugin.
|
254
|
-
[bdb098771858]
|
255
|
-
|
256
309
|
2013-11-08 Michael Granger <ged@FaerieMUD.org>
|
257
310
|
|
258
311
|
* .hgtags:
|
@@ -2558,8 +2611,8 @@
|
|
2558
2611
|
- Require Ruby-Mongrel 0.12+
|
2559
2612
|
- This is just the initial implementation. Yet to be added:
|
2560
2613
|
configuration options for enabling/disabling stuff, automatic
|
2561
|
-
composite services mapped from association reflections, mass-
|
2562
|
-
|
2614
|
+
composite services mapped from association reflections, mass- create
|
2615
|
+
option, and lots more I'm forgetting.
|
2563
2616
|
[23acdb6e9afc]
|
2564
2617
|
|
2565
2618
|
* data/strelka/bootstrap-config.rb:
|
@@ -2877,12 +2930,11 @@
|
|
2877
2930
|
spec/strelka/httpresponse/negotiation_spec.rb:
|
2878
2931
|
Alterations to the plugin system to reflect dogfood discoveries.
|
2879
2932
|
- Rearranged the lifecycle of the request to all happen inside the
|
2880
|
-
try/catch to allow fixup hooks to finish with an error status,
|
2881
|
-
too.
|
2933
|
+
try/catch to allow fixup hooks to finish with an error status, too.
|
2882
2934
|
- Moved the negotiation plugin closer to the router so negotation
|
2883
|
-
callbacks can return responses that will be further altered by
|
2884
|
-
|
2885
|
-
|
2935
|
+
callbacks can return responses that will be further altered by later
|
2936
|
+
plugins. Moved the acceptable check into the response fixup hook to
|
2937
|
+
accomplish this.
|
2886
2938
|
- Made the response fixup hook only take a response object since
|
2887
2939
|
responses can now know what their request is.
|
2888
2940
|
- Made language-negotiation short-circuit whenever there aren't any
|
data/History.rdoc
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
== v0.10.0 [2015-10-01] Mahlon E. Smith <mahlon@martini.nu>
|
2
|
+
|
3
|
+
- Allow authentication to be optional for a route.
|
4
|
+
|
5
|
+
|
1
6
|
== v0.9.1 [2015-04-01] Mahlon E. Smith <mahlon@martini.nu>
|
2
7
|
|
3
8
|
- Ensure required permissions for the auth plugin are unmodified between requests.
|
data/lib/strelka.rb
CHANGED
@@ -24,10 +24,10 @@ module Strelka
|
|
24
24
|
log_as :strelka
|
25
25
|
|
26
26
|
# Library version constant
|
27
|
-
VERSION = '0.
|
27
|
+
VERSION = '0.10.0'
|
28
28
|
|
29
29
|
# Version-control revision constant
|
30
|
-
REVISION = %q$Revision:
|
30
|
+
REVISION = %q$Revision: 2aae0e98c859 $
|
31
31
|
|
32
32
|
require 'strelka/mixins'
|
33
33
|
require 'strelka/constants'
|
data/lib/strelka/app/auth.rb
CHANGED
@@ -570,6 +570,25 @@ module Strelka::App::Auth
|
|
570
570
|
alias_method :required_perms_for, :perms_required_for
|
571
571
|
|
572
572
|
|
573
|
+
### Normally, the authentication plugin manages authing a user
|
574
|
+
### automatically. There are cases where we want to perform this
|
575
|
+
### manually, such as a route that provides alternate data for an
|
576
|
+
### authenticated user, but still allows non-authed access.
|
577
|
+
###
|
578
|
+
### Returns the authenticated user object, or nil if unsuccessful.
|
579
|
+
###
|
580
|
+
### This essentially makes authentication optional for a route, instead
|
581
|
+
### of simply "on" or "off".
|
582
|
+
def authenticate( request )
|
583
|
+
acct = nil
|
584
|
+
catch( :finish ) do
|
585
|
+
acct = self.auth_provider.authenticate( request )
|
586
|
+
request.authenticated_user = acct
|
587
|
+
end
|
588
|
+
return acct
|
589
|
+
end
|
590
|
+
|
591
|
+
|
573
592
|
#########
|
574
593
|
protected
|
575
594
|
#########
|
@@ -62,6 +62,7 @@ describe Strelka::App::Auth do
|
|
62
62
|
def handle_request( req )
|
63
63
|
super do
|
64
64
|
res = req.response
|
65
|
+
self.authenticate( req ) if req.uri.to_s =~ /\/optional$/
|
65
66
|
res.status = HTTP::OK
|
66
67
|
res.content_type = 'text/plain'
|
67
68
|
res.puts "Ran successfully."
|
@@ -658,6 +659,20 @@ describe Strelka::App::Auth do
|
|
658
659
|
before( :each ) do
|
659
660
|
@app.no_auth_for( '/onlyauth' )
|
660
661
|
@app.no_auth_for( '/both' )
|
662
|
+
@app.no_auth_for( '/optional' )
|
663
|
+
end
|
664
|
+
|
665
|
+
context "and optional auth for a route" do
|
666
|
+
|
667
|
+
it "checks auth without throwing HTTP::AUTH_REQUIRED" do
|
668
|
+
req = @request_factory.get( '/api/v1/optional' )
|
669
|
+
|
670
|
+
app = @app.new
|
671
|
+
expect( app.auth_provider ).to receive( :authenticate )
|
672
|
+
expect( app.auth_provider ).to receive( :authorize )
|
673
|
+
|
674
|
+
app.handle( req )
|
675
|
+
end
|
661
676
|
end
|
662
677
|
|
663
678
|
context "and positive perms criteria" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strelka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mahlon E. Smith
|
@@ -11,27 +11,27 @@ bindir: bin
|
|
11
11
|
cert_chain:
|
12
12
|
- |
|
13
13
|
-----BEGIN CERTIFICATE-----
|
14
|
-
MIIDbDCCAlSgAwIBAgIBATANBgkqhkiG9w0BAQUFADA+
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|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9
|
28
|
+
Zac8TkKc9bCSR0snakp+cCPplVvZF0/gMzkSTUJkDBHlNV16z73CyWpbQQa+iLJ4
|
29
|
+
uisI6gF2ZXK919MYLn2bFJfb7OsCvVfyTPqq8afPY+rq9vlf9ZPwU49AlD8bPRic
|
30
|
+
0LX0gO5ykvETIOv+WgGcqp96ceNi9XVuJMh20uWuw6pmv/Ub2RqAf82jQSbpz09G
|
31
|
+
G8LHR7EjtPPmqCCunfyecJ6MmCNaiJCBxq2NYzyNmluPyHT8+0fuB5kccUVZm6CD
|
32
|
+
xn3DzOkDE6NYbk8gC9rTsA==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-
|
34
|
+
date: 2015-10-01 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: configurability
|
@@ -213,14 +213,14 @@ dependencies:
|
|
213
213
|
requirements:
|
214
214
|
- - "~>"
|
215
215
|
- !ruby/object:Gem::Version
|
216
|
-
version: '0.
|
216
|
+
version: '0.7'
|
217
217
|
type: :development
|
218
218
|
prerelease: false
|
219
219
|
version_requirements: !ruby/object:Gem::Requirement
|
220
220
|
requirements:
|
221
221
|
- - "~>"
|
222
222
|
- !ruby/object:Gem::Version
|
223
|
-
version: '0.
|
223
|
+
version: '0.7'
|
224
224
|
- !ruby/object:Gem::Dependency
|
225
225
|
name: hoe-highline
|
226
226
|
requirement: !ruby/object:Gem::Requirement
|
@@ -485,7 +485,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
485
485
|
version: '0'
|
486
486
|
requirements: []
|
487
487
|
rubyforge_project:
|
488
|
-
rubygems_version: 2.4.
|
488
|
+
rubygems_version: 2.4.7
|
489
489
|
signing_key:
|
490
490
|
specification_version: 4
|
491
491
|
summary: Strelka is a framework for creating and deploying Mongrel2[http://mongrel2.org/]
|
metadata.gz.sig
CHANGED
Binary file
|