shield 2.1.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gems +2 -1
- data/shield.gemspec +1 -1
- data/test/cuba.rb +5 -5
- data/test/middleware.rb +1 -1
- data/test/nested.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5dcd9f9646d859b99f406c7986321f374e1532f75d022172043a52fa5328b96a
|
4
|
+
data.tar.gz: 0df4d6f48d4ae8d5b08bddfe709e723298dad34c3966efb5c40b928885379611
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86e0e1db849fbdb399f6440d9baacee383c0060a0c8cdbd0d86f8bffa823e51a952e4bb35af1396cdcf18e4324ce4f3c427d5d8fb54fa2dd982a215a59cf363d
|
7
|
+
data.tar.gz: d3161e746e9e4cd0735c4e39d14031590b431b8fec96d140126673fe3aad56c8d9c0603a0beac8d31b08141eabe8778a3e0469a066bc074a2819eb23d4dee9fe
|
data/.gems
CHANGED
data/shield.gemspec
CHANGED
data/test/cuba.rb
CHANGED
@@ -2,7 +2,7 @@ require_relative "helper"
|
|
2
2
|
require_relative "user"
|
3
3
|
require "cuba"
|
4
4
|
|
5
|
-
Cuba.use Rack::Session::Cookie, secret: "
|
5
|
+
Cuba.use Rack::Session::Cookie, secret: "R6zSBQWz0VGVSwvT8THurhJwaVqzpnsH27J5FoI58pxoIciDQYvE4opVvDTLMyfjj7c5inIc6PDNaQWvArMvK3"
|
6
6
|
Cuba.use Shield::Middleware
|
7
7
|
Cuba.plugin Shield::Helpers
|
8
8
|
|
@@ -25,8 +25,8 @@ Cuba.define do
|
|
25
25
|
|
26
26
|
on post, "login", param("login"), param("password") do |u, p|
|
27
27
|
if login(User, u, p)
|
28
|
-
remember if req[
|
29
|
-
res.redirect(req[
|
28
|
+
remember if req.params["remember_me"]
|
29
|
+
res.redirect(req.params["return"] || "/")
|
30
30
|
else
|
31
31
|
res.redirect "/login"
|
32
32
|
end
|
@@ -82,10 +82,10 @@ scope do
|
|
82
82
|
test "remember functionality" do
|
83
83
|
post "/login", :login => "quentin", :password => "password", :remember_me => "1"
|
84
84
|
|
85
|
-
assert_equal session[
|
85
|
+
assert_equal session["remember_for"], 86400 * 14
|
86
86
|
|
87
87
|
get "/logout"
|
88
88
|
|
89
|
-
assert_equal nil, session[
|
89
|
+
assert_equal nil, session["remember_for"]
|
90
90
|
end
|
91
91
|
end
|
data/test/middleware.rb
CHANGED
@@ -2,7 +2,7 @@ require_relative "helper"
|
|
2
2
|
require_relative "user"
|
3
3
|
require "cuba"
|
4
4
|
|
5
|
-
Cuba.use Rack::Session::Cookie, secret: "
|
5
|
+
Cuba.use Rack::Session::Cookie, secret: "R6zSBQWz0VGVSwvT8THurhJwaVqzpnsH27J5FoI58pxoIciDQYvE4opVvDTLMyfjj7c5inIc6PDNaQWvArMvK3"
|
6
6
|
Cuba.use Shield::Middleware
|
7
7
|
|
8
8
|
Cuba.plugin Shield::Helpers
|
data/test/nested.rb
CHANGED
@@ -2,7 +2,7 @@ require_relative "helper"
|
|
2
2
|
require_relative "user"
|
3
3
|
require "cuba"
|
4
4
|
|
5
|
-
Cuba.use Rack::Session::Cookie, secret: "
|
5
|
+
Cuba.use Rack::Session::Cookie, secret: "R6zSBQWz0VGVSwvT8THurhJwaVqzpnsH27J5FoI58pxoIciDQYvE4opVvDTLMyfjj7c5inIc6PDNaQWvArMvK3"
|
6
6
|
Cuba.plugin Shield::Helpers
|
7
7
|
|
8
8
|
class Admin < Cuba
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shield
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michel Martens
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2023-04-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: armor
|
@@ -114,8 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
- !ruby/object:Gem::Version
|
115
115
|
version: '0'
|
116
116
|
requirements: []
|
117
|
-
|
118
|
-
rubygems_version: 2.2.2
|
117
|
+
rubygems_version: 3.3.5
|
119
118
|
signing_key:
|
120
119
|
specification_version: 4
|
121
120
|
summary: Generic authentication protocol for rack applications.
|