portfolio_id_maskedCapMarkets(Trading)

Mock Jutsu HOW-TO | UK

The portfolio_id_masked function is a specialised utility within the mock-jutsu library, designed to generate realistic yet secure identifiers for Capital Markets and Trading applications. As financial institutions move towards more rigorous data privacy standards, the need for high-quality mock data that mirrors production environments without exposing sensitive information has become paramount. This function specifically addresses the requirement for internal portfolio references that maintain partial visibility for operational tracking while ensuring the core identifier remains protected from unauthorised exposure.

Technically, the portfolio_id_masked generator follows a pattern common in regulatory reporting, particularly concerning MiFID II Article 25 requirements for internal transaction records. By default, the algorithm produces a string where the initial segments are obfuscated, leaving only the final four alphanumeric characters of the suffix visible, such as in the format PRTF-****B2C3. This specific masking logic ensures that developers can test data reconciliation processes and UI components that require partial ID recognition without compromising the integrity of the test data. It bridges the gap between raw, unreadable hashes and fully exposed internal codes, providing a balanced approach to data sanitisation.

For developers and QA engineers, using mock-jutsu to generate these identifiers provides significant advantages during the software development lifecycle. The function is particularly useful in testing scenarios involving trade reporting systems, portfolio management dashboards, and audit log visualisations. By utilising portfolio_id_masked, teams can verify that their front-end masking logic works correctly and that downstream systems handle partially redacted strings without failure. This proactive approach to data security helps organisations remain compliant with international financial regulations during the testing phase, preventing the accidental leakage of PII or sensitive internal metadata.

Integrating this function into existing workflows is seamless, whether through the Python API, the command-line interface, or JMeter for performance testing. The ability to generate consistent, structured mock data allows for more robust automated testing suites and reduces the manual overhead of creating anonymised datasets. Ultimately, the portfolio_id_masked function empowers engineering teams to build more secure, compliant financial software by providing reliable, context-aware test data that satisfies both rigorous technical requirements and complex regulatory mandates.

CLI Usage
mockjutsu generate portfolio_id_maskedmockjutsu bulk portfolio_id_masked --count 10mockjutsu export portfolio_id_masked --count 10 --format jsonmockjutsu export portfolio_id_masked --count 10 --format csvmockjutsu export portfolio_id_masked --count 10 --format sql
Python API
from mockjutsu import jutsujutsu.generate('portfolio_id_masked')jutsu.bulk('portfolio_id_masked', count=10)jutsu.template(['portfolio_id_masked'], count=5)
JMeter
${__mockjutsu_markets(portfolio_id_masked)}# JMeter Function: __mockjutsu_markets# Parameter 1: portfolio_id_masked# Parameter 2: (not required for this function)
REST API
GET /generate/portfolio_id_masked# → {"type":"portfolio_id_masked","result":"...","status":"ok"}GET /bulk/portfolio_id_masked?count=10POST /template {"types":["portfolio_id_masked"],"count":1}

Other Languages