You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error_msg="Current time is earlier than NotBefore condition (#{now_with_drift} < #{not_before})"
695
+
ifnot_before && now < (not_before -allowed_clock_drift)
696
+
error_msg="Current time is earlier than NotBefore condition (#{now} < #{not_before}#{" - #{allowed_clock_drift.ceil}s"ifallowed_clock_drift > 0})"
697
697
returnappend_error(error_msg)
698
698
end
699
699
700
-
ifnot_on_or_after && now >= (not_on_or_after_with_drift=not_on_or_after + allowed_clock_drift)
701
-
error_msg="Current time is on or after NotOnOrAfter condition (#{now} >= #{not_on_or_after_with_drift})"
700
+
ifnot_on_or_after && now >= (not_on_or_after + allowed_clock_drift)
701
+
error_msg="Current time is on or after NotOnOrAfter condition (#{now} >= #{not_on_or_after}#{" + #{allowed_clock_drift.ceil}s"ifallowed_clock_drift > 0})"
# Hard aux function to validate the Logout Request
134
140
# @param collect_errors [Boolean] Stop validation when first error appears or keep validating. (if soft=true)
135
141
# @return [Boolean] TRUE if the Logout Request is valid
@@ -180,15 +186,17 @@ def validate_version
180
186
true
181
187
end
182
188
183
-
# Validates the time. (If the logout request was initialized with the :allowed_clock_drift option, the timing validations are relaxed by the allowed_clock_drift value)
189
+
# Validates the time. (If the logout request was initialized with the :allowed_clock_drift
190
+
# option, the timing validations are relaxed by the allowed_clock_drift value)
184
191
# If fails, the error is added to the errors array
185
192
# @return [Boolean] True if satisfies the conditions, otherwise False if soft=True
186
193
# @raise [ValidationError] if soft == false and validation fails
187
194
#
188
195
defvalidate_not_on_or_after
189
196
now=Time.now.utc
190
-
ifnot_on_or_after && now >= (not_on_or_after + (options[:allowed_clock_drift] || 0))
191
-
returnappend_error("Current time is on or after NotOnOrAfter (#{now} >= #{not_on_or_after})")
197
+
198
+
ifnot_on_or_after && now >= (not_on_or_after + allowed_clock_drift)
199
+
returnappend_error("Current time is on or after NotOnOrAfter (#{now} >= #{not_on_or_after}#{" + #{allowed_clock_drift.ceil}s"ifallowed_clock_drift > 0})")
contains_expected_error=response.errors.include?"Current time is on or after NotOnOrAfter condition (2012-11-30 17:55:00 UTC >= 2012-11-28 18:33:45 UTC)"
335
-
contains_expected_error ||= response.errors.include?"Current time is on or after NotOnOrAfter condition (Fri Nov 30 17:55:00 UTC 2012 >= Wed Nov 28 18:33:45 UTC 2012)"
334
+
contains_expected_error=response.errors.include?("Current time is on or after NotOnOrAfter condition (2012-11-30 17:55:00 UTC >= 2012-11-28 18:33:45 UTC + 1s)")
335
+
contains_expected_error ||= response.errors.include?("Current time is on or after NotOnOrAfter condition (Fri Nov 30 17:55:00 UTC 2012 >= Wed Nov 28 18:33:45 UTC 2012 + 1s)")
0 commit comments