libsaml 2.21.3 → 2.22.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53f2e428424ecfb0c817ae13e9a2bc3855440c4a
4
- data.tar.gz: 161e05eef6f5bb82aaca7f799dcdf046f021a8a5
3
+ metadata.gz: 10eebd806d0ef296de80f6c85761a72997c9968b
4
+ data.tar.gz: d8c01889808b0ea5a780aa2a744883917ccfc448
5
5
  SHA512:
6
- metadata.gz: 0c37e2ca231d09cfa57d2d5dd422e468ba3e5fae3b1441ba459dc6189533c3f9ae5fe3ab2bbcb2d8290741e9cd2b0dc4646fcadae28d6e99143d19c78c7e5fd9
7
- data.tar.gz: c8c61a87e01a8c196e3c6b10f9f4cd5e13e662e570ed6f1221515e4623dea46de4b5e3ee656e90695ffee5ef211b3702839f356c159fd10c94d550d05ee3f50a
6
+ metadata.gz: 66421bf62af62c9c2cf09e5a3c1fb31ae5067251af44dfa9dbc0cd07cdd4ff4d83f1de61e1f6015c33ee846c31f30b8ebd966f2546bde02e03f492ec17e8fe26
7
+ data.tar.gz: a54e585a408e5bf1032db290882c3a5ee96eb1ada9a0c97241b6eaaa73b90c20d5467fa3109daf98507140e886cca6e9d8ccd0ca476e5854cbcecaca8fcbb6b4
data/README.md CHANGED
@@ -98,11 +98,11 @@ class SamlController < ApplicationController
98
98
 
99
99
  def request_authentication
100
100
  provider = Saml.provider("my:very:original:entityid")
101
- destination = provider.single_sign_on_service_url(Saml::ProtocolBindings::HTTP_POST)
101
+ destination = provider.single_sign_on_service_url(Saml::ProtocolBinding::HTTP_POST)
102
102
 
103
103
  authn_request = Saml::AuthnRequest.new(:destination => destination)
104
104
 
105
- session[:authn_request_id] = auth_request._id
105
+ session[:authn_request_id] = authn_request._id
106
106
 
107
107
  @saml_attributes = Saml::Bindings::HTTPPost.create_form_attributes(authn_request)
108
108
 
@@ -195,7 +195,7 @@ class SamlController < ActionController::Base
195
195
  # render an auto submit form with hidden fields set in the attributes hash
196
196
  @attribute = Saml::Bindings::HTTPPost.create_form_attributes(response, relay_state: session[:saml_request][:relay_state])
197
197
  else
198
- # handle unsported binding
198
+ # handle unsupported binding
199
199
  end
200
200
  end
201
201
 
data/lib/saml/util.rb CHANGED
@@ -32,10 +32,25 @@ module Saml
32
32
  http.request(request)
33
33
  end
34
34
 
35
- def sign_xml(message, format = :xml, &block)
35
+ def sign_xml(message, format = :xml, include_nested_prefixlist = false, &block)
36
36
  message.add_signature
37
37
 
38
38
  document = Xmldsig::SignedDocument.new(message.send("to_#{format}"))
39
+
40
+ if include_nested_prefixlist
41
+ document.signatures.reverse.each_with_object([]) do |signature, nested_prefixlist|
42
+ inclusive_namespaces = signature.signature.at_xpath('descendant::ec:InclusiveNamespaces', Xmldsig::NAMESPACES)
43
+
44
+ if inclusive_namespaces
45
+ nested_prefixlist.concat(inclusive_namespaces.get_attribute('PrefixList').to_s.split(' '))
46
+
47
+ if signature.unsigned?
48
+ inclusive_namespaces.set_attribute('PrefixList', nested_prefixlist.uniq.join(' '))
49
+ end
50
+ end
51
+ end
52
+ end
53
+
39
54
  if block_given?
40
55
  document.sign(&block)
41
56
  else
data/lib/saml/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Saml
2
- VERSION = '2.21.3'
2
+ VERSION = '2.22.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libsaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.21.3
4
+ version: 2.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoist Claassen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-27 00:00:00.000000000 Z
11
+ date: 2016-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport