forked from GetMetaMap/mati-python
-
Notifications
You must be signed in to change notification settings - Fork 2
Verificar la propiedad de "computed" para asegurar rechazar documentos expirados. #122
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
Merged
felipao-mx
merged 20 commits into
master
from
fix/eduardo-garcia18/299/CheckComputedPropertyToValidateExpiration
Jul 14, 2025
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
7535095
fix: validate computed field to ensure reject expired documents
eduardo-garcia18 3b615b5
fix: restore client for conftest
eduardo-garcia18 c77062c
bump: bump to version 2.0.7
eduardo-garcia18 f0c0e4a
fix: run make format
eduardo-garcia18 de5dc51
fix: fixes from coderabbit revision
eduardo-garcia18 07df0fc
fix: add type annotation for return value
eduardo-garcia18 0ae765b
fix: validate error in test
eduardo-garcia18 f86facf
fix: set correct status for document expired step
eduardo-garcia18 f49ab3a
feat: add expired step to retrieve errors correctly
eduardo-garcia18 baef203
fix: fix lint
eduardo-garcia18 8a80833
feat: change version to generate pre-release
eduardo-garcia18 7b8ba3b
feat: restore release version
eduardo-garcia18 22f0f01
fix: fix issue with expired error
eduardo-garcia18 3f174fb
feat: restore version
eduardo-garcia18 6693687
feat: set error id and code according to errors from mati
eduardo-garcia18 dd52993
feat: restore to release version
eduardo-garcia18 bbac892
fix: fix broken test
eduardo-garcia18 0509799
feat: add comment doc for clarity
eduardo-garcia18 7f33c93
fix: fix lint
eduardo-garcia18 803141e
fix: add missing validation to a test
eduardo-garcia18 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| __version__ = '2.0.6' | ||
| __version__ = '2.0.7' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
165 changes: 165 additions & 0 deletions
165
tests/resources/cassettes/test_retrieve_verification_invalid_govt.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| interactions: | ||
| - request: | ||
| body: grant_type=client_credentials | ||
| headers: | ||
| Accept: | ||
| - '*/*' | ||
| Accept-Encoding: | ||
| - gzip, deflate | ||
| Connection: | ||
| - keep-alive | ||
| Content-Length: | ||
| - '29' | ||
| Content-Type: | ||
| - application/x-www-form-urlencoded | ||
| User-Agent: | ||
| - mati-python/2.0.7.dev1 | ||
| method: POST | ||
| uri: https://api.getmati.com/oauth | ||
| response: | ||
| body: | ||
| string: '{"access_token": "ACCESS_TOKEN", "expiresIn": 3600, "payload": {"user": | ||
| {"_id": "ID", "firstName": "FIRST_NAME", "lastName": "LAST_NAME"}}}' | ||
| headers: | ||
| Connection: | ||
| - keep-alive | ||
| Content-Type: | ||
| - application/json; charset=utf-8 | ||
| Date: | ||
| - Tue, 08 Jul 2025 23:18:57 GMT | ||
| Transfer-Encoding: | ||
| - chunked | ||
| cache-control: | ||
| - no-store, no-cache, must-revalidate, proxy-revalidate | ||
| content-security-policy: | ||
| - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' | ||
| https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src | ||
| ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' | ||
| expect-ct: | ||
| - max-age=0 | ||
| expires: | ||
| - '0' | ||
| pragma: | ||
| - no-cache | ||
| referrer-policy: | ||
| - no-referrer | ||
| strict-transport-security: | ||
| - max-age=15552000; includeSubDomains; preload | ||
| surrogate-control: | ||
| - no-store | ||
| x-content-type-options: | ||
| - nosniff | ||
| x-dns-prefetch-control: | ||
| - 'off' | ||
| x-download-options: | ||
| - noopen | ||
| x-envoy-upstream-service-time: | ||
| - '141' | ||
| x-frame-options: | ||
| - DENY | ||
| x-permitted-cross-domain-policies: | ||
| - none | ||
| x-request-id: | ||
| - add8dd4e-74a3-414d-83aa-f8e1dd998672 | ||
| x-xss-protection: | ||
| - '1' | ||
| status: | ||
| code: 200 | ||
| message: OK | ||
| - request: | ||
| body: null | ||
| headers: | ||
| Accept: | ||
| - '*/*' | ||
| Accept-Encoding: | ||
| - gzip, deflate | ||
| Connection: | ||
| - keep-alive | ||
| User-Agent: | ||
| - mati-python/2.0.7.dev1 | ||
| method: GET | ||
| uri: https://api.getmati.com/v2/verifications/686c77811ee936aece7016ac | ||
| response: | ||
| body: | ||
| string: '{"expired": false, "identity": {"status": "verified"}, "flow": {"id": | ||
| "some_flow", "name": "Default flow"}, "documents": [{"country": "MX", "region": | ||
| "", "type": "national-id", "photos": ["https://media.getmati.com/media/xxx", | ||
| "https://media.getmati.com/media/yyy"], "steps": [{"error": null, "status": | ||
| 200, "id": "template-matching"}, {"error": null, "status": 200, "id": "mexican-curp-validation", | ||
| "data": {"curp": "CURP", "fullName": "LAST FIRST", "birthDate": "01/01/1980", | ||
| "gender": "HOMBRE", "nationality": "MEXICO", "surname": "LAST", "secondSurname": | ||
| "", "name": "FIRST"}}, {"error": null, "status": 200, "id": "document-reading", | ||
| "data": {"fullName": {"value": "FIRST LAST", "label": "Name", "sensitive": | ||
| true}, "documentNumber": {"value": "111", "label": "Document Number"}, "dateOfBirth": | ||
| {"value": "1980-01-01", "label": "Day of Birth", "format": "date"}, "expirationDate": | ||
| {"value": "2030-12-31", "label": "Date of Expiration", "format": "date"}, | ||
| "curp": {"value": "CURP", "label": "CURP"}, "address": {"value": "Varsovia | ||
| 36, 06600 CDMX", "label": "Address"}, "emissionDate": {"value": "2010-01-01", | ||
| "label": "Emission Date", "format": "date"}}}, {"error": null, "status": 200, | ||
| "id": "alteration-detection"}, {"error": null, "status": 200, "id": "watchlists"}], | ||
| "fields": {"fullName": {"value": "FIRST LAST", "label": "Name", "sensitive": | ||
| true}, "documentNumber": {"value": "111", "label": "Document Number"}, "dateOfBirth": | ||
| {"value": "1980-01-01", "label": "Day of Birth", "format": "date"}, "expirationDate": | ||
| {"value": "2030-12-31", "label": "Date of Expiration", "format": "date"}, | ||
| "curp": {"value": "CURP", "label": "CURP"}, "address": {"value": "Varsovia | ||
| 36, 06600 CDMX", "label": "Address"}, "emissionDate": {"value": "2010-01-01", | ||
| "label": "Emission Date", "format": "date"}}}, {"country": "MX", "region": | ||
| null, "type": "proof-of-residency", "steps": [{"status": 200, "id": "document-reading", | ||
| "data": {"fullName": {"required": true, "label": "Name", "value": "FIRST NAME"}, | ||
| "address": {"label": "Address", "value": "Varsovia 36, 06600 CDMX"}, "emissionDate": | ||
| {"format": "date", "label": "Emission Date", "value": "1880-01-01"}}, "error": | ||
| null}, {"status": 200, "id": "watchlists", "error": null}], "fields": {"address": | ||
| {"value": "Varsovia 36, 06600 CDMX"}, "emissionDate": {"value": "1880-01-01"}, | ||
| "fullName": {"value": "FIRST LASTNAME"}}, "photos": ["https://media.getmati.com/file?location=xyc"]}], | ||
| "steps": [{"status": 200, "id": "liveness", "data": {"videoUrl": "https://media.getmati.com/file?location=abc", | ||
| "spriteUrl": "https://media.getmati.com/file?location=def", "selfieUrl": "https://media.getmati.com/file?location=hij"}, | ||
| "error": null}], "hasProblem": false, "computed": {"age": {"data": 100}, "isDocumentExpired": | ||
| {"data": {"national-id": false, "proof-of-residency": false}}}, "id": "5d9fb1f5bfbfac001a349bfb", | ||
| "metadata": {"name": "First Last", "dob": "1980-01-01"}}' | ||
| headers: | ||
| Connection: | ||
| - keep-alive | ||
| Content-Length: | ||
| - '7918' | ||
| Content-Type: | ||
| - application/json; charset=utf-8 | ||
| Date: | ||
| - Tue, 08 Jul 2025 23:18:57 GMT | ||
| cache-control: | ||
| - no-store, no-cache, must-revalidate, proxy-revalidate | ||
| content-security-policy: | ||
| - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' | ||
| https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src | ||
| ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' | ||
| expect-ct: | ||
| - max-age=0 | ||
| expires: | ||
| - '0' | ||
| pragma: | ||
| - no-cache | ||
| referrer-policy: | ||
| - no-referrer | ||
| strict-transport-security: | ||
| - max-age=15552000; includeSubDomains; preload | ||
| surrogate-control: | ||
| - no-store | ||
| x-content-type-options: | ||
| - nosniff | ||
| x-dns-prefetch-control: | ||
| - 'off' | ||
| x-download-options: | ||
| - noopen | ||
| x-envoy-upstream-service-time: | ||
| - '258' | ||
| x-frame-options: | ||
| - DENY | ||
| x-permitted-cross-domain-policies: | ||
| - none | ||
| x-request-id: | ||
| - 98bc4ee3-a97d-442f-bfbc-5fdd49f302a7 | ||
| x-xss-protection: | ||
| - '1' | ||
| status: | ||
| code: 200 | ||
| message: OK | ||
| version: 1 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.