onfido 2.8.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -4
- data/Gemfile +5 -4
- data/LICENSE +5 -7
- data/README.md +69 -51
- data/Rakefile +10 -0
- data/lib/onfido/api/default_api.rb +4233 -0
- data/lib/onfido/api_client.rb +431 -0
- data/lib/onfido/api_error.rb +58 -0
- data/lib/onfido/configuration.rb +420 -0
- data/lib/onfido/models/address.rb +422 -0
- data/lib/onfido/models/address_builder.rb +422 -0
- data/lib/onfido/models/address_shared.rb +415 -0
- data/lib/onfido/models/addresses_list.rb +216 -0
- data/lib/onfido/models/applicant.rb +390 -0
- data/lib/onfido/models/applicant_builder.rb +358 -0
- data/lib/onfido/models/applicant_create.rb +281 -0
- data/lib/onfido/models/applicant_request.rb +232 -0
- data/lib/onfido/models/applicant_response.rb +341 -0
- data/lib/onfido/models/applicant_shared.rb +246 -0
- data/lib/onfido/models/applicant_update.rb +267 -0
- data/lib/onfido/models/applicant_updater.rb +344 -0
- data/lib/onfido/models/applicants_list.rb +223 -0
- data/lib/onfido/models/check.rb +419 -0
- data/lib/onfido/models/check_builder.rb +360 -0
- data/lib/onfido/models/check_request.rb +301 -0
- data/lib/onfido/models/check_response.rb +350 -0
- data/lib/onfido/models/check_shared.rb +266 -0
- data/lib/onfido/models/checks_list.rb +223 -0
- data/lib/onfido/models/complete_task_builder.rb +221 -0
- data/lib/onfido/models/complete_task_data_builder.rb +106 -0
- data/lib/onfido/models/consent_item.rb +272 -0
- data/lib/onfido/models/consents_builder.rb +205 -0
- data/lib/onfido/models/country_codes.rb +289 -0
- data/lib/onfido/models/device_intelligence_breakdown.rb +223 -0
- data/lib/onfido/models/device_intelligence_breakdown_breakdown.rb +214 -0
- data/lib/onfido/models/device_intelligence_breakdown_breakdown_device.rb +215 -0
- data/lib/onfido/models/device_intelligence_breakdown_breakdown_device_breakdown.rb +232 -0
- data/lib/onfido/models/device_intelligence_breakdown_properties.rb +232 -0
- data/lib/onfido/models/device_intelligence_breakdown_properties_device.rb +468 -0
- data/lib/onfido/models/device_intelligence_breakdown_properties_geolocation.rb +257 -0
- data/lib/onfido/models/device_intelligence_breakdown_properties_ip.rb +245 -0
- data/lib/onfido/models/device_intelligence_report.rb +345 -0
- data/lib/onfido/models/document.rb +376 -0
- data/lib/onfido/models/document_breakdown.rb +286 -0
- data/lib/onfido/models/document_breakdown_age_validation.rb +224 -0
- data/lib/onfido/models/document_breakdown_age_validation_breakdown.rb +214 -0
- data/lib/onfido/models/document_breakdown_compromised_document.rb +224 -0
- data/lib/onfido/models/document_breakdown_compromised_document_breakdown.rb +223 -0
- data/lib/onfido/models/document_breakdown_data_comparison.rb +224 -0
- data/lib/onfido/models/document_breakdown_data_comparison_breakdown.rb +277 -0
- data/lib/onfido/models/document_breakdown_data_comparison_breakdown_issuing_country.rb +223 -0
- data/lib/onfido/models/document_breakdown_data_consistency.rb +224 -0
- data/lib/onfido/models/document_breakdown_data_consistency_breakdown.rb +295 -0
- data/lib/onfido/models/document_breakdown_data_validation.rb +224 -0
- data/lib/onfido/models/document_breakdown_data_validation_breakdown.rb +268 -0
- data/lib/onfido/models/document_breakdown_data_validation_breakdown_document_expiration.rb +224 -0
- data/lib/onfido/models/document_breakdown_data_validation_breakdown_expiry_date.rb +224 -0
- data/lib/onfido/models/document_breakdown_image_integrity.rb +224 -0
- data/lib/onfido/models/document_breakdown_image_integrity_breakdown.rb +241 -0
- data/lib/onfido/models/document_breakdown_image_integrity_breakdown_colour_picture.rb +224 -0
- data/lib/onfido/models/document_breakdown_image_integrity_breakdown_conclusive_document_quality.rb +224 -0
- data/lib/onfido/models/document_breakdown_image_integrity_breakdown_image_quality.rb +224 -0
- data/lib/onfido/models/document_breakdown_image_integrity_breakdown_supported_document.rb +224 -0
- data/lib/onfido/models/document_breakdown_issuing_authority.rb +224 -0
- data/lib/onfido/models/document_breakdown_issuing_authority_breakdown.rb +223 -0
- data/lib/onfido/models/document_breakdown_issuing_authority_breakdown_nfc_active_authentication.rb +224 -0
- data/lib/onfido/models/document_breakdown_issuing_authority_breakdown_nfc_passive_authentication.rb +224 -0
- data/lib/onfido/models/document_breakdown_police_record.rb +215 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity.rb +224 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown.rb +277 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_digital_tampering.rb +224 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_face_detection.rb +224 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_fonts.rb +224 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_original_document_present.rb +224 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_other.rb +224 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_picture_face_integrity.rb +224 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_security_features.rb +224 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_template.rb +224 -0
- data/lib/onfido/models/document_cdq_reasons.rb +285 -0
- data/lib/onfido/models/document_iq_reasons.rb +305 -0
- data/lib/onfido/models/document_odp_reasons.rb +245 -0
- data/lib/onfido/models/document_properties.rb +461 -0
- data/lib/onfido/models/document_properties_address_lines.rb +259 -0
- data/lib/onfido/models/document_properties_barcode_inner.rb +367 -0
- data/lib/onfido/models/document_properties_document_classification.rb +232 -0
- data/lib/onfido/models/document_properties_document_numbers_inner.rb +223 -0
- data/lib/onfido/models/document_properties_driving_licence_information.rb +241 -0
- data/lib/onfido/models/document_properties_extracted_data.rb +394 -0
- data/lib/onfido/models/document_properties_nfc.rb +322 -0
- data/lib/onfido/models/document_report.rb +354 -0
- data/lib/onfido/models/document_response.rb +272 -0
- data/lib/onfido/models/document_shared.rb +301 -0
- data/lib/onfido/models/document_types.rb +64 -0
- data/lib/onfido/models/document_video_report.rb +354 -0
- data/lib/onfido/models/document_video_with_address_information_report.rb +354 -0
- data/lib/onfido/models/document_with_address_information_report.rb +354 -0
- data/lib/onfido/models/document_with_driver_verification_report.rb +354 -0
- data/lib/onfido/models/document_with_driver_verification_report_all_of_properties.rb +529 -0
- data/lib/onfido/models/document_with_driver_verification_report_all_of_properties_all_of_passenger_vehicle.rb +236 -0
- data/lib/onfido/models/document_with_driver_verification_report_all_of_properties_all_of_vehicle_class_details_inner.rb +245 -0
- data/lib/onfido/models/document_with_driving_licence_information_report.rb +354 -0
- data/lib/onfido/models/documents_list.rb +223 -0
- data/lib/onfido/models/error.rb +214 -0
- data/lib/onfido/models/error1.rb +224 -0
- data/lib/onfido/models/error_properties.rb +234 -0
- data/lib/onfido/models/error_properties1.rb +223 -0
- data/lib/onfido/models/extract_request.rb +222 -0
- data/lib/onfido/models/extraction.rb +233 -0
- data/lib/onfido/models/extraction_document_classification.rb +289 -0
- data/lib/onfido/models/extraction_extracted_data.rb +530 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown.rb +232 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown_face_comparison.rb +224 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown_image_integrity.rb +224 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown.rb +223 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown_face_detected.rb +224 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown_source_integrity.rb +224 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown_visual_authenticity.rb +224 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown_visual_authenticity_breakdown.rb +223 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown_visual_authenticity_breakdown_spoofing_detection.rb +224 -0
- data/lib/onfido/models/facial_similarity_motion_properties.rb +215 -0
- data/lib/onfido/models/facial_similarity_motion_report.rb +354 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown.rb +232 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_face_comparison.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown.rb +214 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown_face_match.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown_face_match_properties.rb +225 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_image_integrity.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown.rb +223 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown_face_detected.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown_source_integrity.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_visual_authenticity.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown.rb +214 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown_spoofing_detection.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown_spoofing_detection_properties.rb +215 -0
- data/lib/onfido/models/facial_similarity_photo_fully_auto_breakdown.rb +232 -0
- data/lib/onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity_breakdown.rb +223 -0
- data/lib/onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity_breakdown_source_integrity.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_fully_auto_properties.rb +215 -0
- data/lib/onfido/models/facial_similarity_photo_fully_auto_report.rb +354 -0
- data/lib/onfido/models/facial_similarity_photo_properties.rb +215 -0
- data/lib/onfido/models/facial_similarity_photo_report.rb +354 -0
- data/lib/onfido/models/facial_similarity_video_breakdown.rb +232 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_face_comparison.rb +224 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_image_integrity.rb +224 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown.rb +223 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown_face_detected.rb +224 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown_source_integrity.rb +224 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_visual_authenticity.rb +224 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown.rb +223 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown_liveness_detected.rb +224 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown_spoofing_detection.rb +224 -0
- data/lib/onfido/models/facial_similarity_video_properties.rb +215 -0
- data/lib/onfido/models/facial_similarity_video_report.rb +354 -0
- data/lib/onfido/models/id_number.rb +269 -0
- data/lib/onfido/models/id_photo.rb +289 -0
- data/lib/onfido/models/id_photo_response.rb +282 -0
- data/lib/onfido/models/id_photos_list.rb +223 -0
- data/lib/onfido/models/identity_enhanced_breakdown.rb +241 -0
- data/lib/onfido/models/identity_enhanced_breakdown_address.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_address_breakdown.rb +232 -0
- data/lib/onfido/models/identity_enhanced_breakdown_address_breakdown_credit_agencies.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_address_breakdown_credit_agencies_properties.rb +214 -0
- data/lib/onfido/models/identity_enhanced_breakdown_address_breakdown_telephone_database.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_address_breakdown_voting_register.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_date_of_birth.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown.rb +223 -0
- data/lib/onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown_credit_agencies.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown_voting_register.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_mortality.rb +215 -0
- data/lib/onfido/models/identity_enhanced_breakdown_sources.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_sources_breakdown.rb +214 -0
- data/lib/onfido/models/identity_enhanced_breakdown_sources_breakdown_total_sources.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_sources_breakdown_total_sources_properties.rb +214 -0
- data/lib/onfido/models/identity_enhanced_properties.rb +227 -0
- data/lib/onfido/models/identity_enhanced_properties_matched_addresses_inner.rb +227 -0
- data/lib/onfido/models/identity_enhanced_report.rb +354 -0
- data/lib/onfido/models/india_pan_report.rb +354 -0
- data/lib/onfido/models/india_pan_report_all_of_breakdown.rb +214 -0
- data/lib/onfido/models/india_pan_report_all_of_breakdown_device.rb +214 -0
- data/lib/onfido/models/india_pan_report_all_of_breakdown_device_breakdown.rb +223 -0
- data/lib/onfido/models/india_pan_report_all_of_breakdown_device_breakdown_pan_valid.rb +214 -0
- data/lib/onfido/models/india_pan_report_all_of_properties.rb +214 -0
- data/lib/onfido/models/india_pan_report_all_of_properties_device.rb +225 -0
- data/lib/onfido/models/known_faces_breakdown.rb +223 -0
- data/lib/onfido/models/known_faces_breakdown_image_integrity.rb +215 -0
- data/lib/onfido/models/known_faces_breakdown_previously_seen_faces.rb +215 -0
- data/lib/onfido/models/known_faces_properties.rb +217 -0
- data/lib/onfido/models/known_faces_properties_matches_inner.rb +255 -0
- data/lib/onfido/models/known_faces_report.rb +354 -0
- data/lib/onfido/models/live_photo.rb +289 -0
- data/lib/onfido/models/live_photo_response.rb +282 -0
- data/lib/onfido/models/live_photos_list.rb +223 -0
- data/lib/onfido/models/live_video.rb +287 -0
- data/lib/onfido/models/live_videos_list.rb +223 -0
- data/lib/onfido/models/location.rb +254 -0
- data/lib/onfido/models/location_builder.rb +254 -0
- data/lib/onfido/models/location_shared.rb +247 -0
- data/lib/onfido/models/motion_capture.rb +275 -0
- data/lib/onfido/models/motion_captures_list.rb +223 -0
- data/lib/onfido/models/photo_auto_reasons.rb +255 -0
- data/lib/onfido/models/photo_reasons.rb +255 -0
- data/lib/onfido/models/proof_of_address_breakdown.rb +232 -0
- data/lib/onfido/models/proof_of_address_breakdown_data_comparison.rb +224 -0
- data/lib/onfido/models/proof_of_address_breakdown_data_comparison_breakdown.rb +232 -0
- data/lib/onfido/models/proof_of_address_breakdown_document_classification.rb +224 -0
- data/lib/onfido/models/proof_of_address_breakdown_document_classification_breakdown.rb +214 -0
- data/lib/onfido/models/proof_of_address_breakdown_image_integrity.rb +224 -0
- data/lib/onfido/models/proof_of_address_breakdown_image_integrity_breakdown.rb +214 -0
- data/lib/onfido/models/proof_of_address_properties.rb +319 -0
- data/lib/onfido/models/proof_of_address_report.rb +354 -0
- data/lib/onfido/models/repeat_attempts_list.rb +292 -0
- data/lib/onfido/models/repeat_attempts_list_repeat_attempts_inner.rb +333 -0
- data/lib/onfido/models/report.rb +93 -0
- data/lib/onfido/models/report_document.rb +222 -0
- data/lib/onfido/models/report_name.rb +60 -0
- data/lib/onfido/models/report_result.rb +42 -0
- data/lib/onfido/models/report_shared.rb +329 -0
- data/lib/onfido/models/report_status.rb +44 -0
- data/lib/onfido/models/report_sub_result.rb +43 -0
- data/lib/onfido/models/reports_list.rb +223 -0
- data/lib/onfido/models/results_feedback.rb +279 -0
- data/lib/onfido/models/sdk_token.rb +229 -0
- data/lib/onfido/models/sdk_token_builder.rb +259 -0
- data/lib/onfido/models/sdk_token_request.rb +252 -0
- data/lib/onfido/models/sdk_token_response.rb +222 -0
- data/lib/onfido/models/task.rb +329 -0
- data/lib/onfido/models/task_item.rb +287 -0
- data/lib/onfido/models/timeline_file_reference.rb +239 -0
- data/lib/onfido/models/us_driving_licence_breakdown.rb +232 -0
- data/lib/onfido/models/us_driving_licence_breakdown_address.rb +224 -0
- data/lib/onfido/models/us_driving_licence_breakdown_address_breakdown.rb +259 -0
- data/lib/onfido/models/us_driving_licence_breakdown_document.rb +224 -0
- data/lib/onfido/models/us_driving_licence_breakdown_document_breakdown.rb +241 -0
- data/lib/onfido/models/us_driving_licence_breakdown_personal.rb +224 -0
- data/lib/onfido/models/us_driving_licence_breakdown_personal_breakdown.rb +322 -0
- data/lib/onfido/models/us_driving_licence_builder.rb +505 -0
- data/lib/onfido/models/us_driving_licence_report.rb +354 -0
- data/lib/onfido/models/us_driving_licence_shared.rb +499 -0
- data/lib/onfido/models/video_reasons.rb +245 -0
- data/lib/onfido/models/watchlist_aml_breakdown.rb +241 -0
- data/lib/onfido/models/watchlist_aml_breakdown_adverse_media.rb +215 -0
- data/lib/onfido/models/watchlist_aml_breakdown_legal_and_regulatory_warnings.rb +215 -0
- data/lib/onfido/models/watchlist_aml_breakdown_politically_exposed_person.rb +215 -0
- data/lib/onfido/models/watchlist_aml_breakdown_sanction.rb +215 -0
- data/lib/onfido/models/watchlist_aml_properties.rb +217 -0
- data/lib/onfido/models/watchlist_aml_report.rb +354 -0
- data/lib/onfido/models/watchlist_enhanced_breakdown.rb +241 -0
- data/lib/onfido/models/watchlist_enhanced_properties.rb +217 -0
- data/lib/onfido/models/watchlist_enhanced_report.rb +354 -0
- data/lib/onfido/models/watchlist_monitor.rb +342 -0
- data/lib/onfido/models/watchlist_monitor_builder.rb +292 -0
- data/lib/onfido/models/watchlist_monitor_match.rb +225 -0
- data/lib/onfido/models/watchlist_monitor_matches_list.rb +223 -0
- data/lib/onfido/models/watchlist_monitor_matches_updater.rb +227 -0
- data/lib/onfido/models/watchlist_monitor_response.rb +254 -0
- data/lib/onfido/models/watchlist_monitor_shared.rb +285 -0
- data/lib/onfido/models/watchlist_monitors_list.rb +223 -0
- data/lib/onfido/models/watchlist_peps_only_report.rb +354 -0
- data/lib/onfido/models/watchlist_sanctions_only_report.rb +354 -0
- data/lib/onfido/models/watchlist_standard_breakdown.rb +232 -0
- data/lib/onfido/models/watchlist_standard_properties.rb +217 -0
- data/lib/onfido/models/watchlist_standard_report.rb +354 -0
- data/lib/onfido/models/webhook.rb +304 -0
- data/lib/onfido/models/webhook_builder.rb +274 -0
- data/lib/onfido/models/webhook_create.rb +222 -0
- data/lib/onfido/models/webhook_event.rb +214 -0
- data/lib/onfido/models/webhook_event_payload.rb +273 -0
- data/lib/onfido/models/webhook_event_payload_object.rb +260 -0
- data/lib/onfido/models/webhook_event_type.rb +56 -0
- data/lib/onfido/models/webhook_resend.rb +216 -0
- data/lib/onfido/models/webhook_response.rb +252 -0
- data/lib/onfido/models/webhook_shared.rb +249 -0
- data/lib/onfido/models/webhook_update.rb +215 -0
- data/lib/onfido/models/webhook_updater.rb +267 -0
- data/lib/onfido/models/webhooks_list.rb +223 -0
- data/lib/onfido/models/webhooks_resend_item.rb +261 -0
- data/lib/onfido/models/workflow_run.rb +416 -0
- data/lib/onfido/models/workflow_run_builder.rb +316 -0
- data/lib/onfido/models/workflow_run_request.rb +217 -0
- data/lib/onfido/models/workflow_run_response.rb +317 -0
- data/lib/onfido/models/workflow_run_response_error.rb +226 -0
- data/lib/onfido/models/workflow_run_shared.rb +296 -0
- data/lib/onfido/models/workflow_run_shared_link.rb +290 -0
- data/lib/onfido/version.rb +12 -2
- data/lib/onfido/webhook_event_verifier.rb +20 -0
- data/lib/onfido.rb +309 -25
- data/onfido.gemspec +42 -33
- data/spec/integrations/address_picker_spec.rb +16 -0
- data/spec/integrations/applicant_spec.rb +73 -95
- data/spec/integrations/check_spec.rb +60 -41
- data/spec/integrations/document_spec.rb +28 -57
- data/spec/integrations/extraction_spec.rb +27 -12
- data/spec/integrations/id_photo_spec.rb +55 -0
- data/spec/integrations/live_photo_spec.rb +28 -45
- data/spec/integrations/live_video_spec.rb +33 -19
- data/spec/integrations/media/sample_driving_licence.png +0 -0
- data/spec/integrations/media/sample_photo.png +0 -0
- data/spec/integrations/motion_capture_spec.rb +30 -24
- data/spec/integrations/report_schema_spec.rb +45 -0
- data/spec/integrations/report_spec.rb +34 -25
- data/spec/integrations/sdk_token_spec.rb +12 -10
- data/spec/integrations/tasks_spec.rb +45 -0
- data/spec/integrations/watchlist_monitor_spec.rb +73 -0
- data/spec/integrations/webhook_spec.rb +40 -88
- data/spec/integrations/workflow_run_output_spec.rb +117 -0
- data/spec/integrations/workflow_run_spec.rb +67 -29
- data/spec/shared_contexts/with_applicant.rb +24 -0
- data/spec/shared_contexts/with_check.rb +18 -0
- data/spec/shared_contexts/with_document.rb +13 -0
- data/spec/shared_contexts/with_live_photo.rb +18 -0
- data/spec/shared_contexts/with_onfido.rb +14 -0
- data/spec/shared_contexts/with_workflow_run.rb +19 -0
- data/spec/spec_helper.rb +73 -11
- data/spec/webhook_event_verifier_spec.rb +29 -0
- metadata +367 -155
- data/.github/workflows/gem-push.yml +0 -31
- data/.github/workflows/ruby.yml +0 -25
- data/.gitignore +0 -19
- data/.rspec +0 -2
- data/.rubocop.yml +0 -13
- data/lib/onfido/api.rb +0 -65
- data/lib/onfido/errors/connection_error.rb +0 -6
- data/lib/onfido/errors/onfido_error.rb +0 -30
- data/lib/onfido/errors/request_error.rb +0 -6
- data/lib/onfido/errors/server_error.rb +0 -6
- data/lib/onfido/options.rb +0 -38
- data/lib/onfido/resource.rb +0 -153
- data/lib/onfido/resources/address.rb +0 -9
- data/lib/onfido/resources/applicant.rb +0 -29
- data/lib/onfido/resources/check.rb +0 -28
- data/lib/onfido/resources/document.rb +0 -28
- data/lib/onfido/resources/extraction.rb +0 -11
- data/lib/onfido/resources/live_photo.rb +0 -27
- data/lib/onfido/resources/live_video.rb +0 -17
- data/lib/onfido/resources/monitor.rb +0 -32
- data/lib/onfido/resources/motion_capture.rb +0 -21
- data/lib/onfido/resources/report.rb +0 -21
- data/lib/onfido/resources/sdk_token.rb +0 -10
- data/lib/onfido/resources/webhook.rb +0 -40
- data/lib/onfido/resources/workflow_run.rb +0 -17
- data/spec/integrations/address_spec.rb +0 -13
- data/spec/integrations/monitor_spec.rb +0 -100
- data/spec/integrations/resource_spec.rb +0 -106
- data/spec/onfido/api_spec.rb +0 -22
- data/spec/onfido/connection_error_spec.rb +0 -20
- data/spec/onfido/options_spec.rb +0 -39
- data/spec/onfido/request_error_spec.rb +0 -36
- data/spec/support/fake_onfido_api.rb +0 -283
- data/spec/support/fixtures/4xx_response.json +0 -14
- data/spec/support/fixtures/addresses.json +0 -24
- data/spec/support/fixtures/applicant.json +0 -28
- data/spec/support/fixtures/applicants.json +0 -12
- data/spec/support/fixtures/check.json +0 -12
- data/spec/support/fixtures/checks.json +0 -16
- data/spec/support/fixtures/document.json +0 -10
- data/spec/support/fixtures/documents.json +0 -23
- data/spec/support/fixtures/extraction.json +0 -23
- data/spec/support/fixtures/live_photo.json +0 -9
- data/spec/support/fixtures/live_photos.json +0 -22
- data/spec/support/fixtures/live_video.json +0 -23
- data/spec/support/fixtures/live_videos.json +0 -27
- data/spec/support/fixtures/monitor.json +0 -8
- data/spec/support/fixtures/monitor_matches.json +0 -12
- data/spec/support/fixtures/monitors.json +0 -12
- data/spec/support/fixtures/motion_capture.json +0 -9
- data/spec/support/fixtures/motion_captures.json +0 -13
- data/spec/support/fixtures/not_scheduled_for_deletion_error.json +0 -7
- data/spec/support/fixtures/report.json +0 -10
- data/spec/support/fixtures/reports.json +0 -24
- data/spec/support/fixtures/sdk_token.json +0 -3
- data/spec/support/fixtures/unexpected_error_format.json +0 -3
- data/spec/support/fixtures/webhook.json +0 -14
- data/spec/support/fixtures/webhooks.json +0 -31
- data/spec/support/fixtures/workflow_run.json +0 -20
- data/spec/support/fixtures/workflow_runs.json +0 -42
@@ -0,0 +1,420 @@
|
|
1
|
+
=begin
|
2
|
+
#Onfido API v3.6
|
3
|
+
|
4
|
+
#The Onfido API (v3.6)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3.6
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.6.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'faraday/follow_redirects'
|
14
|
+
|
15
|
+
module Onfido
|
16
|
+
class Configuration
|
17
|
+
REGIONS = {
|
18
|
+
EU: 'eu',
|
19
|
+
CA: 'ca',
|
20
|
+
US: 'us'
|
21
|
+
}.freeze
|
22
|
+
|
23
|
+
# Defines url scheme
|
24
|
+
attr_accessor :scheme
|
25
|
+
|
26
|
+
# Defines url host
|
27
|
+
attr_accessor :host
|
28
|
+
|
29
|
+
# Defines url base path
|
30
|
+
attr_accessor :base_path
|
31
|
+
|
32
|
+
# Define server configuration index
|
33
|
+
attr_accessor :server_index
|
34
|
+
|
35
|
+
# Define server operation configuration index
|
36
|
+
attr_accessor :server_operation_index
|
37
|
+
|
38
|
+
# Default server variables
|
39
|
+
attr_accessor :server_variables
|
40
|
+
|
41
|
+
# Default server operation variables
|
42
|
+
attr_accessor :server_operation_variables
|
43
|
+
|
44
|
+
# Defines API keys used with API Key authentications.
|
45
|
+
#
|
46
|
+
# @return [Hash] key: parameter name, value: parameter value (API key)
|
47
|
+
#
|
48
|
+
# @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
|
49
|
+
# config.api_key['api_key'] = 'xxx'
|
50
|
+
attr_accessor :api_key
|
51
|
+
|
52
|
+
# Defines API key prefixes used with API Key authentications.
|
53
|
+
#
|
54
|
+
# @return [Hash] key: parameter name, value: API key prefix
|
55
|
+
#
|
56
|
+
# @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
|
57
|
+
# config.api_key_prefix['api_key'] = 'Token'
|
58
|
+
attr_accessor :api_key_prefix
|
59
|
+
|
60
|
+
# Defines the username used with HTTP basic authentication.
|
61
|
+
#
|
62
|
+
# @return [String]
|
63
|
+
attr_accessor :username
|
64
|
+
|
65
|
+
# Defines the password used with HTTP basic authentication.
|
66
|
+
#
|
67
|
+
# @return [String]
|
68
|
+
attr_accessor :password
|
69
|
+
|
70
|
+
# Defines the access token (Bearer) used with OAuth2.
|
71
|
+
attr_accessor :access_token
|
72
|
+
|
73
|
+
# Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
|
74
|
+
# Overrides the access_token if set
|
75
|
+
# @return [Proc]
|
76
|
+
attr_accessor :access_token_getter
|
77
|
+
|
78
|
+
# Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
|
79
|
+
# HTTP responses with return type `File` will be returned as a stream of binary data.
|
80
|
+
# Default to false.
|
81
|
+
attr_accessor :return_binary_data
|
82
|
+
|
83
|
+
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
84
|
+
# details will be logged with `logger.debug` (see the `logger` attribute).
|
85
|
+
# Default to false.
|
86
|
+
#
|
87
|
+
# @return [true, false]
|
88
|
+
attr_accessor :debugging
|
89
|
+
|
90
|
+
# Defines the logger used for debugging.
|
91
|
+
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
92
|
+
#
|
93
|
+
# @return [#debug]
|
94
|
+
attr_accessor :logger
|
95
|
+
|
96
|
+
# Defines the temporary folder to store downloaded files
|
97
|
+
# (for API endpoints that have file response).
|
98
|
+
# Default to use `Tempfile`.
|
99
|
+
#
|
100
|
+
# @return [String]
|
101
|
+
attr_accessor :temp_folder_path
|
102
|
+
|
103
|
+
# The time limit for HTTP request in seconds.
|
104
|
+
# Default to 0 (never times out).
|
105
|
+
attr_accessor :timeout
|
106
|
+
|
107
|
+
# Set this to false to skip client side validation in the operation.
|
108
|
+
# Default to true.
|
109
|
+
# @return [true, false]
|
110
|
+
attr_accessor :client_side_validation
|
111
|
+
|
112
|
+
### TLS/SSL setting
|
113
|
+
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
114
|
+
# Default to true.
|
115
|
+
#
|
116
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
117
|
+
#
|
118
|
+
# @return [true, false]
|
119
|
+
attr_accessor :ssl_verify
|
120
|
+
|
121
|
+
### TLS/SSL setting
|
122
|
+
# Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html)
|
123
|
+
#
|
124
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
125
|
+
#
|
126
|
+
attr_accessor :ssl_verify_mode
|
127
|
+
|
128
|
+
### TLS/SSL setting
|
129
|
+
# Set this to customize the certificate file to verify the peer.
|
130
|
+
#
|
131
|
+
# @return [String] the path to the certificate file
|
132
|
+
attr_accessor :ssl_ca_file
|
133
|
+
|
134
|
+
### TLS/SSL setting
|
135
|
+
# Client certificate file (for client certificate)
|
136
|
+
attr_accessor :ssl_client_cert
|
137
|
+
|
138
|
+
### TLS/SSL setting
|
139
|
+
# Client private key file (for client certificate)
|
140
|
+
attr_accessor :ssl_client_key
|
141
|
+
|
142
|
+
### Proxy setting
|
143
|
+
# HTTP Proxy settings
|
144
|
+
attr_accessor :proxy
|
145
|
+
|
146
|
+
# Set this to customize parameters encoder of array parameter.
|
147
|
+
# Default to nil. Faraday uses NestedParamsEncoder when nil.
|
148
|
+
#
|
149
|
+
# @see The params_encoder option of Faraday. Related source code:
|
150
|
+
# https://github.com/lostisland/faraday/tree/main/lib/faraday/encoders
|
151
|
+
attr_accessor :params_encoder
|
152
|
+
|
153
|
+
|
154
|
+
attr_accessor :inject_format
|
155
|
+
|
156
|
+
attr_accessor :force_ending_format
|
157
|
+
|
158
|
+
def initialize
|
159
|
+
@scheme = 'https'
|
160
|
+
@host = 'api.eu.onfido.com'
|
161
|
+
@base_path = '/v3.6'
|
162
|
+
@server_index = nil
|
163
|
+
@server_operation_index = {}
|
164
|
+
@server_variables = {}
|
165
|
+
@server_operation_variables = {}
|
166
|
+
@api_key = {}
|
167
|
+
@api_key_prefix = {}
|
168
|
+
@client_side_validation = true
|
169
|
+
@ssl_verify = true
|
170
|
+
@ssl_verify_mode = nil
|
171
|
+
@ssl_ca_file = nil
|
172
|
+
@ssl_client_cert = nil
|
173
|
+
@ssl_client_key = nil
|
174
|
+
@middlewares = Hash.new { |h, k| h[k] = [] }
|
175
|
+
@configure_connection_blocks = []
|
176
|
+
@timeout = 30
|
177
|
+
# return data as binary instead of file
|
178
|
+
@return_binary_data = false
|
179
|
+
@params_encoder = nil
|
180
|
+
@debugging = false
|
181
|
+
@inject_format = false
|
182
|
+
@force_ending_format = false
|
183
|
+
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
184
|
+
|
185
|
+
use( Faraday::FollowRedirects::Middleware )
|
186
|
+
|
187
|
+
yield(self) if block_given?
|
188
|
+
end
|
189
|
+
|
190
|
+
# The default Configuration object.
|
191
|
+
def self.default
|
192
|
+
@@default ||= Configuration.new
|
193
|
+
end
|
194
|
+
|
195
|
+
def configure
|
196
|
+
yield(self) if block_given?
|
197
|
+
end
|
198
|
+
|
199
|
+
def scheme=(scheme)
|
200
|
+
# remove :// from scheme
|
201
|
+
@scheme = scheme.sub(/:\/\//, '')
|
202
|
+
end
|
203
|
+
|
204
|
+
def host=(host)
|
205
|
+
# remove http(s):// and anything after a slash
|
206
|
+
@host = host.sub(/https?:\/\//, '').split('/').first
|
207
|
+
end
|
208
|
+
|
209
|
+
def base_path=(base_path)
|
210
|
+
# Add leading and trailing slashes to base_path
|
211
|
+
@base_path = "/#{base_path}".gsub(/\/+/, '/')
|
212
|
+
@base_path = '' if @base_path == '/'
|
213
|
+
end
|
214
|
+
|
215
|
+
# Returns base URL for specified operation based on server settings
|
216
|
+
def base_url(operation = nil)
|
217
|
+
if operation_server_settings.key?(operation) then
|
218
|
+
index = server_operation_index.fetch(operation, server_index)
|
219
|
+
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
220
|
+
else
|
221
|
+
server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
def api_token=(api_token)
|
226
|
+
@api_key = {'Token' => "Token token=#{api_token}"}
|
227
|
+
end
|
228
|
+
|
229
|
+
def region()
|
230
|
+
REGIONS
|
231
|
+
end
|
232
|
+
|
233
|
+
def region=(region)
|
234
|
+
@server_index = 0
|
235
|
+
server_variables[:region] = region
|
236
|
+
end
|
237
|
+
|
238
|
+
def timeout=(timeout)
|
239
|
+
@timeout = timeout
|
240
|
+
end
|
241
|
+
|
242
|
+
# Gets API key (with prefix if set).
|
243
|
+
# @param [String] param_name the parameter name of API key auth
|
244
|
+
def api_key_with_prefix(param_name, param_alias = nil)
|
245
|
+
key = @api_key[param_name]
|
246
|
+
key = @api_key.fetch(param_alias, key) unless param_alias.nil?
|
247
|
+
if @api_key_prefix[param_name]
|
248
|
+
"#{@api_key_prefix[param_name]} #{key}"
|
249
|
+
else
|
250
|
+
key
|
251
|
+
end
|
252
|
+
end
|
253
|
+
|
254
|
+
# Gets access_token using access_token_getter or uses the static access_token
|
255
|
+
def access_token_with_refresh
|
256
|
+
return access_token if access_token_getter.nil?
|
257
|
+
access_token_getter.call
|
258
|
+
end
|
259
|
+
|
260
|
+
# Gets Basic Auth token string
|
261
|
+
def basic_auth_token
|
262
|
+
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
263
|
+
end
|
264
|
+
|
265
|
+
# Returns Auth Settings hash for api client.
|
266
|
+
def auth_settings
|
267
|
+
{
|
268
|
+
'Token' =>
|
269
|
+
{
|
270
|
+
type: 'api_key',
|
271
|
+
in: 'header',
|
272
|
+
key: 'Authorization',
|
273
|
+
value: api_key_with_prefix('Token')
|
274
|
+
},
|
275
|
+
}
|
276
|
+
end
|
277
|
+
|
278
|
+
# Returns an array of Server setting
|
279
|
+
def server_settings
|
280
|
+
[
|
281
|
+
{
|
282
|
+
url: "https://api.{region}.onfido.com/v3.6",
|
283
|
+
description: "No description provided",
|
284
|
+
variables: {
|
285
|
+
region: {
|
286
|
+
description: "No description provided",
|
287
|
+
default_value: "eu",
|
288
|
+
enum_values: [
|
289
|
+
"eu",
|
290
|
+
"us",
|
291
|
+
"ca"
|
292
|
+
]
|
293
|
+
}
|
294
|
+
}
|
295
|
+
}
|
296
|
+
]
|
297
|
+
end
|
298
|
+
|
299
|
+
def operation_server_settings
|
300
|
+
{
|
301
|
+
}
|
302
|
+
end
|
303
|
+
|
304
|
+
# Returns URL based on server settings
|
305
|
+
#
|
306
|
+
# @param index array index of the server settings
|
307
|
+
# @param variables hash of variable and the corresponding value
|
308
|
+
def server_url(index, variables = {}, servers = nil)
|
309
|
+
servers = server_settings if servers == nil
|
310
|
+
|
311
|
+
# check array index out of bound
|
312
|
+
if (index.nil? || index < 0 || index >= servers.size)
|
313
|
+
fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
|
314
|
+
end
|
315
|
+
|
316
|
+
server = servers[index]
|
317
|
+
url = server[:url]
|
318
|
+
|
319
|
+
return url unless server.key? :variables
|
320
|
+
|
321
|
+
# go through variable and assign a value
|
322
|
+
server[:variables].each do |name, variable|
|
323
|
+
if variables.key?(name)
|
324
|
+
if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
|
325
|
+
url.gsub! "{" + name.to_s + "}", variables[name]
|
326
|
+
else
|
327
|
+
fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
|
328
|
+
end
|
329
|
+
else
|
330
|
+
# use default value
|
331
|
+
url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
|
332
|
+
end
|
333
|
+
end
|
334
|
+
|
335
|
+
url
|
336
|
+
end
|
337
|
+
|
338
|
+
# Configure Faraday connection directly.
|
339
|
+
#
|
340
|
+
# ```
|
341
|
+
# c.configure_faraday_connection do |conn|
|
342
|
+
# conn.use Faraday::HttpCache, shared_cache: false, logger: logger
|
343
|
+
# conn.response :logger, nil, headers: true, bodies: true, log_level: :debug do |logger|
|
344
|
+
# logger.filter(/(Authorization: )(.*)/, '\1[REDACTED]')
|
345
|
+
# end
|
346
|
+
# end
|
347
|
+
#
|
348
|
+
# c.configure_faraday_connection do |conn|
|
349
|
+
# conn.adapter :typhoeus
|
350
|
+
# end
|
351
|
+
# ```
|
352
|
+
#
|
353
|
+
# @param block [Proc] `#call`able object that takes one arg, the connection
|
354
|
+
def configure_faraday_connection(&block)
|
355
|
+
@configure_connection_blocks << block
|
356
|
+
end
|
357
|
+
|
358
|
+
def configure_connection(conn)
|
359
|
+
@configure_connection_blocks.each do |block|
|
360
|
+
block.call(conn)
|
361
|
+
end
|
362
|
+
end
|
363
|
+
|
364
|
+
# Adds middleware to the stack
|
365
|
+
def use(*middleware)
|
366
|
+
set_faraday_middleware(:use, *middleware)
|
367
|
+
end
|
368
|
+
|
369
|
+
# Adds request middleware to the stack
|
370
|
+
def request(*middleware)
|
371
|
+
set_faraday_middleware(:request, *middleware)
|
372
|
+
end
|
373
|
+
|
374
|
+
# Adds response middleware to the stack
|
375
|
+
def response(*middleware)
|
376
|
+
set_faraday_middleware(:response, *middleware)
|
377
|
+
end
|
378
|
+
|
379
|
+
# Adds Faraday middleware setting information to the stack
|
380
|
+
#
|
381
|
+
# @example Use the `set_faraday_middleware` method to set middleware information
|
382
|
+
# config.set_faraday_middleware(:request, :retry, max: 3, methods: [:get, :post], retry_statuses: [503])
|
383
|
+
# config.set_faraday_middleware(:response, :logger, nil, { bodies: true, log_level: :debug })
|
384
|
+
# config.set_faraday_middleware(:use, Faraday::HttpCache, store: Rails.cache, shared_cache: false)
|
385
|
+
# config.set_faraday_middleware(:insert, 0, FaradayMiddleware::FollowRedirects, { standards_compliant: true, limit: 1 })
|
386
|
+
# config.set_faraday_middleware(:swap, 0, Faraday::Response::Logger)
|
387
|
+
# config.set_faraday_middleware(:delete, Faraday::Multipart::Middleware)
|
388
|
+
#
|
389
|
+
# @see https://github.com/lostisland/faraday/blob/v2.3.0/lib/faraday/rack_builder.rb#L92-L143
|
390
|
+
def set_faraday_middleware(operation, key, *args, &block)
|
391
|
+
unless [:request, :response, :use, :insert, :insert_before, :insert_after, :swap, :delete].include?(operation)
|
392
|
+
fail ArgumentError, "Invalid faraday middleware operation #{operation}. Must be" \
|
393
|
+
" :request, :response, :use, :insert, :insert_before, :insert_after, :swap or :delete."
|
394
|
+
end
|
395
|
+
|
396
|
+
@middlewares[operation] << [key, args, block]
|
397
|
+
end
|
398
|
+
ruby2_keywords(:set_faraday_middleware) if respond_to?(:ruby2_keywords, true)
|
399
|
+
|
400
|
+
# Set up middleware on the connection
|
401
|
+
def configure_middleware(connection)
|
402
|
+
return if @middlewares.empty?
|
403
|
+
|
404
|
+
[:request, :response, :use, :insert, :insert_before, :insert_after, :swap].each do |operation|
|
405
|
+
next unless @middlewares.key?(operation)
|
406
|
+
|
407
|
+
@middlewares[operation].each do |key, args, block|
|
408
|
+
connection.builder.send(operation, key, *args, &block)
|
409
|
+
end
|
410
|
+
end
|
411
|
+
|
412
|
+
if @middlewares.key?(:delete)
|
413
|
+
@middlewares[:delete].each do |key, _args, _block|
|
414
|
+
connection.builder.delete(key)
|
415
|
+
end
|
416
|
+
end
|
417
|
+
end
|
418
|
+
|
419
|
+
end
|
420
|
+
end
|