@@ -290,41 +290,32 @@ def allowed_clock_drift
290
290
#
291
291
def validate ( collect_errors = false )
292
292
reset_errors!
293
+ return false unless validate_response_state
294
+
295
+ validations = [
296
+ :validate_response_state ,
297
+ :validate_version ,
298
+ :validate_id ,
299
+ :validate_success_status ,
300
+ :validate_num_assertion ,
301
+ :validate_no_encrypted_attributes ,
302
+ :validate_signed_elements ,
303
+ :validate_structure ,
304
+ :validate_in_response_to ,
305
+ :validate_conditions ,
306
+ :validate_audience ,
307
+ :validate_destination ,
308
+ :validate_issuer ,
309
+ :validate_session_expiration ,
310
+ :validate_subject_confirmation ,
311
+ :validate_signature
312
+ ]
293
313
294
314
if collect_errors
295
- return false unless validate_response_state
296
- validate_version
297
- validate_id
298
- validate_success_status
299
- validate_num_assertion
300
- validate_no_encrypted_attributes
301
- validate_signed_elements
302
- validate_structure
303
- validate_in_response_to
304
- validate_conditions
305
- validate_audience
306
- validate_issuer
307
- validate_session_expiration
308
- validate_subject_confirmation
309
- validate_signature
315
+ validations . each { |validation | send ( validation ) }
310
316
@errors . empty?
311
317
else
312
- validate_response_state &&
313
- validate_version &&
314
- validate_id &&
315
- validate_success_status &&
316
- validate_num_assertion &&
317
- validate_no_encrypted_attributes &&
318
- validate_signed_elements &&
319
- validate_structure &&
320
- validate_in_response_to &&
321
- validate_conditions &&
322
- validate_audience &&
323
- validate_destination &&
324
- validate_issuer &&
325
- validate_session_expiration &&
326
- validate_subject_confirmation &&
327
- validate_signature
318
+ validations . all? { |validation | send ( validation ) }
328
319
end
329
320
end
330
321
0 commit comments