saml-kit 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2492d44c647c9dad4c879ad4c4ee0386a1ac47064ee1bd32361fd78a0dae463
4
- data.tar.gz: 04d41916481b1b6c85ac10805bdf30f40fd516fa684575302f0bc5e0c8b282c9
3
+ metadata.gz: 27101b53cc92074aa1b0ea8f84d40d41f1bf32b6b208a1a5d9b94d92087cfa51
4
+ data.tar.gz: c0ad9546f68fa6feb9afaf34e8609cfac835ab7607790542a9a7146fe94ed846
5
5
  SHA512:
6
- metadata.gz: 5d0cfb62a014c2d7daa43f0f1018d440063c4ef6c4bfe011c11fccf59d7872a0939baa9451095b4237682c8c472d0bd54748a96d82faab0d7e8ef5a47b3cff1e
7
- data.tar.gz: 2538d1eac3597a1c53b0d4b777cf93770e19b25fbaf8a6590ad0e926aec0d6f8e038cfa21b3247e53818f0c3c7d4f07f2c7d73f8c24060c35ca955a138110315
6
+ metadata.gz: 656acd1866446463a4bf2578eb0b543657713ec83e8cf9c9cde89c6298c54075f857bf008c7812e42539bb715e4c5158fce899fff390c558dedc0dd692d09aac
7
+ data.tar.gz: bb7a65a294eb4a47edc1c29e16908f12c57fe74a0423b26baefc713e9fc223f47ef6533f35b66cb2ffc4bb64921352afd849296dbfed98e202ab4d53ae03f67e
@@ -7,11 +7,13 @@ module Saml
7
7
  validate :must_match_issuer
8
8
  validate :must_be_active_session
9
9
  attr_reader :name
10
+ attr_accessor :occurred_at
10
11
 
11
12
  def initialize(xml_hash, configuration: Saml::Kit.configuration)
12
13
  @name = "Assertion"
13
14
  @xml_hash = xml_hash
14
15
  @configuration = configuration
16
+ @occurred_at = Time.current
15
17
  end
16
18
 
17
19
  def issuer
@@ -31,13 +33,13 @@ module Saml
31
33
  xml_hash ? Signature.new(xml_hash) : nil
32
34
  end
33
35
 
34
- def expired?(now = Time.current)
36
+ def expired?(now = occurred_at)
35
37
  now > expired_at
36
38
  end
37
39
 
38
- def active?(now = Time.current)
40
+ def active?(now = occurred_at)
39
41
  drifted_started_at = started_at - configuration.clock_drift.to_i.seconds
40
- now > drifted_started_at && !expired?
42
+ now > drifted_started_at && !expired?(now)
41
43
  end
42
44
 
43
45
  def attributes
@@ -1,5 +1,5 @@
1
1
  module Saml
2
2
  module Kit
3
- VERSION = "1.0.5"
3
+ VERSION = "1.0.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saml-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - mo khan