Sdk 2758 python add support for requesting and retrieving share code resources tasks#462
Conversation
Sdk 2267 python update dependencies
Sdk 2267 python update dependencies
Release/2.14.2
Python library updates
* SDK-2648 updated version of protobuf * Update version to 2.14.4 * SDK-2648: Update protobuf to 4.21.12+ * Remove accidentally committed virtual environment files from Flask example * Update doc_scan example requirements for protobuf 4.21.12 and SDK v2.14.4 * Update Flask example requirements for protobuf 4.21.12 and SDK v2.14.4 * updated versions in examples * Fix GitHub Actions workflow to install local SDK before example requirements
* Python library updates * added python static liveness check (#425) * update version files
There was a problem hiding this comment.
Pull request overview
The PR's stated purpose is to add support for parsing/retrieving share code resources and VERIFY_SHARE_CODE_TASK tasks from IDV session responses. In practice this branch bundles a much larger set of changes alongside that feature: a complete protobuf regeneration with renamed packages (share_public_api → sharepubapi_v1, attribute_public_api → attrpubapi_v1, common_public_api → compubapi_v1), a Python‑version drop (only 3.9+ supported), a dependency overhaul, plus several unrelated new features (Watchlist screening check, Static Liveness, Issuing Authority sub‑check, allow_handoff/privacy_policy_url SDK config, notification auth_type, allow_non_latin_documents, is_strictly_latin, session_deadline).
Changes:
- Add
ShareCodeResourceResponse,ShareCodeMediaResponse,VerifyShareCodeTaskResponseand wire them intoResourceContainer/ResourceResponse. - Regenerate all protobufs into new package names and drop the old
*_public_apidirectories. - Add many unrelated doc‑scan features (watchlist check, static liveness, sub‑checks, SDK config and notification options) and overhaul setup/requirements.
Reviewed changes
Copilot reviewed 131 out of 133 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| yoti_python_sdk/doc_scan/session/retrieve/share_code_resource_response.py | New share-code resource model |
| yoti_python_sdk/doc_scan/session/retrieve/share_code_media_response.py | New media wrapper for share-code fields |
| yoti_python_sdk/doc_scan/session/retrieve/verify_share_code_task_response.py | New task subclass |
| yoti_python_sdk/doc_scan/session/retrieve/resource_response.py | Map VERIFY_SHARE_CODE_TASK to new class |
| yoti_python_sdk/doc_scan/session/retrieve/resource_container.py | Parse share_codes and STATIC liveness; expose properties |
| yoti_python_sdk/doc_scan/session/retrieve/static_liveness_resource_response.py, image_response.py | New static liveness resource and image wrapper |
| yoti_python_sdk/doc_scan/session/retrieve/check_response.py, get_session_result.py, create_session_result.py | New WatchlistScreening response, session_deadline |
| yoti_python_sdk/doc_scan/session/create/check/liveness.py, watchlist_screen.py, init.py | Static liveness builder and new watchlist check |
| yoti_python_sdk/doc_scan/session/create/subcheck/* | New IssuingAuthority sub-check (incomplete impl) |
| yoti_python_sdk/doc_scan/session/create/sdk_config.py, notification_config.py, session_spec.py | New config options |
| yoti_python_sdk/doc_scan/session/create/filter/orthogonal_restrictions_filter.py | allow_non_latin_documents flag |
| yoti_python_sdk/doc_scan/support/supported_documents.py | is_strictly_latin field |
| yoti_python_sdk/doc_scan/constants.py | New constants |
| yoti_python_sdk/protobuf/{sharepubapi_v1,compubapi_v1,attrpubapi_v1}/* | New regenerated protobufs |
| yoti_python_sdk/protobuf/{share_public_api,common_public_api,attribute_public_api}/* | Removed old protobufs |
| yoti_python_sdk/protobuf/protobuf.py, anchor.py, share/extra_data.py | Switched to new protobuf import paths |
| yoti_python_sdk/init.py, version.py | Version bump and simplified version loading |
| yoti_python_sdk/tests/** | New tests for added features and updated protobuf imports |
| setup.py, requirements.in, requirements.txt | Dependency and Python version overhaul |
| examples/** | Updated example dependencies, Django URL conf, new privacy page |
| .github/workflows/*.yaml | CI matrix updated; reverted pull_request_target guards |
| sonar-project.properties, README.md | Misc updates |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def to_json(self): | ||
| return remove_null_values({"type": self.type, "config": self.config}) |
| class IssuingAuthoritySubCheck(SubRequestedCheck): | ||
| """ | ||
| Requests creation of an Issuing Authority Sub Check. | ||
| """ | ||
|
|
||
| def __init__(self, filter=None): | ||
| self._filter = filter | ||
|
|
||
| @property | ||
| def requested(self): | ||
| return True | ||
|
|
||
| @property | ||
| def filter(self): | ||
| return self._filter |
| pytz>=2025.2ements | ||
| flask>=2.2.0 | ||
| python-dotenv>=0.21.0 | ||
| yoti>=2.14.0 | ||
| filetype>=1.0.7 | ||
| pyopenssl>=24.0.0 | ||
| click>=8.0 | ||
| future>=1.0.0 | ||
|
|
||
| # Required for yoti compatibility | ||
| deprecated>=1.2.14 | ||
| iso8601>=1.1.0 | ||
| pytz>=2025.2 | ||
|
|
| assert result.auth_type is "BASIC" | ||
|
|
||
| def test_build_with_bearer_auth_type(self): | ||
| result = ( | ||
| NotificationConfigBuilder() | ||
| .with_auth_token(self.SOME_AUTH_TOKEN) | ||
| .with_endpoint(self.SOME_ENDPOINT) | ||
| .with_topic(self.SOME_TOPIC) | ||
| .with_bearer_auth_type() | ||
| .build() | ||
| ) | ||
|
|
||
| assert result.auth_type is "BEARER" |
| source = data.get("source", None) | ||
| if isinstance(source, str): | ||
| self.__source = source | ||
| elif isinstance(source, dict): | ||
| self.__source = source.get("type", str(source)) | ||
| else: | ||
| self.__source = None |
| @@ -1,2 +1,2 @@ | |||
| # -*- coding: utf-8 -*- | |||
| __version__ = "2.14.1" | |||
| __version__ = "2.14.5" | |||
| from . import DataEntry_pb2 as sharepubapi__v1_dot_DataEntry__pb2 | ||
| from yoti_python_sdk.protobuf.compubapi_v1 import Metadata_pb2 as compubapi__v1_dot_Metadata__pb2 | ||
| from yoti_python_sdk.protobuf.compubapi_v1 import IdentityProfile_pb2 as compubapi__v1_dot_IdentityProfile__pb2 | ||
| from devicepubapi_v1 import StaticCredentialAuth_pb2 as devicepubapi__v1_dot_StaticCredentialAuth__pb2 |
| constants.ID_DOCUMENT_FACE_MATCH: FaceMatchCheckResponse, | ||
| constants.ID_DOCUMENT_TEXT_DATA_CHECK: TextDataCheckResponse, | ||
| constants.LIVENESS: LivenessCheckResponse, | ||
| constants.WATCHLIST_SCREENING_CHECK_TYPE: WatchlistScreeningCheckResponse, |
| :param block_biometric_consent: block the collection of biometric consent | ||
| :type block_biometric_consent: bool | ||
| :param session_deadline: session deadline using a Zoned timestamp | ||
| "type session_deadline: str |
SDK-2758: Add support for retrieving share code resources & tasks
Summary
Adds support for parsing and retrieving share code resources and verify share code tasks from IDV session responses.
Changes
New Files
share_code_resource_response.py—ShareCodeResourceResponseextendingResourceResponsewith:source(supports both string and object formats)created_at,last_updatedlookup_profile,returned_profile,id_photo,file(asShareCodeMediaResponse)verify_share_code_tasksfiltered propertyshare_code_media_response.py—ShareCodeMediaResponsewrapping aMediaResponseverify_share_code_task_response.py—VerifyShareCodeTaskResponseextendingTaskResponseModified Files
constants.py— AddedVERIFY_SHARE_CODE_TASKconstantresource_container.py— Parseshare_codesfrom session response, expose viashare_codespropertyresource_response.py— MapVERIFY_SHARE_CODE_TASKtype toVerifyShareCodeTaskResponse