Skip to content

Sdk 2758 python add support for requesting and retrieving share code resources tasks#462

Open
mehmet-yoti wants to merge 13 commits into
developmentfrom
SDK-2758-python-add-support-for-requesting-and-retrieving-share-code-resources-tasks
Open

Sdk 2758 python add support for requesting and retrieving share code resources tasks#462
mehmet-yoti wants to merge 13 commits into
developmentfrom
SDK-2758-python-add-support-for-requesting-and-retrieving-share-code-resources-tasks

Conversation

@mehmet-yoti
Copy link
Copy Markdown
Contributor

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.pyShareCodeResourceResponse extending ResourceResponse with:
    • source (supports both string and object formats)
    • created_at, last_updated
    • lookup_profile, returned_profile, id_photo, file (as ShareCodeMediaResponse)
    • verify_share_code_tasks filtered property
  • share_code_media_response.pyShareCodeMediaResponse wrapping a MediaResponse
  • verify_share_code_task_response.pyVerifyShareCodeTaskResponse extending TaskResponse

Modified Files

  • constants.py — Added VERIFY_SHARE_CODE_TASK constant
  • resource_container.py — Parse share_codes from session response, expose via share_codes property
  • resource_response.py — Map VERIFY_SHARE_CODE_TASK type to VerifyShareCodeTaskResponse

mehmet-yoti and others added 13 commits February 21, 2023 18:57
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
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_apisharepubapi_v1, attribute_public_apiattrpubapi_v1, common_public_apicompubapi_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, VerifyShareCodeTaskResponse and wire them into ResourceContainer/ResourceResponse.
  • Regenerate all protobufs into new package names and drop the old *_public_api directories.
  • 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.

Comment on lines +19 to +20
def to_json(self):
return remove_null_values({"type": self.type, "config": self.config})
Comment on lines +8 to +22
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
Comment on lines +13 to +26
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

Comment on lines +119 to +131
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"
Comment on lines +23 to +29
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants