SDK-2473: Python - IDV Support Brand ID in session config - python#458
Conversation
|
🤖 Claude Code ReviewCode Review FindingsSummary: The change threads a new optional CriticalNone. MajorNone. Minor
Nit
What's Done Well
OverallApproved with Comments — correct, narrow, backwards-compatible. Address |
There was a problem hiding this comment.
Pull request overview
Adds optional brand_id support to the Doc Scan IDV SdkConfig so consumers can theme the IDV iframe via a brand identifier, including builder support and JSON serialization that omits the field when unset.
Changes:
- Added
brand_idtoSdkConfig(constructor arg + property) and included it into_json()viaremove_null_values. - Added
SdkConfigBuilder.with_brand_id(...)and threaded the value throughbuild(). - Extended/added unit tests to cover builder defaults and JSON inclusion/omission for
brand_id.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
yoti_python_sdk/doc_scan/session/create/sdk_config.py |
Adds brand_id to the config model, builder, and JSON serialization. |
yoti_python_sdk/tests/doc_scan/session/create/test_sdk_config.py |
Adds tests validating brand_id behavior and serialization. |
.claude/settings.local.json |
Introduces local Claude tooling settings file into the repo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| assert result.success_url is self.SOME_SUCCESS_URL | ||
| assert result.error_url is self.SOME_ERROR_URL | ||
| assert result.privacy_policy_url is self.SOME_PRIVACY_POLICY_URL | ||
| assert result.allow_handoff is True | ||
| assert result.brand_id is self.SOME_BRAND_ID |
| :type privacy_policy_url: str | ||
| :param allow_handoff: boolean flag for allow_handoff | ||
| :type allow_handoff: bool | ||
| :param brand_id: the brand id used to theme the IDV iframe | ||
| :type brand_id: str |
| "allow": [ | ||
| "Bash(git checkout *)", | ||
| "Bash(git pull *)", | ||
| "Bash(git ls-tree *)", | ||
| "Bash(awk '{print $4}')" | ||
| ] |



Summary
Adds support for setting a
brand_idon the IDVSdkConfig, enabling consumers to theme the IDV iframe via a brand identifier. This adds a new builder method (with_brand_id), a property accessor, and serialization support that omits the field when unset.Changes
yoti_python_sdk/doc_scan/session/create/sdk_config.pybrand_idparameter toSdkConfig.__init__(defaults toNone).brand_idproperty exposing the value.brand_idinto_json()(filtered out byremove_null_valueswhen not set).SdkConfigBuilder.with_brand_id(brand_id)fluent setter and threaded the value throughbuild().yoti_python_sdk/tests/doc_scan/session/create/test_sdk_config.pybrand_id.None), setting via builder, JSON inclusion when set, JSON omission when not set, and JSON omission when explicitly set toNone.QA Test Steps
pip install -e .and any test requirements).test_should_build_correctly(includesbrand_idassertion)test_not_passing_brand_idtest_with_brand_idtest_brand_id_in_json_when_settest_brand_id_absent_from_json_when_not_settest_brand_id_absent_from_json_when_nonebrand_idshould not appear in the serialised payload:Noneshould also be omitted from the payload:SdkConfigusing the existing builder chain (withoutwith_brand_id) and confirm all previously supported fields (allowed_capture_methods,primary_colour,success_url,error_url,privacy_policy_url,allow_handoff, etc.) serialize and read back unchanged.DocScanClientusing anSdkConfigbuilt with a valid brand id and confirm the API accepts the request and the iframe reflects the brand theming.Notes
brand_idis optional and defaults toNone; it is stripped from the JSON payload byremove_null_valueswhen unset, preserving the existing wire format for callers that don't use the new field — fully backwards compatible.brand_idstring (consistent with how other identifier fields likepreset_issuing_countryare handled); validation is delegated to the IDV backend..claude/settings.local.json(local Claude Code tooling settings) — this is not part of the SDK behavior change and can be ignored / dropped before merge if the team prefers not to ship local tool config in the repo.Related Jira: SDK-2473
Auto-generated by n8n + Claude CLI