saml-kit 1.0.26 → 1.0.27

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: f191bd5ef640639650f065bc0713c37c0c6e63456b08366298f12ff0d926883f
4
- data.tar.gz: 8c3b7481e313d363368d7e6a7cd4206eef83147bd95e79cba705ce022571f28f
3
+ metadata.gz: 28c26014b0ce54fbd8aeb84d2dd6ee4b3d1355459278fc57afc1a3d98b4bffb0
4
+ data.tar.gz: d84ea523535edd6d033eecbbe4e7b865d7d3d69b7080c400b3aba6c913800c93
5
5
  SHA512:
6
- metadata.gz: '09259f8f8570848eea183736047bb586404583c2af62d2544ad90b0cce4a2c0867dbf2194d081e4e546e50ef0f5ecf97bcd08b16e3e50f4ac512857326da9e66'
7
- data.tar.gz: 548180ab295a60916ec0a5dd2ee2d47cfe9cc92b3639b885b1014076d4279b962ba79847a96007b296ffdc5f63cea2470348518fcf2759c3ccaab2de52174c7c
6
+ metadata.gz: 0f2510eab2be6b8e4e16dd6fc3adeed53094a88b6f6cfa992780138fc7e53e25f10cb5872702da0a93f6dc5fb3b0b0b998198b9dafc399055d794d15b98e2fc9
7
+ data.tar.gz: 1a520702f958b5ba2af029bad9b49d4766acdef5291093c81083e028999db2d0897c14832016ecff51c00cd3a25df5f5e012184e01b2bf9b3e88472dfdddc68f
@@ -90,7 +90,7 @@ module Saml
90
90
  # @param use [Symbol] the type of key pair to return
91
91
  # `nil`, `:signing` or `:encryption`
92
92
  def key_pairs(use: nil)
93
- use.present? ? @key_pairs.find_all { |xxx| xxx.for?(use) } : @key_pairs
93
+ use.present? ? active_key_pairs.find_all { |xxx| xxx.for?(use) } : active_key_pairs
94
94
  end
95
95
 
96
96
  # Return each certificate for a specific use.
@@ -122,6 +122,17 @@ module Saml
122
122
  error_message = 'Use must be either :signing or :encryption'
123
123
  raise ArgumentError, error_message
124
124
  end
125
+
126
+ def active_key_pairs
127
+ @key_pairs.find_all { |x| active?(x) }.sort_by { |x| x.certificate.not_after }.reverse
128
+ end
129
+
130
+ def active?(key_pair)
131
+ key_pair.certificate.active?
132
+ rescue OpenSSL::X509::CertificateError => error
133
+ Saml::Kit.logger.error(error)
134
+ false
135
+ end
125
136
  end
126
137
  end
127
138
  end
@@ -25,11 +25,11 @@ module Saml
25
25
  end
26
26
 
27
27
  def started_at
28
- Time.at(0).to_datetime
28
+ Time.at(0)
29
29
  end
30
30
 
31
31
  def expired_at
32
- Time.at(0).to_datetime
32
+ Time.at(0)
33
33
  end
34
34
 
35
35
  def audiences
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Saml
4
4
  module Kit
5
- VERSION = '1.0.26'.freeze
5
+ VERSION = '1.0.27'.freeze
6
6
  end
7
7
  end
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.26
4
+ version: 1.0.27
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-10-22 00:00:00.000000000 Z
11
+ date: 2018-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel