ruby-saml 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ruby-saml might be problematic. Click here for more details.

@@ -75,6 +75,14 @@ What's left at this point, is to wrap it all up in a controller and point the in
75
75
  end
76
76
  end
77
77
 
78
+ If are using saml:AttributeStatement to transfare metadata, like the user name, you can access all the attributes through response.attributes. It
79
+ contains all the saml:AttributeStatement with its 'Name' as a indifferent key and the one saml:AttributeValue as value.
80
+
81
+ response = Onelogin::Saml::Response.new(params[:SAMLResponse])
82
+ response.settings = saml_settings
83
+
84
+ response.attributes[:username]
85
+
78
86
 
79
87
  = Full Example
80
88
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.3.0
@@ -24,9 +24,33 @@ module Onelogin::Saml
24
24
  @name_id ||= document.elements["/samlp:Response/saml:Assertion/saml:Subject/saml:NameID"].text
25
25
  end
26
26
 
27
+ # A hash of alle the attributes with the response. Assuming there is onlye one value for each key
28
+ def attributes
29
+ saml_attribute_statements = document.elements["/samlp:Response/saml:Assertion/saml:AttributeStatement"].elements
30
+ statements = saml_attribute_statements.map do |child|
31
+ child.attributes.map do |key, attribute|
32
+ [attribute, child.elements.first.text]
33
+ end
34
+ end
35
+
36
+ hash = Hash[statements.flatten(1)]
37
+ @attributes ||= make_hash_access_indiferent(hash)
38
+ end
39
+
27
40
  # When this user session should expire at latest
28
41
  def session_expires_at
29
42
  @expires_at ||= Time.parse(document.elements["/samlp:Response/saml:Assertion/saml:AuthnStatement"].attributes["SessionNotOnOrAfter"])
30
43
  end
44
+
45
+ private
46
+
47
+ def make_hash_access_indiferent(hash)
48
+ sym_hash = {}
49
+ hash.each do |key, value|
50
+ sym_hash[key.intern] = value
51
+ end
52
+
53
+ sym_hash.merge(hash)
54
+ end
31
55
  end
32
56
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruby-saml}
8
- s.version = "0.2.3"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["OneLogin LLC"]
12
- s.date = %q{2011-02-21}
12
+ s.date = %q{2011-03-03}
13
13
  s.description = %q{SAML toolkit for Ruby on Rails}
14
14
  s.email = %q{support@onelogin.com}
15
15
  s.extra_rdoc_files = [
@@ -1,68 +1 @@
1
- PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0
2
- YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6
3
- bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIElEPSJHT1NBTUxSMTI5MDEx
4
- NzQ1NzE3OTQiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDEwLTEx
5
- LTE4VDIxOjU3OjM3WiIgRGVzdGluYXRpb249IntyZWNpcGllbnR9Ij48c2Ft
6
- bHA6U3RhdHVzPjxzYW1scDpTdGF0dXNDb2RlIFZhbHVlPSJ1cm46b2FzaXM6
7
- bmFtZXM6dGM6U0FNTDoyLjA6c3RhdHVzOlN1Y2Nlc3MiLz48L3NhbWxwOlN0
8
- YXR1cz48c2FtbDpBc3NlcnRpb24geG1sbnM6eHM9Imh0dHA6Ly93d3cudzMu
9
- b3JnLzIwMDEvWE1MU2NoZW1hIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMu
10
- b3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiBWZXJzaW9uPSIyLjAiIElE
11
- PSJwZnhhNDY1NzRkZi1iM2IwLWEwNmEtMjNjOC02MzY0MTMxOTg3NzIiIElz
12
- c3VlSW5zdGFudD0iMjAxMC0xMS0xOFQyMTo1NzozN1oiPjxzYW1sOklzc3Vl
13
- cj5odHRwczovL2FwcC5vbmVsb2dpbi5jb20vc2FtbC9tZXRhZGF0YS8xMzU5
14
- MDwvc2FtbDpJc3N1Z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VWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgPC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgPC9zYW1sOkFzc2VydGlvbj4NCjwvc2FtbHA6UmVzcG9uc2U+DQo=
@@ -61,6 +61,24 @@ class RubySamlTest < Test::Unit::TestCase
61
61
  end
62
62
  end
63
63
 
64
+ context "#attributes" do
65
+ should "extract the first attribute in a hash accessed via its symbol" do
66
+ response = Onelogin::Saml::Response.new(response_document)
67
+ assert_equal "demo", response.attributes[:uid]
68
+ end
69
+
70
+ should "extract the first attribute in a hash accessed via its name" do
71
+ response = Onelogin::Saml::Response.new(response_document)
72
+ assert_equal "demo", response.attributes["uid"]
73
+ end
74
+
75
+ should "extract all attributes" do
76
+ response = Onelogin::Saml::Response.new(response_document)
77
+ assert_equal "demo", response.attributes[:uid]
78
+ assert_equal "value", response.attributes[:another_value]
79
+ end
80
+ end
81
+
64
82
  context "#session_expires_at" do
65
83
  should "extract the value of the SessionNotOnOrAfter attribute" do
66
84
  response = Onelogin::Saml::Response.new(response_document)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-saml
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 2
9
8
  - 3
10
- version: 0.2.3
9
+ - 0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - OneLogin LLC
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-21 00:00:00 +01:00
18
+ date: 2011-03-03 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency