samlr 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of samlr might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/samlr/condition.rb +1 -1
- data/samlr.gemspec +1 -1
- data/test/unit/test_condition.rb +41 -12
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6094cc422e3c1b4b142851b36834b9730951800
|
4
|
+
data.tar.gz: 00b21f42fa02b1f0b99f0c7683c023a6afa450f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25091398892548578f7eaf39cb8541c48c1de673e703c5433713872f7c69301bb29206dc8fa7254178fc5ca1f9bb705531c03ff4345d7da067dc4489baf57fbc
|
7
|
+
data.tar.gz: 08cdd18525af9b2b938635ce658b2f1ff828e65d349948f239f6dd8ce49022e0dcaf665bcd0cdb646d88f889dd3b906872074561983a47570e8ab2dfb07ab43c
|
data/README.md
CHANGED
@@ -172,7 +172,7 @@ Pull requests with a failing test case much preferred.
|
|
172
172
|
|
173
173
|
### License
|
174
174
|
|
175
|
-
Copyright
|
175
|
+
Copyright 2014 Zendesk
|
176
176
|
|
177
177
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
178
178
|
You may obtain a copy of the License at
|
data/lib/samlr/condition.rb
CHANGED
data/samlr.gemspec
CHANGED
data/test/unit/test_condition.rb
CHANGED
@@ -8,6 +8,12 @@ def condition(before, after)
|
|
8
8
|
Samlr::Condition.new(element, {})
|
9
9
|
end
|
10
10
|
|
11
|
+
def verify!
|
12
|
+
Time.stub(:now, Time.at(1344379365)) do
|
13
|
+
subject.verify!
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
11
17
|
describe Samlr::Condition do
|
12
18
|
before do
|
13
19
|
@not_before = (Time.now - 10*60)
|
@@ -25,17 +31,13 @@ describe Samlr::Condition do
|
|
25
31
|
end
|
26
32
|
|
27
33
|
it "raises an exception" do
|
28
|
-
|
29
|
-
assert subject.not_on_or_after_satisfied?
|
30
|
-
assert subject.not_before_satisfied?
|
31
|
-
refute subject.audience_satisfied?
|
34
|
+
refute subject.audience_satisfied?
|
32
35
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
end
|
36
|
+
begin
|
37
|
+
verify!
|
38
|
+
flunk "Expected exception"
|
39
|
+
rescue Samlr::ConditionsError => e
|
40
|
+
assert_match /Audience/, e.message
|
39
41
|
end
|
40
42
|
end
|
41
43
|
end
|
@@ -46,8 +48,35 @@ describe Samlr::Condition do
|
|
46
48
|
end
|
47
49
|
|
48
50
|
it "does not raise an exception" do
|
49
|
-
|
50
|
-
|
51
|
+
assert verify!
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe "using a regex" do
|
56
|
+
describe "valid regex" do
|
57
|
+
before do
|
58
|
+
response.options[:audience] = /example\.(org|com)/
|
59
|
+
end
|
60
|
+
|
61
|
+
it "does not raise an exception" do
|
62
|
+
assert verify!
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
describe "invalid regex" do
|
67
|
+
before do
|
68
|
+
response.options[:audience] = /\A[a-z]\z/
|
69
|
+
end
|
70
|
+
|
71
|
+
it "raises an exception" do
|
72
|
+
refute subject.audience_satisfied?
|
73
|
+
|
74
|
+
begin
|
75
|
+
verify!
|
76
|
+
flunk "Expected exception"
|
77
|
+
rescue Samlr::ConditionsError => e
|
78
|
+
assert_match /Audience/, e.message
|
79
|
+
end
|
51
80
|
end
|
52
81
|
end
|
53
82
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: samlr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Morten Primdahl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -182,3 +182,4 @@ signing_key:
|
|
182
182
|
specification_version: 4
|
183
183
|
summary: Ruby tools for SAML
|
184
184
|
test_files: []
|
185
|
+
has_rdoc:
|