Pyattest is a Python library that provides a common interface for verifying mobile app attestations from both Google and Apple. It offers a standalone solution, but for full Django integration, including key generation and storage, the companion `django-dreiattest` package is recommended. The library is currently at version 1.0.4 and has an infrequent release cadence, with updates typically including security fixes and dependency updates.
pip install pyattestVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to verify a Google Play Integrity API attestation using `pyattest`. It shows the setup of `GooglePlayIntegrityApiConfig` with necessary keys and package name, followed by creating an `Attestation` object and calling its `verify()` method. Ensure to replace placeholder keys and mock data with actual values from your application and secure environment variables.
Install `django-dreiattest` (if using Django) in addition to `pyattest` and follow its documentation for Django-specific setup: `pip install django-dreiattest`.
Review your `GooglePlayIntegrityApiConfig` settings. For production, prioritize `production=True` and `allow_non_play_distribution=False`. If `allow_non_play_distribution=True` is required, always provide `verify_code_signature_hex`. For development, use `production=False`.
Always ensure the attestation has been successfully verified, typically by checking the boolean return value of `attestation.verify()`, before proceeding to process or rely on the attestation's data.