passportDocument

Mock Jutsu HOW-TO | UK

The passport function within the mock-jutsu library is a specialised utility designed to generate realistic, high-quality mock data for developers and QA engineers. As a core component of the Document category, this tool produces generic passport numbers that mimic the structural characteristics of official international travel documents. By integrating this function into your development workflow, you can ensure that your applications handle identity-related fields with precision while maintaining the integrity of your test environments. Using synthetic identifiers instead of real-world information is a critical step in adhering to modern data privacy regulations.

Each string generated by the passport function follows a standardised alphanumeric pattern, typically represented by a leading uppercase letter followed by a sequence of seven digits, such as P1234567. While the output is generic, it is carefully crafted to align with common global formats often observed in ICAO-compliant documentation. This attention to detail allows mock-jutsu to provide test data that looks authentic during the initial stages of software validation, ensuring that regex patterns and validation logic behave as expected without the legal or ethical risks associated with using actual sensitive information.

In terms of practical application, the passport function is indispensable for testing travel booking engines, border control simulations, and Know Your Customer (KYC) verification pipelines. Developers can use it to validate input masks, database constraints, and UI components that require specific character lengths and formats. Whether you are performing load testing in JMeter using the ${__mockjutsu(passport,)} syntax or populating a local database via the Python API with jutsu.generate('passport'), the library ensures your test suites are robust and reliable across various edge cases.

One of the primary benefits of using mock-jutsu for generating passport mock data is its versatility across different platforms. The command-line interface allows for rapid generation through the mockjutsu generate passport command, making it ideal for shell scripts and automated CI/CD pipelines. By automating the creation of document-based test data, teams can significantly reduce the manual overhead of data preparation. Ultimately, this function empowers developers to build more secure and resilient systems by providing a consistent source of synthetic data that adheres to expected document standards.

CLI Usage
mockjutsu generate passportmockjutsu bulk passport --count 10mockjutsu export passport --count 10 --format jsonmockjutsu export passport --count 10 --format csvmockjutsu export passport --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate passport --maskmockjutsu bulk passport --count 5 --mask
Python API
from mockjutsu import jutsujutsu.generate('passport')jutsu.bulk('passport', count=10)jutsu.template(['passport'], count=5)# mask=True: regulation-compliant outputjutsu.generate('passport', mask=True)jutsu.bulk('passport', count=5, mask=True)
JMeter
${__mockjutsu_identity(passport)}# JMeter Function: __mockjutsu_identity# Parameter 1: passport# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_identity(passport,mask)}
REST API
GET /generate/passport# → {"type":"passport","result":"...","status":"ok"}GET /bulk/passport?count=10POST /template {"types":["passport"],"count":1}# mask=true: regulation-compliant outputGET /generate/passport?mask=trueGET /bulk/passport?count=5&mask=true

Parameters

Parameter Values Description
--mask true | false Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…)

Other Languages