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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ebafb5a38e98da6ac77fe1aef9f75fe152260465
4
- data.tar.gz: 4b5f0a93da346dcab298769f5d58e9b3b3672cc8
3
+ metadata.gz: f6094cc422e3c1b4b142851b36834b9730951800
4
+ data.tar.gz: 00b21f42fa02b1f0b99f0c7683c023a6afa450f4
5
5
  SHA512:
6
- metadata.gz: ea4b4676ccd2a16afc7b4748ecdd9a4ce0cc7f09ca7d452221256ad4f00d3eae39751c57c48e225f8a219c0ee7b390a1cc7a278c049df24a5f0eaf78622ffd86
7
- data.tar.gz: f6f9f274dd8cef36ab5b7058dfe0f60eaa0a3453397f03ed5392002b13e789e759a60bdb2cf9489c5d37b3832f5ae65e6b9188ad551615ef4ca955364a83d569
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 2013 Zendesk
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
@@ -35,7 +35,7 @@ module Samlr
35
35
 
36
36
  def audience_satisfied?
37
37
  audience.nil? || options[:audience].nil? ||
38
- audience == options[:audience]
38
+ options[:audience] === audience
39
39
  end
40
40
 
41
41
  private
@@ -1,4 +1,4 @@
1
- Gem::Specification.new "samlr", "2.0.1" do |s|
1
+ Gem::Specification.new "samlr", "2.0.2" do |s|
2
2
  s.summary = "Ruby tools for SAML"
3
3
  s.description = "Helps you implement a SAML SP"
4
4
  s.authors = ["Morten Primdahl"]
@@ -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
- Time.stub(:now, Time.at(1344379365)) do
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
- begin
34
- subject.verify!
35
- flunk "Expected exception"
36
- rescue Samlr::ConditionsError => e
37
- assert_match /Audience/, e.message
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
- Time.stub(:now, Time.at(1344379365)) do
50
- assert subject.verify!
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.1
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-05-28 00:00:00.000000000 Z
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: