Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh onfido-ruby after onfido-openapi-spec update (964fb43) #71

Merged
merged 2 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .release.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"source": {
"repo_url": "https://github.com/onfido/onfido-openapi-spec",
"short_sha": "8c793a1",
"long_sha": "8c793a1c8307dcd92fa657edb2a1e9b184c15278",
"version": "v4.3.0"
"short_sha": "964fb43",
"long_sha": "964fb43a1bf211197ef7a45c230771b8ba561b3c",
"version": "v4.4.0"
},
"release": "v4.3.0"
"release": "v4.4.0"
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This version uses Onfido API v3.6. Refer to our [API versioning guide](https://d
### Installation

```ruby
gem onfido, '~> 4.3.0'
gem onfido, '~> 4.4.0'
```

Configure with your API token, region and optional timeout (default value is 30):
Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ApiClient
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
def initialize(config = Configuration.default)
@config = config
@user_agent = "onfido-ruby/4.3.0"
@user_agent = "onfido-ruby/4.4.0"
@default_headers = {
'Content-Type' => 'application/json',
'User-Agent' => @user_agent
Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/models/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Task
# Input object with the fields used by the Task to execute.
attr_accessor :input

# Output object with the fields produced by the Task execution.
# Value field (it can be an Object, List, etc.) with the fields produced by the Task execution.
attr_accessor :output

# The date and time when the Task was created.
Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/models/webhook_event_payload_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class WebhookEventPayloadResource
# Input object with the fields used by the Task execution.
attr_accessor :input

# Output object with the fields produced by the Task execution.
# Value field (it can be an Object, List, etc.) with the fields produced by the Task execution.
attr_accessor :output

# The reasons the Workflow Run outcome was reached. Configurable when creating the Workflow Version.
Expand Down
4 changes: 3 additions & 1 deletion lib/onfido/models/webhook_event_resource_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ class WebhookEventResourceType
WORKFLOW_RUN = "workflow_run".freeze
WORKFLOW_TASK = "workflow_task".freeze
WATCHLIST_MONITOR = "watchlist_monitor".freeze
WORKFLOW_TIMELINE_FILE = "workflow_timeline_file".freeze
WORKFLOW_RUN_EVIDENCE_FOLDER = "workflow_run_evidence_folder".freeze
UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze

def self.all_vars
@all_vars ||= [CHECK, REPORT, AUDIT_LOG, WORKFLOW_RUN, WORKFLOW_TASK, WATCHLIST_MONITOR, UNKNOWN_DEFAULT_OPEN_API].freeze
@all_vars ||= [CHECK, REPORT, AUDIT_LOG, WORKFLOW_RUN, WORKFLOW_TASK, WATCHLIST_MONITOR, WORKFLOW_TIMELINE_FILE, WORKFLOW_RUN_EVIDENCE_FOLDER, UNKNOWN_DEFAULT_OPEN_API].freeze
end

# Builds the enum from string
Expand Down
3 changes: 2 additions & 1 deletion lib/onfido/models/webhook_event_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ class WebhookEventType
REPORT_COMPLETED = "report.completed".freeze
WORKFLOW_TIMELINE_FILE_CREATED = "workflow_timeline_file.created".freeze
WORKFLOW_SIGNED_EVIDENCE_FILE_CREATED = "workflow_signed_evidence_file.created".freeze
WORKFLOW_RUN_EVIDENCE_FOLDER_CREATED = "workflow_run_evidence_folder.created".freeze
UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze

def self.all_vars
@all_vars ||= [AUDIT_LOG_CREATED, WATCHLIST_MONITOR_MATCHES_UPDATED, WORKFLOW_RUN_COMPLETED, WORKFLOW_TASK_STARTED, WORKFLOW_TASK_COMPLETED, CHECK_STARTED, CHECK_REOPENED, CHECK_WITHDRAWN, CHECK_COMPLETED, CHECK_FORM_COMPLETED, REPORT_WITHDRAWN, REPORT_RESUMED, REPORT_CANCELLED, REPORT_AWAITING_APPROVAL, REPORT_COMPLETED, WORKFLOW_TIMELINE_FILE_CREATED, WORKFLOW_SIGNED_EVIDENCE_FILE_CREATED, UNKNOWN_DEFAULT_OPEN_API].freeze
@all_vars ||= [AUDIT_LOG_CREATED, WATCHLIST_MONITOR_MATCHES_UPDATED, WORKFLOW_RUN_COMPLETED, WORKFLOW_TASK_STARTED, WORKFLOW_TASK_COMPLETED, CHECK_STARTED, CHECK_REOPENED, CHECK_WITHDRAWN, CHECK_COMPLETED, CHECK_FORM_COMPLETED, REPORT_WITHDRAWN, REPORT_RESUMED, REPORT_CANCELLED, REPORT_AWAITING_APPROVAL, REPORT_COMPLETED, WORKFLOW_TIMELINE_FILE_CREATED, WORKFLOW_SIGNED_EVIDENCE_FILE_CREATED, WORKFLOW_RUN_EVIDENCE_FOLDER_CREATED, UNKNOWN_DEFAULT_OPEN_API].freeze
end

# Builds the enum from string
Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
=end

module Onfido
VERSION = '4.3.0'
VERSION = '4.4.0'
end
31 changes: 31 additions & 0 deletions spec/media/studio_webhook_event_with_list_in_output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"payload": {
"resource_type": "workflow_task",
"action": "workflow_task.completed",
"object": {
"id": "document_photo_5c229",
"task_spec_id": "document_photo_5c229",
"task_def_id": "upload_document_photo",
"workflow_run_id": "b48fdff9-66a1-405d-9912-54780799bd68",
"status": "completed",
"completed_at_iso8601": "2024-12-18T18:13:10Z",
"href": "https://api.eu.onfido.com/v3.6/workflow_runs/b48fdff9-66a1-405d-9912-54780799bd68/tasks/document_photo_5c229"
},
"resource": {
"updated_at": "2024-12-18T18:13:10Z",
"output": [
{
"type": "document_photo",
"id": "7af75a3a-ba34-4aa5-9e3e-096c9f56256b",
"checksum_sha256": "hiwV2PLmeQZzeySPGGwVL48sxVXcyfpXy9LDl1u3lWU="
}
],
"created_at": "2024-12-18T18:12:44Z",
"task_def_id": "upload_document_photo",
"input": {},
"workflow_run_id": "b48fdff9-66a1-405d-9912-54780799bd68",
"task_def_version": null,
"id": "document_photo_5c229"
}
}
}
264 changes: 264 additions & 0 deletions spec/media/studio_webhook_event_with_object_in_output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
{
"payload": {
"resource_type": "workflow_task",
"action": "workflow_task.completed",
"object": {
"id": "document_check_75329",
"task_spec_id": "document_check_75329",
"task_def_id": "document_check",
"workflow_run_id": "b48fdff9-66a1-405d-9912-54780799bd68",
"status": "completed",
"completed_at_iso8601": "2024-12-18T18:13:13Z",
"href": "https://api.eu.onfido.com/v3.6/workflow_runs/b48fdff9-66a1-405d-9912-54780799bd68/tasks/document_check_75329"
},
"resource": {
"task_def_version": null,
"task_def_id": "document_check",
"updated_at": "2024-12-18T18:13:13Z",
"id": "document_check_75329",
"output": {
"status": "complete",
"result": "clear",
"sub_result": "clear",
"uuid": "95c8cc09-db72-42ff-85ef-ee6c82020a24",
"properties": {
"date_of_birth": "1990-01-01",
"date_of_expiry": "2031-05-28",
"document_numbers": [
{
"type": "document_number",
"value": "999999999"
}
],
"document_type": "passport",
"first_name": "Jane",
"issuing_country": "GBR",
"last_name": "Doe",
"document_number": "999999999"
},
"breakdown": {
"data_validation": {
"result": "clear",
"breakdown": {
"mrz": {
"result": "clear",
"properties": {}
},
"expiry_date": {
"result": "clear",
"properties": {}
},
"document_expiration": {
"result": "clear",
"properties": {}
},
"document_numbers": {
"result": "clear",
"properties": {}
},
"date_of_birth": {
"result": "clear",
"properties": {}
},
"gender": {
"result": "clear",
"properties": {}
}
}
},
"visual_authenticity": {
"result": "clear",
"breakdown": {
"face_detection": {
"result": "clear",
"properties": {}
},
"other": {
"result": "clear",
"properties": {}
},
"digital_tampering": {
"result": "clear",
"properties": {}
},
"original_document_present": {
"result": "clear",
"properties": {}
},
"security_features": {
"result": "clear",
"properties": {}
},
"template": {
"result": "clear",
"properties": {}
},
"picture_face_integrity": {
"result": "clear",
"properties": {}
},
"fonts": {
"result": "clear",
"properties": {}
}
}
},
"compromised_document": {
"result": "clear",
"breakdown": {
"repeat_attempts": {
"result": "clear",
"properties": {}
},
"document_database": {
"result": "clear",
"properties": {}
}
}
},
"data_consistency": {
"result": "clear",
"breakdown": {
"nationality": {
"result": "clear",
"properties": {}
},
"last_name": {
"result": "clear",
"properties": {}
},
"first_name": {
"result": "clear",
"properties": {}
},
"multiple_data_sources_present": {
"result": "clear",
"properties": {}
},
"gender": {
"result": "clear",
"properties": {}
},
"date_of_birth": {
"result": "clear",
"properties": {}
},
"document_type": {
"result": "clear",
"properties": {}
},
"issuing_country": {
"result": "clear",
"properties": {}
},
"document_numbers": {
"result": "clear",
"properties": {}
},
"date_of_expiry": {
"result": "clear",
"properties": {}
}
}
},
"data_comparison": {
"result": "clear",
"breakdown": {
"date_of_birth": {
"result": "clear",
"properties": {}
},
"first_name": {
"result": "clear",
"properties": {}
},
"document_numbers": {
"result": "clear",
"properties": {}
},
"document_type": {
"result": "clear",
"properties": {}
},
"last_name": {
"result": "clear",
"properties": {}
},
"date_of_expiry": {
"result": "clear",
"properties": {}
},
"gender": {
"result": "clear",
"properties": {}
},
"issuing_country": {
"result": "clear",
"properties": {}
}
}
},
"image_integrity": {
"result": "clear",
"breakdown": {
"colour_picture": {
"result": "clear",
"properties": {}
},
"supported_document": {
"result": "clear",
"properties": {}
},
"conclusive_document_quality": {
"result": "clear",
"properties": {}
},
"image_quality": {
"result": "clear",
"properties": {}
}
}
},
"police_record": {
"result": "clear",
"breakdown": {
"document_has_not_been_recorded_as_lost,_stolen_or_compromised": {
"result": "clear",
"properties": {}
}
}
},
"age_validation": {
"result": "clear",
"breakdown": {
"minimum_accepted_age": {
"result": "clear",
"properties": {}
}
}
}
},
"repeat_attempts": {
"report_id": "00000000-0000-0000-0000-000000000000",
"repeat_attempts": [],
"attempts_count": 1,
"attempts_clear_rate": 0,
"unique_mismatches_count": 0
}
},
"workflow_run_id": "b48fdff9-66a1-405d-9912-54780799bd68",
"input": {
"document_ids": [
{
"checksum_sha256": "hiwV2PLmeQZzeySPGGwVL48sxVXcyfpXy9LDl1u3lWU=",
"id": "7af75a3a-ba34-4aa5-9e3e-096c9f56256b",
"type": "document_photo"
}
],
"first_name": "Jane",
"last_name": "Doe"
},
"created_at": "2024-12-18T18:13:11Z"
}
}
}
Loading
Loading