fingerprint-pro-server-api-sdk 3.0.0__tar.gz → 4.1.0.dev1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/PKG-INFO +38 -9
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/README.md +37 -3
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/api/fingerprint_api.py +2 -2
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/api_client.py +1 -1
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/configuration.py +1 -1
- fingerprint-pro-server-api-sdk-4.1.0.dev1/fingerprint_pro_server_api_sdk/sealed.py +86 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk.egg-info/PKG-INFO +38 -9
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk.egg-info/SOURCES.txt +3 -1
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/setup.cfg +1 -1
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/setup.py +0 -5
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/test/test_fingerprint_api.py +1 -1
- fingerprint-pro-server-api-sdk-4.1.0.dev1/test/test_sealed.py +108 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/LICENSE +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/__init__.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/api/__init__.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/dummy_pool.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/extend_exception.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/__init__.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/asn.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/botd_detection_result.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/botd_result.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/browser_details.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/confidence.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/data_center.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/error_event403_response.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/error_event403_response_error.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/error_event404_response.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/error_event404_response_error.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/error_visits403.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/event_response.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/high_activity_result.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/identification_error.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/ip_block_list_result.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/ip_block_list_result_details.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/ip_info_result.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/ip_info_result_v4.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/ip_info_result_v6.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/ip_location.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/ip_location_city.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/location.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/location_spoofing_result.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/many_requests_response.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/product_error.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/products_response.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/products_response_botd.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/products_response_identification.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/products_response_identification_data.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/raw_device_attributes_result.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/response.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/response_visits.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/seen_at.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_cloned_app.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_cloned_app_data.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_emulator.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_emulator_data.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_factory_reset.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_factory_reset_data.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_frida.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_frida_data.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_high_activity.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_incognito.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_incognito_data.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_ip_blocklist.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_ip_info.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_jailbroken.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_jailbroken_data.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_location_spoofing.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_privacy_settings.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_privacy_settings_data.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_proxy.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_proxy_data.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_raw_device_attributes.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_root_apps.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_root_apps_data.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_tampering.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_tor.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_tor_data.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_virtual_machine.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_virtual_machine_data.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/signal_response_vpn.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/subdivision.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/tampering_result.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/visit.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/vpn_result.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/vpn_result_methods.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/webhook_signal_response_cloned_app.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/webhook_signal_response_emulator.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/webhook_signal_response_factory_reset.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/webhook_signal_response_frida.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/webhook_signal_response_jailbroken.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/webhook_signal_response_privacy_settings.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/webhook_signal_response_proxy.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/webhook_signal_response_root_apps.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/webhook_signal_response_tor.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/webhook_signal_response_virtual_machine.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/models/webhook_visit.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk/rest.py +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk.egg-info/dependency_links.txt +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk.egg-info/requires.txt +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/fingerprint_pro_server_api_sdk.egg-info/top_level.txt +0 -0
- {fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/test/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fingerprint-pro-server-api-sdk
|
|
3
|
-
Version:
|
|
3
|
+
Version: 4.1.0.dev1
|
|
4
4
|
Summary: Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device.
|
|
5
5
|
Home-page: https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk
|
|
6
6
|
Author: Fingerprint
|
|
@@ -11,12 +11,7 @@ Platform: UNKNOWN
|
|
|
11
11
|
Classifier: Development Status :: 5 - Production/Stable
|
|
12
12
|
Classifier: Intended Audience :: Developers
|
|
13
13
|
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
-
Classifier: Programming Language :: Python :: 2
|
|
15
14
|
Classifier: Programming Language :: Python
|
|
16
|
-
Classifier: Programming Language :: Python :: 2.7
|
|
17
|
-
Classifier: Programming Language :: Python :: 3
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.4
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.5
|
|
20
15
|
Classifier: Programming Language :: Python :: 3.6
|
|
21
16
|
Classifier: Programming Language :: Python :: 3.7
|
|
22
17
|
Classifier: Programming Language :: Python :: 3.8
|
|
@@ -65,15 +60,14 @@ The Fingerprint Server Python SDK is an easy way to interact with the Fingerprin
|
|
|
65
60
|
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
|
66
61
|
|
|
67
62
|
- API version: 3
|
|
68
|
-
- Package version:
|
|
63
|
+
- Package version: 4.1.0.dev1
|
|
69
64
|
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
|
|
70
65
|
|
|
71
66
|
## Requirements
|
|
72
67
|
|
|
73
68
|
The following Python versions are supported:
|
|
74
69
|
|
|
75
|
-
- Python
|
|
76
|
-
- Python 3.4+
|
|
70
|
+
- Python >= 3.6
|
|
77
71
|
|
|
78
72
|
## Installation & Usage
|
|
79
73
|
### pip install
|
|
@@ -172,6 +166,36 @@ except ApiException as e:
|
|
|
172
166
|
print("Exception when calling DefaultApi->get_event: %s\n" % e)
|
|
173
167
|
```
|
|
174
168
|
|
|
169
|
+
## Sealed results
|
|
170
|
+
|
|
171
|
+
This SDK provides utility methods for decoding [sealed results](https://dev.fingerprint.com/docs/sealed-client-results).
|
|
172
|
+
```python
|
|
173
|
+
import base64
|
|
174
|
+
import os
|
|
175
|
+
|
|
176
|
+
from dotenv import load_dotenv
|
|
177
|
+
|
|
178
|
+
from fingerprint_pro_server_api_sdk import EventResponse
|
|
179
|
+
from fingerprint_pro_server_api_sdk.sealed import unseal_events_response, DecryptionKey, DecryptionAlgorithm
|
|
180
|
+
|
|
181
|
+
load_dotenv()
|
|
182
|
+
|
|
183
|
+
sealed_result = base64.b64decode(os.environ["BASE64_SEALED_RESULT"])
|
|
184
|
+
key = base64.b64decode(os.environ["BASE64_KEY"])
|
|
185
|
+
|
|
186
|
+
try:
|
|
187
|
+
events_response: EventResponse = unseal_events_response(sealed_result, [DecryptionKey(key, DecryptionAlgorithm['Aes256Gcm'])])
|
|
188
|
+
print("\n\n\nEvent response: \n", events_response.products)
|
|
189
|
+
except Exception as e:
|
|
190
|
+
print("Exception when calling unsealing events response: %s\n" % e)
|
|
191
|
+
exit(1)
|
|
192
|
+
|
|
193
|
+
print("Unseal successful!")
|
|
194
|
+
|
|
195
|
+
exit(0)
|
|
196
|
+
```
|
|
197
|
+
To learn more, refer to example located in [sealed_results_example.py](sealed_results_example.py).
|
|
198
|
+
|
|
175
199
|
## Documentation for API Endpoints
|
|
176
200
|
|
|
177
201
|
All URIs are relative to *https://api.fpjs.io*
|
|
@@ -278,6 +302,11 @@ Class | Method | HTTP request | Description
|
|
|
278
302
|
- **Location**: URL query string
|
|
279
303
|
|
|
280
304
|
|
|
305
|
+
## Documentation for sealed results
|
|
306
|
+
|
|
307
|
+
- [SealedResults](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/blob/main/docs/SealedResults.md)
|
|
308
|
+
- [DecryptionKey](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/blob/main/docs/DecryptionKey.md)
|
|
309
|
+
|
|
281
310
|
## Support
|
|
282
311
|
|
|
283
312
|
To report problems, ask questions or provide feedback, please use [Issues](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/issues).
|
{fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/README.md
RENAMED
|
@@ -40,15 +40,14 @@ The Fingerprint Server Python SDK is an easy way to interact with the Fingerprin
|
|
|
40
40
|
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
|
41
41
|
|
|
42
42
|
- API version: 3
|
|
43
|
-
- Package version:
|
|
43
|
+
- Package version: 4.1.0.dev1
|
|
44
44
|
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
|
|
45
45
|
|
|
46
46
|
## Requirements
|
|
47
47
|
|
|
48
48
|
The following Python versions are supported:
|
|
49
49
|
|
|
50
|
-
- Python
|
|
51
|
-
- Python 3.4+
|
|
50
|
+
- Python >= 3.6
|
|
52
51
|
|
|
53
52
|
## Installation & Usage
|
|
54
53
|
### pip install
|
|
@@ -147,6 +146,36 @@ except ApiException as e:
|
|
|
147
146
|
print("Exception when calling DefaultApi->get_event: %s\n" % e)
|
|
148
147
|
```
|
|
149
148
|
|
|
149
|
+
## Sealed results
|
|
150
|
+
|
|
151
|
+
This SDK provides utility methods for decoding [sealed results](https://dev.fingerprint.com/docs/sealed-client-results).
|
|
152
|
+
```python
|
|
153
|
+
import base64
|
|
154
|
+
import os
|
|
155
|
+
|
|
156
|
+
from dotenv import load_dotenv
|
|
157
|
+
|
|
158
|
+
from fingerprint_pro_server_api_sdk import EventResponse
|
|
159
|
+
from fingerprint_pro_server_api_sdk.sealed import unseal_events_response, DecryptionKey, DecryptionAlgorithm
|
|
160
|
+
|
|
161
|
+
load_dotenv()
|
|
162
|
+
|
|
163
|
+
sealed_result = base64.b64decode(os.environ["BASE64_SEALED_RESULT"])
|
|
164
|
+
key = base64.b64decode(os.environ["BASE64_KEY"])
|
|
165
|
+
|
|
166
|
+
try:
|
|
167
|
+
events_response: EventResponse = unseal_events_response(sealed_result, [DecryptionKey(key, DecryptionAlgorithm['Aes256Gcm'])])
|
|
168
|
+
print("\n\n\nEvent response: \n", events_response.products)
|
|
169
|
+
except Exception as e:
|
|
170
|
+
print("Exception when calling unsealing events response: %s\n" % e)
|
|
171
|
+
exit(1)
|
|
172
|
+
|
|
173
|
+
print("Unseal successful!")
|
|
174
|
+
|
|
175
|
+
exit(0)
|
|
176
|
+
```
|
|
177
|
+
To learn more, refer to example located in [sealed_results_example.py](sealed_results_example.py).
|
|
178
|
+
|
|
150
179
|
## Documentation for API Endpoints
|
|
151
180
|
|
|
152
181
|
All URIs are relative to *https://api.fpjs.io*
|
|
@@ -253,6 +282,11 @@ Class | Method | HTTP request | Description
|
|
|
253
282
|
- **Location**: URL query string
|
|
254
283
|
|
|
255
284
|
|
|
285
|
+
## Documentation for sealed results
|
|
286
|
+
|
|
287
|
+
- [SealedResults](docs/SealedResults.md)
|
|
288
|
+
- [DecryptionKey](docs/DecryptionKey.md)
|
|
289
|
+
|
|
256
290
|
## Support
|
|
257
291
|
|
|
258
292
|
To report problems, ask questions or provide feedback, please use [Issues](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/issues).
|
|
@@ -99,7 +99,7 @@ class FingerprintApi(object):
|
|
|
99
99
|
path_params['request_id'] = params['request_id'] # noqa: E501
|
|
100
100
|
|
|
101
101
|
query_params = []
|
|
102
|
-
query_params.append(('ii', 'fingerprint-pro-server-python-sdk/
|
|
102
|
+
query_params.append(('ii', 'fingerprint-pro-server-python-sdk/4.1.0.dev1'))
|
|
103
103
|
|
|
104
104
|
header_params = {}
|
|
105
105
|
|
|
@@ -214,7 +214,7 @@ class FingerprintApi(object):
|
|
|
214
214
|
path_params['visitor_id'] = params['visitor_id'] # noqa: E501
|
|
215
215
|
|
|
216
216
|
query_params = []
|
|
217
|
-
query_params.append(('ii', 'fingerprint-pro-server-python-sdk/
|
|
217
|
+
query_params.append(('ii', 'fingerprint-pro-server-python-sdk/4.1.0.dev1'))
|
|
218
218
|
if 'request_id' in params:
|
|
219
219
|
query_params.append(('request_id', params['request_id'])) # noqa: E501
|
|
220
220
|
if 'linked_id' in params:
|
|
@@ -79,7 +79,7 @@ class ApiClient(object):
|
|
|
79
79
|
self.default_headers[header_name] = header_value
|
|
80
80
|
self.cookie = cookie
|
|
81
81
|
# Set default User-Agent.
|
|
82
|
-
self.user_agent = 'Swagger-Codegen/
|
|
82
|
+
self.user_agent = 'Swagger-Codegen/4.1.0.dev1/python'
|
|
83
83
|
|
|
84
84
|
def __del__(self):
|
|
85
85
|
self.pool.close()
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
|
|
3
|
+
from cryptography.hazmat.backends import default_backend
|
|
4
|
+
import zlib
|
|
5
|
+
|
|
6
|
+
from fingerprint_pro_server_api_sdk.models.event_response import EventResponse
|
|
7
|
+
|
|
8
|
+
SEALED_HEADER = bytes([0x9e, 0x85, 0xdc, 0xed])
|
|
9
|
+
DecryptionAlgorithm = {
|
|
10
|
+
'Aes256Gcm': 'aes-256-gcm',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class DecryptionKey:
|
|
15
|
+
def __init__(self, key, algorithm):
|
|
16
|
+
self.key = key
|
|
17
|
+
self.algorithm = algorithm
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class UnsealError(Exception):
|
|
21
|
+
exception: Exception
|
|
22
|
+
key: DecryptionKey
|
|
23
|
+
|
|
24
|
+
def __init__(self, exception, key):
|
|
25
|
+
self.exception = exception
|
|
26
|
+
self.key = key
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class UnsealAggregateError(Exception):
|
|
30
|
+
def __init__(self, errors):
|
|
31
|
+
self.errors = errors
|
|
32
|
+
super().__init__("Unable to decrypt sealed data")
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def parse_events_response(unsealed):
|
|
36
|
+
json_data = json.loads(unsealed)
|
|
37
|
+
|
|
38
|
+
if 'products' not in json_data:
|
|
39
|
+
raise ValueError('Sealed data is not valid events response')
|
|
40
|
+
|
|
41
|
+
return EventResponse(json_data['products'])
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def unseal_events_response(sealed_data, decryption_keys):
|
|
45
|
+
unsealed = unseal(sealed_data, decryption_keys)
|
|
46
|
+
return parse_events_response(unsealed)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def unseal(sealed_data, decryption_keys):
|
|
50
|
+
if sealed_data[:len(SEALED_HEADER)].hex() != SEALED_HEADER.hex():
|
|
51
|
+
raise ValueError('Invalid sealed data header')
|
|
52
|
+
|
|
53
|
+
errors = []
|
|
54
|
+
for decryption_key in decryption_keys:
|
|
55
|
+
if decryption_key.algorithm == DecryptionAlgorithm['Aes256Gcm']:
|
|
56
|
+
try:
|
|
57
|
+
return unseal_aes256gcm(sealed_data, decryption_key.key)
|
|
58
|
+
except Exception as e:
|
|
59
|
+
errors.append(UnsealError(e, decryption_key))
|
|
60
|
+
continue
|
|
61
|
+
else:
|
|
62
|
+
raise ValueError(f"Unsupported decryption algorithm: {decryption_key.algorithm}")
|
|
63
|
+
|
|
64
|
+
raise UnsealAggregateError(errors)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def unseal_aes256gcm(sealed_data, decryption_key):
|
|
68
|
+
nonce_length = 12
|
|
69
|
+
nonce = sealed_data[len(SEALED_HEADER):len(SEALED_HEADER) + nonce_length]
|
|
70
|
+
|
|
71
|
+
auth_tag_length = 16
|
|
72
|
+
auth_tag = sealed_data[-auth_tag_length:]
|
|
73
|
+
|
|
74
|
+
ciphertext = sealed_data[len(SEALED_HEADER) + nonce_length:-auth_tag_length]
|
|
75
|
+
|
|
76
|
+
decipher = Cipher(
|
|
77
|
+
algorithms.AES(decryption_key),
|
|
78
|
+
modes.GCM(nonce, auth_tag),
|
|
79
|
+
backend=default_backend()
|
|
80
|
+
).decryptor()
|
|
81
|
+
|
|
82
|
+
compressed = decipher.update(ciphertext) + decipher.finalize()
|
|
83
|
+
|
|
84
|
+
payload = zlib.decompress(compressed, -zlib.MAX_WBITS)
|
|
85
|
+
|
|
86
|
+
return payload.decode('utf-8')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fingerprint-pro-server-api-sdk
|
|
3
|
-
Version:
|
|
3
|
+
Version: 4.1.0.dev1
|
|
4
4
|
Summary: Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device.
|
|
5
5
|
Home-page: https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk
|
|
6
6
|
Author: Fingerprint
|
|
@@ -11,12 +11,7 @@ Platform: UNKNOWN
|
|
|
11
11
|
Classifier: Development Status :: 5 - Production/Stable
|
|
12
12
|
Classifier: Intended Audience :: Developers
|
|
13
13
|
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
-
Classifier: Programming Language :: Python :: 2
|
|
15
14
|
Classifier: Programming Language :: Python
|
|
16
|
-
Classifier: Programming Language :: Python :: 2.7
|
|
17
|
-
Classifier: Programming Language :: Python :: 3
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.4
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.5
|
|
20
15
|
Classifier: Programming Language :: Python :: 3.6
|
|
21
16
|
Classifier: Programming Language :: Python :: 3.7
|
|
22
17
|
Classifier: Programming Language :: Python :: 3.8
|
|
@@ -65,15 +60,14 @@ The Fingerprint Server Python SDK is an easy way to interact with the Fingerprin
|
|
|
65
60
|
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
|
66
61
|
|
|
67
62
|
- API version: 3
|
|
68
|
-
- Package version:
|
|
63
|
+
- Package version: 4.1.0.dev1
|
|
69
64
|
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
|
|
70
65
|
|
|
71
66
|
## Requirements
|
|
72
67
|
|
|
73
68
|
The following Python versions are supported:
|
|
74
69
|
|
|
75
|
-
- Python
|
|
76
|
-
- Python 3.4+
|
|
70
|
+
- Python >= 3.6
|
|
77
71
|
|
|
78
72
|
## Installation & Usage
|
|
79
73
|
### pip install
|
|
@@ -172,6 +166,36 @@ except ApiException as e:
|
|
|
172
166
|
print("Exception when calling DefaultApi->get_event: %s\n" % e)
|
|
173
167
|
```
|
|
174
168
|
|
|
169
|
+
## Sealed results
|
|
170
|
+
|
|
171
|
+
This SDK provides utility methods for decoding [sealed results](https://dev.fingerprint.com/docs/sealed-client-results).
|
|
172
|
+
```python
|
|
173
|
+
import base64
|
|
174
|
+
import os
|
|
175
|
+
|
|
176
|
+
from dotenv import load_dotenv
|
|
177
|
+
|
|
178
|
+
from fingerprint_pro_server_api_sdk import EventResponse
|
|
179
|
+
from fingerprint_pro_server_api_sdk.sealed import unseal_events_response, DecryptionKey, DecryptionAlgorithm
|
|
180
|
+
|
|
181
|
+
load_dotenv()
|
|
182
|
+
|
|
183
|
+
sealed_result = base64.b64decode(os.environ["BASE64_SEALED_RESULT"])
|
|
184
|
+
key = base64.b64decode(os.environ["BASE64_KEY"])
|
|
185
|
+
|
|
186
|
+
try:
|
|
187
|
+
events_response: EventResponse = unseal_events_response(sealed_result, [DecryptionKey(key, DecryptionAlgorithm['Aes256Gcm'])])
|
|
188
|
+
print("\n\n\nEvent response: \n", events_response.products)
|
|
189
|
+
except Exception as e:
|
|
190
|
+
print("Exception when calling unsealing events response: %s\n" % e)
|
|
191
|
+
exit(1)
|
|
192
|
+
|
|
193
|
+
print("Unseal successful!")
|
|
194
|
+
|
|
195
|
+
exit(0)
|
|
196
|
+
```
|
|
197
|
+
To learn more, refer to example located in [sealed_results_example.py](sealed_results_example.py).
|
|
198
|
+
|
|
175
199
|
## Documentation for API Endpoints
|
|
176
200
|
|
|
177
201
|
All URIs are relative to *https://api.fpjs.io*
|
|
@@ -278,6 +302,11 @@ Class | Method | HTTP request | Description
|
|
|
278
302
|
- **Location**: URL query string
|
|
279
303
|
|
|
280
304
|
|
|
305
|
+
## Documentation for sealed results
|
|
306
|
+
|
|
307
|
+
- [SealedResults](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/blob/main/docs/SealedResults.md)
|
|
308
|
+
- [DecryptionKey](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/blob/main/docs/DecryptionKey.md)
|
|
309
|
+
|
|
281
310
|
## Support
|
|
282
311
|
|
|
283
312
|
To report problems, ask questions or provide feedback, please use [Issues](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/issues).
|
|
@@ -8,6 +8,7 @@ fingerprint_pro_server_api_sdk/configuration.py
|
|
|
8
8
|
fingerprint_pro_server_api_sdk/dummy_pool.py
|
|
9
9
|
fingerprint_pro_server_api_sdk/extend_exception.py
|
|
10
10
|
fingerprint_pro_server_api_sdk/rest.py
|
|
11
|
+
fingerprint_pro_server_api_sdk/sealed.py
|
|
11
12
|
fingerprint_pro_server_api_sdk.egg-info/PKG-INFO
|
|
12
13
|
fingerprint_pro_server_api_sdk.egg-info/SOURCES.txt
|
|
13
14
|
fingerprint_pro_server_api_sdk.egg-info/dependency_links.txt
|
|
@@ -95,4 +96,5 @@ fingerprint_pro_server_api_sdk/models/webhook_signal_response_tor.py
|
|
|
95
96
|
fingerprint_pro_server_api_sdk/models/webhook_signal_response_virtual_machine.py
|
|
96
97
|
fingerprint_pro_server_api_sdk/models/webhook_visit.py
|
|
97
98
|
test/__init__.py
|
|
98
|
-
test/test_fingerprint_api.py
|
|
99
|
+
test/test_fingerprint_api.py
|
|
100
|
+
test/test_sealed.py
|
|
@@ -56,12 +56,7 @@ setup(
|
|
|
56
56
|
'Development Status :: 5 - Production/Stable',
|
|
57
57
|
'Intended Audience :: Developers',
|
|
58
58
|
'License :: OSI Approved :: MIT License',
|
|
59
|
-
'Programming Language :: Python :: 2',
|
|
60
59
|
'Programming Language :: Python',
|
|
61
|
-
'Programming Language :: Python :: 2.7',
|
|
62
|
-
'Programming Language :: Python :: 3',
|
|
63
|
-
'Programming Language :: Python :: 3.4',
|
|
64
|
-
'Programming Language :: Python :: 3.5',
|
|
65
60
|
'Programming Language :: Python :: 3.6',
|
|
66
61
|
'Programming Language :: Python :: 3.7',
|
|
67
62
|
'Programming Language :: Python :: 3.8',
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import base64
|
|
2
|
+
import io
|
|
3
|
+
import json
|
|
4
|
+
import unittest
|
|
5
|
+
|
|
6
|
+
from fingerprint_pro_server_api_sdk import EventResponse
|
|
7
|
+
from fingerprint_pro_server_api_sdk.sealed import DecryptionAlgorithm, DecryptionKey, unseal_events_response, \
|
|
8
|
+
UnsealError, UnsealAggregateError
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class TestSealed(unittest.TestCase):
|
|
12
|
+
valid_key = base64.b64decode('p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53=')
|
|
13
|
+
invalid_key = base64.b64decode('a2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53=')
|
|
14
|
+
|
|
15
|
+
def test_unseal_aes256gcm(self):
|
|
16
|
+
with io.open("./test/mocks/sealed_result.json", 'r', encoding='utf-8') as f:
|
|
17
|
+
expected_result = EventResponse(json.load(f)['products'])
|
|
18
|
+
|
|
19
|
+
sealed_data = base64.b64decode(
|
|
20
|
+
'noXc7SXO+mqeAGrvBMgObi/S0fXTpP3zupk8qFqsO/1zdtWCD169iLA3VkkZh9ICHpZ0oWRzqG0M9/TnCeKFohgBLqDp6O0zEfXOv6i5q++aucItznQdLwrKLP+O0blfb4dWVI8/aSbd4ELAZuJJxj9bCoVZ1vk+ShbUXCRZTD30OIEAr3eiG9aw00y1UZIqMgX6CkFlU9L9OnKLsNsyomPIaRHTmgVTI5kNhrnVNyNsnzt9rY7fUD52DQxJILVPrUJ1Q+qW7VyNslzGYBPG0DyYlKbRAomKJDQIkdj/Uwa6bhSTq4XYNVvbk5AJ/dGwvsVdOnkMT2Ipd67KwbKfw5bqQj/cw6bj8Cp2FD4Dy4Ud4daBpPRsCyxBM2jOjVz1B/lAyrOp8BweXOXYugwdPyEn38MBZ5oL4D38jIwR/QiVnMHpERh93jtgwh9Abza6i4/zZaDAbPhtZLXSM5ztdctv8bAb63CppLU541Kf4OaLO3QLvfLRXK2n8bwEwzVAqQ22dyzt6/vPiRbZ5akh8JB6QFXG0QJF9DejsIspKF3JvOKjG2edmC9o+GfL3hwDBiihYXCGY9lElZICAdt+7rZm5UxMx7STrVKy81xcvfaIp1BwGh/HyMsJnkE8IczzRFpLlHGYuNDxdLoBjiifrmHvOCUDcV8UvhSV+UAZtAVejdNGo5G/bz0NF21HUO4pVRPu6RqZIs/aX4hlm6iO/0Ru00ct8pfadUIgRcephTuFC2fHyZxNBC6NApRtLSNLfzYTTo/uSjgcu6rLWiNo5G7yfrM45RXjalFEFzk75Z/fu9lCJJa5uLFgDNKlU+IaFjArfXJCll3apbZp4/LNKiU35ZlB7ZmjDTrji1wLep8iRVVEGht/DW00MTok7Zn7Fv+MlxgWmbZB3BuezwTmXb/fNw==')
|
|
21
|
+
|
|
22
|
+
result = unseal_events_response(sealed_data, [
|
|
23
|
+
DecryptionKey(self.invalid_key, DecryptionAlgorithm['Aes256Gcm']),
|
|
24
|
+
DecryptionKey(self.valid_key, DecryptionAlgorithm['Aes256Gcm']),
|
|
25
|
+
])
|
|
26
|
+
|
|
27
|
+
self.assertEqual(result, expected_result)
|
|
28
|
+
|
|
29
|
+
def test_unseal_invalid_header(self):
|
|
30
|
+
sealed_data = base64.b64decode(
|
|
31
|
+
'xzXc7SXO+mqeAGrvBMgObi/S0fXTpP3zupk8qFqsO/1zdtWCD169iLA3VkkZh9ICHpZ0oWRzqG0M9/TnCeKFohgBLqDp6O0zEfXOv6i5q++aucItznQdLwrKLP+O0blfb4dWVI8/aSbd4ELAZuJJxj9bCoVZ1vk+ShbUXCRZTD30OIEAr3eiG9aw00y1UZIqMgX6CkFlU9L9OnKLsNsyomPIaRHTmgVTI5kNhrnVNyNsnzt9rY7fUD52DQxJILVPrUJ1Q+qW7VyNslzGYBPG0DyYlKbRAomKJDQIkdj/Uwa6bhSTq4XYNVvbk5AJ/dGwvsVdOnkMT2Ipd67KwbKfw5bqQj/cw6bj8Cp2FD4Dy4Ud4daBpPRsCyxBM2jOjVz1B/lAyrOp8BweXOXYugwdPyEn38MBZ5oL4D38jIwR/QiVnMHpERh93jtgwh9Abza6i4/zZaDAbPhtZLXSM5ztdctv8bAb63CppLU541Kf4OaLO3QLvfLRXK2n8bwEwzVAqQ22dyzt6/vPiRbZ5akh8JB6QFXG0QJF9DejsIspKF3JvOKjG2edmC9o+GfL3hwDBiihYXCGY9lElZICAdt+7rZm5UxMx7STrVKy81xcvfaIp1BwGh/HyMsJnkE8IczzRFpLlHGYuNDxdLoBjiifrmHvOCUDcV8UvhSV+UAZtAVejdNGo5G/bz0NF21HUO4pVRPu6RqZIs/aX4hlm6iO/0Ru00ct8pfadUIgRcephTuFC2fHyZxNBC6NApRtLSNLfzYTTo/uSjgcu6rLWiNo5G7yfrM45RXjalFEFzk75Z/fu9lCJJa5uLFgDNKlU+IaFjArfXJCll3apbZp4/LNKiU35ZlB7ZmjDTrji1wLep8iRVVEGht/DW00MTok7Zn7Fv+MlxgWmbZB3BuezwTmXb/fNw==')
|
|
32
|
+
|
|
33
|
+
with self.assertRaisesRegex(Exception, "Invalid sealed data header"):
|
|
34
|
+
unseal_events_response(sealed_data, [
|
|
35
|
+
DecryptionKey(self.invalid_key, DecryptionAlgorithm['Aes256Gcm']),
|
|
36
|
+
DecryptionKey(self.valid_key, DecryptionAlgorithm['Aes256Gcm']),
|
|
37
|
+
])
|
|
38
|
+
|
|
39
|
+
def test_unseal_invalid_algorithm(self):
|
|
40
|
+
sealed_data = base64.b64decode(
|
|
41
|
+
'noXc7SXO+mqeAGrvBMgObi/S0fXTpP3zupk8qFqsO/1zdtWCD169iLA3VkkZh9ICHpZ0oWRzqG0M9/TnCeKFohgBLqDp6O0zEfXOv6i5q++aucItznQdLwrKLP+O0blfb4dWVI8/aSbd4ELAZuJJxj9bCoVZ1vk+ShbUXCRZTD30OIEAr3eiG9aw00y1UZIqMgX6CkFlU9L9OnKLsNsyomPIaRHTmgVTI5kNhrnVNyNsnzt9rY7fUD52DQxJILVPrUJ1Q+qW7VyNslzGYBPG0DyYlKbRAomKJDQIkdj/Uwa6bhSTq4XYNVvbk5AJ/dGwvsVdOnkMT2Ipd67KwbKfw5bqQj/cw6bj8Cp2FD4Dy4Ud4daBpPRsCyxBM2jOjVz1B/lAyrOp8BweXOXYugwdPyEn38MBZ5oL4D38jIwR/QiVnMHpERh93jtgwh9Abza6i4/zZaDAbPhtZLXSM5ztdctv8bAb63CppLU541Kf4OaLO3QLvfLRXK2n8bwEwzVAqQ22dyzt6/vPiRbZ5akh8JB6QFXG0QJF9DejsIspKF3JvOKjG2edmC9o+GfL3hwDBiihYXCGY9lElZICAdt+7rZm5UxMx7STrVKy81xcvfaIp1BwGh/HyMsJnkE8IczzRFpLlHGYuNDxdLoBjiifrmHvOCUDcV8UvhSV+UAZtAVejdNGo5G/bz0NF21HUO4pVRPu6RqZIs/aX4hlm6iO/0Ru00ct8pfadUIgRcephTuFC2fHyZxNBC6NApRtLSNLfzYTTo/uSjgcu6rLWiNo5G7yfrM45RXjalFEFzk75Z/fu9lCJJa5uLFgDNKlU+IaFjArfXJCll3apbZp4/LNKiU35ZlB7ZmjDTrji1wLep8iRVVEGht/DW00MTok7Zn7Fv+MlxgWmbZB3BuezwTmXb/fNw==')
|
|
42
|
+
|
|
43
|
+
with self.assertRaisesRegex(Exception, "Unsupported decryption algorithm: invalid"):
|
|
44
|
+
unseal_events_response(sealed_data, [
|
|
45
|
+
DecryptionKey(self.invalid_key, 'invalid'),
|
|
46
|
+
DecryptionKey(self.valid_key, DecryptionAlgorithm['Aes256Gcm']),
|
|
47
|
+
])
|
|
48
|
+
|
|
49
|
+
def test_unseal_invalid_data(self):
|
|
50
|
+
sealed_data = base64.b64decode(
|
|
51
|
+
# "{\"invalid\":true}"
|
|
52
|
+
'noXc7VOpBstjjcavDKSKr4HTavt4mdq8h6NC32T0hUtw9S0jXT8lPjZiWL8SyHxmrF3uTGqO+g==')
|
|
53
|
+
|
|
54
|
+
with self.assertRaisesRegex(Exception, "Sealed data is not valid events response"):
|
|
55
|
+
unseal_events_response(sealed_data, [
|
|
56
|
+
DecryptionKey(self.invalid_key, DecryptionAlgorithm['Aes256Gcm']),
|
|
57
|
+
DecryptionKey(self.valid_key, DecryptionAlgorithm['Aes256Gcm']),
|
|
58
|
+
])
|
|
59
|
+
|
|
60
|
+
def test_unseal_not_compressed_data(self):
|
|
61
|
+
sealed_data = base64.b64decode(
|
|
62
|
+
'noXc7dtuk0smGE+ZbaoXzrp6Rq8ySxLepejTsu7+jUXlPhV1w+WuHx9gbPhaENJnOQo8BcGmsaRhL5k2NVj+DRNzYO9cQD7wHxmXKCyTbl/dvSYOMoHziUZ2VbQ7tmaorFny26v8jROr/UBGfvPE0dLKC36IN9ZlJ3X0NZJO8SY+8bCr4mTrkVZsv/hpvZp+OjC4h7e5vxcpmnBWXzxfaO79Lq3aMRIEf9XfK7/bVIptHaEqtPKCTwl9rz1KUpUUNQSHTPM0NlqJe9bjYf5mr1uYvWHhcJoXSyRyVMxIv/quRiw3SKJzAMOTBiAvFICpWuRFa+T/xIMHK0g96w/IMQo0jdY1E067ZEvBUOBmsJnGJg1LllS3rbJVe+E2ClFNL8SzFphyvtlcfvYB+SVSD4bzI0w/YCldv5Sq42BFt5bn4n4aE5A6658DYsfSRYWqP6OpqPJx96cY34W7H1t/ZG0ulez6zF5NvWhc1HDQ1gMtXd+K/ogt1n+FyFtn8xzvtSGkmrc2jJgYNI5Pd0Z0ent73z0MKbJx9v2ta/emPEzPr3cndN5amdr6TmRkDU4bq0vyhAh87DJrAnJQLdrvYLddnrr8xTdeXxj1i1Yug6SGncPh9sbTYkdOfuamPAYOuiJVBAMcfYsYEiQndZe8mOQ4bpCr+hxAAqixhZ16pQ8CeUwa247+D2scRymLB8qJXlaERuFZtWGVAZ8VP/GS/9EXjrzpjGX9vlrIPeJP8fh2S5QPzw55cGNJ7JfAdOyManXnoEw2/QzDhSZQARVl+akFgSO0Y13YmbiL7H6HcKWGcJ2ipDKIaj2fJ7GE0Vzyt+CBEezSQR99Igd8x3p2JtvsVKp35iLPksjS1VqtSCTbuIRUlINlfQHNjeQiE/B/61jo3Mf7SmjYjqtvXt5e9RKb+CQku2qH4ZU8xN3DSg+4mLom3BgKBkm/MoyGBpMK41c96d2tRp3tp4hV0F6ac02Crg7P2lw8IUct+i2VJ8VUjcbRfTIPQs0HjNjM6/gLfLCkWOHYrlFjwusXWQCJz91Kq+hVxj7M9LtplPO4AUq6RUMNhlPGUmyOI2tcUMrjq9vMLXGlfdkH185zM4Mk+O7DRLC8683lXZFZvcBEmxr855PqLLH/9SpYKHBoGRatDRdQe3oRp6gHS0jpQ1SW/si4kvLKiUNjiBExvbQVOUV7/VFXvG1RpM9wbzSoOd40gg7ZzD/72QshUC/25DkM/Pm7RBzwtjgmnRKjT+mROeC/7VQLoz3amv09O8Mvbt+h/lX5+51Q834F7NgIGagbB20WtWcMtrmKrvCEZlaoiZrmYVSbi1RfknRK7CTPJkopw9IjO7Ut2EhKZ+jL4rwk6TlVm6EC6Kuj7KNqp6wB/UNe9eM2Eym/aiHAcja8XN4YQhSIuJD2Wxb0n3LkKnAjK1/GY65c8K6rZsVYQ0MQL1j4lMl0UZPjG/vzKyetIsVDyXc4J9ZhOEMYnt/LaxEeSt4EMJGBA9wpTmz33X4h3ij0Y3DY/rH7lrEScUknw20swTZRm5T6q1bnimj7M1OiOkebdI09MZ0nyaTWRHdB7B52C/moh89Q7qa2Fulp5h8Us1FYRkWBLt37a5rGI1IfVeP38KaPbagND+XzWpNqX4HVrAVPLQVK5EwUvGamED3ooJ0FMieTc0IH0N+IeUYG7Q8XmrRVBcw32W8pEfYLO9L71An/J0jQZCIP8DuQnUG0mOvunOuloBGvP/9LvkBlkamh68F0a5f5ny1jloyIFJhRh5dt2SBlbsXS9AKqUwARYSSsA9Ao4WJWOZMyjp8A+qIBAfW65MdhhUDKYMBgIAbMCc3uiptzElQQopE5TT5xIhwfYxa503jVzQbz1Q==')
|
|
63
|
+
|
|
64
|
+
with self.assertRaisesRegex(Exception, "Unable to decrypt sealed data") as context:
|
|
65
|
+
unseal_events_response(sealed_data, [
|
|
66
|
+
DecryptionKey(self.invalid_key, DecryptionAlgorithm['Aes256Gcm']),
|
|
67
|
+
DecryptionKey(self.valid_key, DecryptionAlgorithm['Aes256Gcm']),
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
exception: UnsealAggregateError = context.exception
|
|
71
|
+
error: UnsealError = exception.errors[1]
|
|
72
|
+
|
|
73
|
+
self.assertEqual(str(error.exception), 'Error -3 while decompressing data: invalid distance too far back')
|
|
74
|
+
|
|
75
|
+
def test_unseal_all_keys_invalid(self):
|
|
76
|
+
sealed_data = base64.b64decode(
|
|
77
|
+
'noXc7SXO+mqeAGrvBMgObi/S0fXTpP3zupk8qFqsO/1zdtWCD169iLA3VkkZh9ICHpZ0oWRzqG0M9/TnCeKFohgBLqDp6O0zEfXOv6i5q++aucItznQdLwrKLP+O0blfb4dWVI8/aSbd4ELAZuJJxj9bCoVZ1vk+ShbUXCRZTD30OIEAr3eiG9aw00y1UZIqMgX6CkFlU9L9OnKLsNsyomPIaRHTmgVTI5kNhrnVNyNsnzt9rY7fUD52DQxJILVPrUJ1Q+qW7VyNslzGYBPG0DyYlKbRAomKJDQIkdj/Uwa6bhSTq4XYNVvbk5AJ/dGwvsVdOnkMT2Ipd67KwbKfw5bqQj/cw6bj8Cp2FD4Dy4Ud4daBpPRsCyxBM2jOjVz1B/lAyrOp8BweXOXYugwdPyEn38MBZ5oL4D38jIwR/QiVnMHpERh93jtgwh9Abza6i4/zZaDAbPhtZLXSM5ztdctv8bAb63CppLU541Kf4OaLO3QLvfLRXK2n8bwEwzVAqQ22dyzt6/vPiRbZ5akh8JB6QFXG0QJF9DejsIspKF3JvOKjG2edmC9o+GfL3hwDBiihYXCGY9lElZICAdt+7rZm5UxMx7STrVKy81xcvfaIp1BwGh/HyMsJnkE8IczzRFpLlHGYuNDxdLoBjiifrmHvOCUDcV8UvhSV+UAZtAVejdNGo5G/bz0NF21HUO4pVRPu6RqZIs/aX4hlm6iO/0Ru00ct8pfadUIgRcephTuFC2fHyZxNBC6NApRtLSNLfzYTTo/uSjgcu6rLWiNo5G7yfrM45RXjalFEFzk75Z/fu9lCJJa5uLFgDNKlU+IaFjArfXJCll3apbZp4/LNKiU35ZlB7ZmjDTrji1wLep8iRVVEGht/DW00MTok7Zn7Fv+MlxgWmbZB3BuezwTmXb/fNw==')
|
|
78
|
+
|
|
79
|
+
with self.assertRaisesRegex(Exception, 'Unable to decrypt sealed data'):
|
|
80
|
+
unseal_events_response(sealed_data, [
|
|
81
|
+
DecryptionKey(self.invalid_key, DecryptionAlgorithm['Aes256Gcm']),
|
|
82
|
+
DecryptionKey(self.invalid_key, DecryptionAlgorithm['Aes256Gcm']),
|
|
83
|
+
])
|
|
84
|
+
|
|
85
|
+
def test_unseal_empty_data(self):
|
|
86
|
+
sealed_data = bytearray(b'')
|
|
87
|
+
|
|
88
|
+
with self.assertRaisesRegex(Exception, 'Invalid sealed data header'):
|
|
89
|
+
unseal_events_response(sealed_data, [
|
|
90
|
+
DecryptionKey(self.invalid_key, DecryptionAlgorithm['Aes256Gcm']),
|
|
91
|
+
DecryptionKey(self.valid_key, DecryptionAlgorithm['Aes256Gcm']),
|
|
92
|
+
])
|
|
93
|
+
|
|
94
|
+
def test_unseal_invalid_nonce(self):
|
|
95
|
+
sealed_data = bytes([0x9E, 0x85, 0xDC, 0xED, 0xAA, 0xBB, 0xCC])
|
|
96
|
+
|
|
97
|
+
with self.assertRaisesRegex(Exception, 'Unable to decrypt sealed data') as context:
|
|
98
|
+
unseal_events_response(sealed_data, [
|
|
99
|
+
DecryptionKey(self.invalid_key, DecryptionAlgorithm['Aes256Gcm']),
|
|
100
|
+
DecryptionKey(self.valid_key, DecryptionAlgorithm['Aes256Gcm']),
|
|
101
|
+
])
|
|
102
|
+
|
|
103
|
+
exception: UnsealAggregateError = context.exception
|
|
104
|
+
error: UnsealError = exception.errors[1]
|
|
105
|
+
|
|
106
|
+
self.assertEqual(str(error.exception), 'initialization_vector must be between 8 and 128 bytes (64 and 1024 bits).')
|
|
107
|
+
|
|
108
|
+
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fingerprint-pro-server-api-sdk-3.0.0 → fingerprint-pro-server-api-sdk-4.1.0.dev1}/test/__init__.py
RENAMED
|
File without changes
|