saml2 3.0.1 → 3.0.2

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
  SHA256:
3
- metadata.gz: 8f19cbd0c6dfd04619a0124fd9416a285914bfbfcf4108551dc50c38a885fc9e
4
- data.tar.gz: d48b64ee7a14d2ac6d581045acc1c18ed93205d8ea6f28db72deb84509036254
3
+ metadata.gz: 11ee4a47ccd8dbe5b2b78e2442b1d42af58a147913ab005d7ba242ce618bb416
4
+ data.tar.gz: 3a0ae077af118a78c88a8f677767e1e459ade7102e4e7d16f90362050ab389b9
5
5
  SHA512:
6
- metadata.gz: 0ae9e53321ea87e73f2d640fdce663c24a5a0fdb9995c42a702b96af409fe2f318cb62f152f6585a298d8bb985254e49a076744e22daaa6f1b6ec5d68589e8a8
7
- data.tar.gz: 9cc452f3831f1f1cb37f3b467e6d980ba2e683c11356c653706094f4b28e7fe65b613115c6c4dc32b42c67e513e09d45272b976b268b6bcb13280f18e47e9005
6
+ metadata.gz: f98a1dc63f85c94325872d317ed633922f602e5f3ffed0716d46d84a1bbdf362b0700ac3db5139256ef7c405fc08ebfe2685f00152ade52a5a00a1823c68512b
7
+ data.tar.gz: e428c3aa1d3c43a0815c31eca74f354dfc72d27236e6a89dba1ce22cba5f2401a51b038c18bf05af48d029f616151921e969866fef71011d59baca7dfe489455
@@ -7,8 +7,12 @@ require 'saml2/sso'
7
7
 
8
8
  module SAML2
9
9
  class ServiceProvider < SSO
10
+ attr_writer :authn_requests_signed, :want_assertions_signed
11
+
10
12
  def initialize
11
13
  super
14
+ @authn_requests_signed = nil
15
+ @want_assertions_signed = nil
12
16
  @assertion_consumer_services = Endpoint::Indexed::Array.new
13
17
  @attribute_consuming_services = AttributeConsumingService::Array.new
14
18
  end
@@ -20,6 +24,22 @@ module SAML2
20
24
  @attribute_consuming_services = nil
21
25
  end
22
26
 
27
+ # @return [Boolean, nil]
28
+ def authn_requests_signed?
29
+ unless instance_variable_defined?(:@authn_requests_signed)
30
+ @authn_requests_signed = xml['AuthnRequestsSigned'] && xml['AuthnRequestsSigned'] == 'true'
31
+ end
32
+ @authn_requests_signed
33
+ end
34
+
35
+ # @return [Boolean, nil]
36
+ def want_assertions_signed?
37
+ unless instance_variable_defined?(:@want_assertions_signed)
38
+ @want_assertions_signed = xml['WantAssertionsSigned'] && xml['WantAssertionsSigned'] == 'true'
39
+ end
40
+ @want_assertions_signed
41
+ end
42
+
23
43
  # @return [Endpoint::Indexed::Array]
24
44
  def assertion_consumer_services
25
45
  @assertion_consumer_services ||= begin
@@ -41,6 +61,9 @@ module SAML2
41
61
  builder['md'].SPSSODescriptor do |sp_sso_descriptor|
42
62
  super(sp_sso_descriptor)
43
63
 
64
+ sp_sso_descriptor['AuthnRequestsSigned'] = authn_requests_signed? unless authn_requests_signed?.nil?
65
+ sp_sso_descriptor['WantAssertionsSigned'] = want_assertions_signed? unless authn_requests_signed?.nil?
66
+
44
67
  assertion_consumer_services.each do |acs|
45
68
  acs.build(sp_sso_descriptor, 'AssertionConsumerService')
46
69
  end
@@ -52,3 +75,4 @@ module SAML2
52
75
  end
53
76
  end
54
77
  end
78
+
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SAML2
4
- VERSION = '3.0.1'
4
+ VERSION = '3.0.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saml2
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-07 00:00:00.000000000 Z
11
+ date: 2018-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri