saml-kit 1.0.2 → 1.0.3

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: 8a6f4a6a0647cd31ca56459bcc2c1925a1cc4842d86626b44ac72cbe9df0d91d
4
- data.tar.gz: 9b82a518435e992fe4e034eea0da43ffcde66f6e1cad26f3d87d39b0b4d17dac
3
+ metadata.gz: fa485135c5f5f05fd68485afd0c7b7d6632f2614ec563bdc01da7dd4f28f17f9
4
+ data.tar.gz: 25cb0b089d88668ba9164375f0f7b79912cfdd8fea2f62a6ecb0a8c125758fa3
5
5
  SHA512:
6
- metadata.gz: 0d1c8f0652f11111137a40b9a95a7430879fbc19b14993919d7309a4f1c2f50cd2041bf40928e9513b950508c41cc58acd666bcb2be8b2bfc474844e2cb4e5d2
7
- data.tar.gz: ea30a028893904452ef216f56001a9a84681f09a31fa62d324651aa59112f7179974740070d21918f58b764c0709af4943501c9d0e2e1965d3e6e327e03834f3
6
+ metadata.gz: c3cceecfd6d9b921903a6ea7e3a010742fe9d2447aa2ca384d31af280ec372650025272d58f111ff7c0025578540e4af49ac685f0d079cc7d6d37e72093cdc6b
7
+ data.tar.gz: a6a4dfe4d470bd57fd901aaced1a465682bbbb0b53002c21d4d10bac89f6821cc2b31c09abceeaf227b344baff7c33c12bfd4b0d0a75c362919c988fcd1cc94b
@@ -6,10 +6,11 @@ module Saml
6
6
  include XmlTemplatable
7
7
  extend Forwardable
8
8
 
9
- def_delegators :@response_builder, :embed_signature, :request, :issuer, :reference_id, :now, :configuration, :user, :version, :destination
9
+ def_delegators :@response_builder, :request, :issuer, :reference_id, :now, :configuration, :user, :version, :destination
10
10
 
11
- def initialize(response_builder)
11
+ def initialize(response_builder, embed_signature)
12
12
  @response_builder = response_builder
13
+ self.embed_signature = embed_signature
13
14
  end
14
15
 
15
16
  def name_id_format
@@ -35,12 +35,10 @@ module Saml
35
35
  nil
36
36
  end
37
37
 
38
- private
39
-
40
38
  def assertion
41
39
  @assertion ||=
42
40
  begin
43
- assertion = Saml::Kit::Builders::Assertion.new(self)
41
+ assertion = Saml::Kit::Builders::Assertion.new(self, embed_signature)
44
42
  if encrypt
45
43
  Saml::Kit::Builders::EncryptedAssertion.new(self, assertion)
46
44
  else
@@ -49,6 +47,8 @@ module Saml
49
47
  end
50
48
  end
51
49
 
50
+ private
51
+
52
52
  def response_options
53
53
  {
54
54
  ID: id,
@@ -77,7 +77,9 @@ module Saml
77
77
  def certificates
78
78
  @certificates ||= document.find_all("/md:EntityDescriptor/md:#{name}/md:KeyDescriptor").map do |item|
79
79
  cert = item.at_xpath("./ds:KeyInfo/ds:X509Data/ds:X509Certificate", NAMESPACES).text
80
- ::Xml::Kit::Certificate.new(cert, use: item.attribute('use').value.to_sym)
80
+ attribute = item.attribute('use')
81
+ use = attribute.nil? ? nil : item.attribute('use').value
82
+ ::Xml::Kit::Certificate.new(cert, use: use)
81
83
  end
82
84
  end
83
85
 
@@ -26,8 +26,6 @@ module Saml
26
26
  self.errors[attribute] << error
27
27
  end
28
28
  end
29
-
30
- Builder = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Saml::Kit::Response::Builder', 'Saml::Kit::Builders::Response')
31
29
  end
32
30
  end
33
31
  end
@@ -1,5 +1,5 @@
1
1
  module Saml
2
2
  module Kit
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
@@ -12,7 +12,8 @@ module Saml
12
12
  # Returns true if an embedded signature is requested and at least one signing certificate is available via the configuration.
13
13
  def sign?
14
14
  return configuration.sign? if embed_signature.nil?
15
- embed_signature && configuration.sign?
15
+ (embed_signature && configuration.sign?) ||
16
+ (embed_signature && @signing_key_pair.present?)
16
17
  end
17
18
 
18
19
  def digest_method
data/saml-kit.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.require_paths = ["lib"]
25
25
 
26
26
  spec.add_dependency "activemodel", ">= 4.2.0"
27
- spec.add_dependency "xml-kit", "~> 0.1"
27
+ spec.add_dependency "xml-kit", ">= 0.1.5", "<= 1.0.0"
28
28
  spec.add_development_dependency "bundler", "~> 1.15"
29
29
  spec.add_development_dependency "ffaker", "~> 2.7"
30
30
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saml-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mo khan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-03 00:00:00.000000000 Z
11
+ date: 2018-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -28,16 +28,22 @@ dependencies:
28
28
  name: xml-kit
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.1.5
34
+ - - "<="
32
35
  - !ruby/object:Gem::Version
33
- version: '0.1'
36
+ version: 1.0.0
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - "~>"
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 0.1.5
44
+ - - "<="
39
45
  - !ruby/object:Gem::Version
40
- version: '0.1'
46
+ version: 1.0.0
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: bundler
43
49
  requirement: !ruby/object:Gem::Requirement