From e98dbd4675bdb28f5e98c4a670612e3f8d0aa671 Mon Sep 17 00:00:00 2001 From: TheUnderScorer Date: Tue, 8 Oct 2024 11:01:35 +0000 Subject: [PATCH 1/3] feat: update OpenAPI schema --- .changeset/orange-taxis-fetch.md | 5 + .changeset/pre.json | 8 + .changeset/wild-oranges-feel.md | 5 + .schema-version | 1 + README.md | 1 - docs/FingerprintApi.md | 2 +- docs/Visit.md | 22 - docs/VpnResult.md | 1 + fingerprint_pro_server_api_sdk/__init__.py | 1 - .../api/fingerprint_api.py | 4 +- .../models/__init__.py | 1 - .../models/visit.py | 407 --- .../models/vpn_result.py | 39 +- res/fingerprint-server-api.yaml | 2729 ++++++++--------- test/mocks/get_event_200.json | 3 +- ...on_too_many_requests_error_all_fields.json | 112 + test/mocks/get_event_200_wrong_shape.json | 310 -- ..._too_many_requests_error_empty_header.json | 3 - .../get_related_visitors_200.json | 10 + .../get_related_visitors_200_empty.json | 3 + test/mocks/sealed_result.json | 78 - .../400_error_empty_visitor_id.json | 0 .../400_error_incorrect_visitor_id.json | 0 .../403_error_feature_not_enabled.json | 0 .../403_error_token_not_found.json | 0 .../403_error_token_required.json | 0 .../{ => shared}/403_error_wrong_region.json | 0 .../404_error_visitor_not_found.json | 0 .../429_error_too_many_requests.json | 0 .../update_event_multiple_fields_request.json | 7 + .../mocks/update_event_one_field_request.json | 3 + test/mocks/webhook.json | 3 +- 32 files changed, 1533 insertions(+), 2225 deletions(-) create mode 100644 .changeset/orange-taxis-fetch.md create mode 100644 .changeset/pre.json create mode 100644 .changeset/wild-oranges-feel.md create mode 100644 .schema-version delete mode 100644 docs/Visit.md delete mode 100644 fingerprint_pro_server_api_sdk/models/visit.py create mode 100644 test/mocks/get_event_200_identification_too_many_requests_error_all_fields.json delete mode 100644 test/mocks/get_event_200_wrong_shape.json delete mode 100644 test/mocks/get_visits_429_too_many_requests_error_empty_header.json create mode 100644 test/mocks/related-visitors/get_related_visitors_200.json create mode 100644 test/mocks/related-visitors/get_related_visitors_200_empty.json delete mode 100644 test/mocks/sealed_result.json rename test/mocks/{ => shared}/400_error_empty_visitor_id.json (100%) rename test/mocks/{ => shared}/400_error_incorrect_visitor_id.json (100%) rename test/mocks/{ => shared}/403_error_feature_not_enabled.json (100%) rename test/mocks/{ => shared}/403_error_token_not_found.json (100%) rename test/mocks/{ => shared}/403_error_token_required.json (100%) rename test/mocks/{ => shared}/403_error_wrong_region.json (100%) rename test/mocks/{ => shared}/404_error_visitor_not_found.json (100%) rename test/mocks/{ => shared}/429_error_too_many_requests.json (100%) create mode 100644 test/mocks/update_event_multiple_fields_request.json create mode 100644 test/mocks/update_event_one_field_request.json diff --git a/.changeset/orange-taxis-fetch.md b/.changeset/orange-taxis-fetch.md new file mode 100644 index 00000000..99b36a10 --- /dev/null +++ b/.changeset/orange-taxis-fetch.md @@ -0,0 +1,5 @@ +--- +'fingerprint-pro-server-api-python-sdk': minor +--- + +**visitors**: Add the confidence field to the VPN Detection Smart Signal \ No newline at end of file diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 00000000..f4f6a7f1 --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,8 @@ +{ + "mode": "pre", + "tag": "rc", + "initialVersions": { + "fingerprint-pro-server-api-python-sdk": "7.0.1" + }, + "changesets": [] +} diff --git a/.changeset/wild-oranges-feel.md b/.changeset/wild-oranges-feel.md new file mode 100644 index 00000000..6cb90873 --- /dev/null +++ b/.changeset/wild-oranges-feel.md @@ -0,0 +1,5 @@ +--- +'fingerprint-pro-server-api-python-sdk': minor +--- + +**events**: Introduce `PUT` endpoint for `/events` API diff --git a/.schema-version b/.schema-version new file mode 100644 index 00000000..0408c30b --- /dev/null +++ b/.schema-version @@ -0,0 +1 @@ +v1.2.0 \ No newline at end of file diff --git a/README.md b/README.md index c9e5b412..2fa85ccf 100644 --- a/README.md +++ b/README.md @@ -346,7 +346,6 @@ Class | Method | HTTP request | Description - [VelocityIntervals](docs/VelocityIntervals.md) - [VelocityResult](docs/VelocityResult.md) - [VirtualMachineResult](docs/VirtualMachineResult.md) - - [Visit](docs/Visit.md) - [VpnResult](docs/VpnResult.md) - [VpnResultMethods](docs/VpnResultMethods.md) - [WebhookVisit](docs/WebhookVisit.md) diff --git a/docs/FingerprintApi.md b/docs/FingerprintApi.md index 9c5a684b..3c5dae1f 100644 --- a/docs/FingerprintApi.md +++ b/docs/FingerprintApi.md @@ -14,7 +14,7 @@ Method | HTTP request | Description Delete data by visitor ID -Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. All delete requests are queued: * Recent data (10 days or newer) belonging to the specified visitor will be deleted within 24 hours. * Data from older (11 days or more) identification events will be deleted after 90 days. If you are interested in using this API, please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. +Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Application](https://dev.fingerprint.com/docs/glossary#fingerprint-application). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/events` API](https://dev.fingerprint.com/reference/getevent) with a `request_id` that was made outside of the 10 days, you will still receive a valid response. - If you request [`/visitors` API](https://dev.fingerprint.com/reference/getvisits) for the deleted visitor ID, the response will include identification requests that were made outside of those 10 days. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. ### Example ```python diff --git a/docs/Visit.md b/docs/Visit.md deleted file mode 100644 index d382baaf..00000000 --- a/docs/Visit.md +++ /dev/null @@ -1,22 +0,0 @@ -# Visit - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**request_id** | **str** | Unique identifier of the user's identification request. | -**browser_details** | [**BrowserDetails**](BrowserDetails.md) | | -**incognito** | **bool** | Flag if user used incognito session. | -**ip** | **str** | | -**ip_location** | [**DeprecatedIPLocation**](DeprecatedIPLocation.md) | | [optional] -**timestamp** | **int** | Timestamp of the event with millisecond precision in Unix time. | -**time** | **datetime** | Time expressed according to ISO 8601 in UTC format. | -**url** | **str** | Page URL from which the identification request was sent. | -**tag** | **dict(str, object)** | A customer-provided value or an object that was sent with identification request. | [optional] -**linked_id** | **str** | A customer-provided id that was sent with identification request. | [optional] -**confidence** | [**Confidence**](Confidence.md) | | [optional] -**visitor_found** | **bool** | Attribute represents if a visitor had been identified before. | -**first_seen_at** | [**SeenAt**](SeenAt.md) | | -**last_seen_at** | [**SeenAt**](SeenAt.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/VpnResult.md b/docs/VpnResult.md index b7760cb6..76a4bd79 100644 --- a/docs/VpnResult.md +++ b/docs/VpnResult.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **origin_timezone** | **str** | Local timezone which is used in timezoneMismatch method. | **origin_country** | **str** | Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). | [optional] **methods** | [**VpnResultMethods**](VpnResultMethods.md) | | +**confidence** | **str** | A confidence rating for the VPN detection result — \"low\", \"medium\", or \"high\". Depends on the combination of results returned from all VPN detection methods. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/fingerprint_pro_server_api_sdk/__init__.py b/fingerprint_pro_server_api_sdk/__init__.py index 72371d07..d537d3a1 100644 --- a/fingerprint_pro_server_api_sdk/__init__.py +++ b/fingerprint_pro_server_api_sdk/__init__.py @@ -107,7 +107,6 @@ from fingerprint_pro_server_api_sdk.models.velocity_intervals import VelocityIntervals from fingerprint_pro_server_api_sdk.models.velocity_result import VelocityResult from fingerprint_pro_server_api_sdk.models.virtual_machine_result import VirtualMachineResult -from fingerprint_pro_server_api_sdk.models.visit import Visit from fingerprint_pro_server_api_sdk.models.vpn_result import VpnResult from fingerprint_pro_server_api_sdk.models.vpn_result_methods import VpnResultMethods from fingerprint_pro_server_api_sdk.models.webhook_visit import WebhookVisit diff --git a/fingerprint_pro_server_api_sdk/api/fingerprint_api.py b/fingerprint_pro_server_api_sdk/api/fingerprint_api.py index 03cc09d2..3d537361 100644 --- a/fingerprint_pro_server_api_sdk/api/fingerprint_api.py +++ b/fingerprint_pro_server_api_sdk/api/fingerprint_api.py @@ -48,7 +48,7 @@ def __init__(self, configuration: Optional[Configuration] = None, pool: Optional def delete_visitor_data(self, visitor_id: str, **kwargs) -> Union[None, AsyncResult[None]]: # noqa: E501 """Delete data by visitor ID # noqa: E501 - Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. All delete requests are queued: * Recent data (10 days or newer) belonging to the specified visitor will be deleted within 24 hours. * Data from older (11 days or more) identification events will be deleted after 90 days. If you are interested in using this API, please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. # noqa: E501 + Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Application](https://dev.fingerprint.com/docs/glossary#fingerprint-application). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/events` API](https://dev.fingerprint.com/reference/getevent) with a `request_id` that was made outside of the 10 days, you will still receive a valid response. - If you request [`/visitors` API](https://dev.fingerprint.com/reference/getvisits) for the deleted visitor ID, the response will include identification requests that were made outside of those 10 days. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_visitor_data(visitor_id, async_req=True) @@ -70,7 +70,7 @@ def delete_visitor_data(self, visitor_id: str, **kwargs) -> Union[None, AsyncRes def delete_visitor_data_with_http_info(self, visitor_id: str, **kwargs): # noqa: E501 """Delete data by visitor ID # noqa: E501 - Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. All delete requests are queued: * Recent data (10 days or newer) belonging to the specified visitor will be deleted within 24 hours. * Data from older (11 days or more) identification events will be deleted after 90 days. If you are interested in using this API, please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. # noqa: E501 + Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Application](https://dev.fingerprint.com/docs/glossary#fingerprint-application). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/events` API](https://dev.fingerprint.com/reference/getevent) with a `request_id` that was made outside of the 10 days, you will still receive a valid response. - If you request [`/visitors` API](https://dev.fingerprint.com/reference/getvisits) for the deleted visitor ID, the response will include identification requests that were made outside of those 10 days. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_visitor_data_with_http_info(visitor_id, async_req=True) diff --git a/fingerprint_pro_server_api_sdk/models/__init__.py b/fingerprint_pro_server_api_sdk/models/__init__.py index 87cd306e..212c1856 100644 --- a/fingerprint_pro_server_api_sdk/models/__init__.py +++ b/fingerprint_pro_server_api_sdk/models/__init__.py @@ -99,7 +99,6 @@ from fingerprint_pro_server_api_sdk.models.velocity_intervals import VelocityIntervals from fingerprint_pro_server_api_sdk.models.velocity_result import VelocityResult from fingerprint_pro_server_api_sdk.models.virtual_machine_result import VirtualMachineResult -from fingerprint_pro_server_api_sdk.models.visit import Visit from fingerprint_pro_server_api_sdk.models.vpn_result import VpnResult from fingerprint_pro_server_api_sdk.models.vpn_result_methods import VpnResultMethods from fingerprint_pro_server_api_sdk.models.webhook_visit import WebhookVisit diff --git a/fingerprint_pro_server_api_sdk/models/visit.py b/fingerprint_pro_server_api_sdk/models/visit.py deleted file mode 100644 index e8cd980e..00000000 --- a/fingerprint_pro_server_api_sdk/models/visit.py +++ /dev/null @@ -1,407 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Pro Server API - - 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. # noqa: E501 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_pro_server_api_sdk.base_model import BaseModel -from fingerprint_pro_server_api_sdk.models.browser_details import BrowserDetails -from fingerprint_pro_server_api_sdk.models.deprecated_ip_location import DeprecatedIPLocation -from datetime import datetime -from fingerprint_pro_server_api_sdk.models.confidence import Confidence -from fingerprint_pro_server_api_sdk.models.seen_at import SeenAt -from fingerprint_pro_server_api_sdk.models.seen_at import SeenAt - - -class Visit(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'request_id': 'str', - 'browser_details': 'BrowserDetails', - 'incognito': 'bool', - 'ip': 'str', - 'ip_location': 'DeprecatedIPLocation', - 'timestamp': 'int', - 'time': 'datetime', - 'url': 'str', - 'tag': 'dict(str, object)', - 'linked_id': 'str', - 'confidence': 'Confidence', - 'visitor_found': 'bool', - 'first_seen_at': 'SeenAt', - 'last_seen_at': 'SeenAt' - } - - attribute_map = { - 'request_id': 'requestId', - 'browser_details': 'browserDetails', - 'incognito': 'incognito', - 'ip': 'ip', - 'ip_location': 'ipLocation', - 'timestamp': 'timestamp', - 'time': 'time', - 'url': 'url', - 'tag': 'tag', - 'linked_id': 'linkedId', - 'confidence': 'confidence', - 'visitor_found': 'visitorFound', - 'first_seen_at': 'firstSeenAt', - 'last_seen_at': 'lastSeenAt' - } - - def __init__(self, request_id=None, browser_details=None, incognito=None, ip=None, ip_location=None, timestamp=None, time=None, url=None, tag=None, linked_id=None, confidence=None, visitor_found=None, first_seen_at=None, last_seen_at=None): # noqa: E501 - """Visit - a model defined in Swagger""" # noqa: E501 - self._request_id = None - self._browser_details = None - self._incognito = None - self._ip = None - self._ip_location = None - self._timestamp = None - self._time = None - self._url = None - self._tag = None - self._linked_id = None - self._confidence = None - self._visitor_found = None - self._first_seen_at = None - self._last_seen_at = None - self.discriminator = None - self.request_id = request_id - self.browser_details = browser_details - self.incognito = incognito - self.ip = ip - if ip_location is not None: - self.ip_location = ip_location - self.timestamp = timestamp - self.time = time - self.url = url - if tag is not None: - self.tag = tag - if linked_id is not None: - self.linked_id = linked_id - if confidence is not None: - self.confidence = confidence - self.visitor_found = visitor_found - self.first_seen_at = first_seen_at - self.last_seen_at = last_seen_at - - @property - def request_id(self) -> str: - """Gets the request_id of this Visit. # noqa: E501 - - Unique identifier of the user's identification request. # noqa: E501 - - :return: The request_id of this Visit. # noqa: E501 - """ - return self._request_id - - @request_id.setter - def request_id(self, request_id: str): - """Sets the request_id of this Visit. - - Unique identifier of the user's identification request. # noqa: E501 - - :param request_id: The request_id of this Visit. # noqa: E501 - """ - if request_id is None: - raise ValueError("Invalid value for `request_id`, must not be `None`") # noqa: E501 - - self._request_id = request_id - - @property - def browser_details(self) -> BrowserDetails: - """Gets the browser_details of this Visit. # noqa: E501 - - - :return: The browser_details of this Visit. # noqa: E501 - """ - return self._browser_details - - @browser_details.setter - def browser_details(self, browser_details: BrowserDetails): - """Sets the browser_details of this Visit. - - - :param browser_details: The browser_details of this Visit. # noqa: E501 - """ - if browser_details is None: - raise ValueError("Invalid value for `browser_details`, must not be `None`") # noqa: E501 - - self._browser_details = browser_details - - @property - def incognito(self) -> bool: - """Gets the incognito of this Visit. # noqa: E501 - - Flag if user used incognito session. # noqa: E501 - - :return: The incognito of this Visit. # noqa: E501 - """ - return self._incognito - - @incognito.setter - def incognito(self, incognito: bool): - """Sets the incognito of this Visit. - - Flag if user used incognito session. # noqa: E501 - - :param incognito: The incognito of this Visit. # noqa: E501 - """ - if incognito is None: - raise ValueError("Invalid value for `incognito`, must not be `None`") # noqa: E501 - - self._incognito = incognito - - @property - def ip(self) -> str: - """Gets the ip of this Visit. # noqa: E501 - - - :return: The ip of this Visit. # noqa: E501 - """ - return self._ip - - @ip.setter - def ip(self, ip: str): - """Sets the ip of this Visit. - - - :param ip: The ip of this Visit. # noqa: E501 - """ - if ip is None: - raise ValueError("Invalid value for `ip`, must not be `None`") # noqa: E501 - - self._ip = ip - - @property - def ip_location(self) -> Optional[DeprecatedIPLocation]: - """Gets the ip_location of this Visit. # noqa: E501 - - - :return: The ip_location of this Visit. # noqa: E501 - """ - return self._ip_location - - @ip_location.setter - def ip_location(self, ip_location: Optional[DeprecatedIPLocation]): - """Sets the ip_location of this Visit. - - - :param ip_location: The ip_location of this Visit. # noqa: E501 - """ - - self._ip_location = ip_location - - @property - def timestamp(self) -> int: - """Gets the timestamp of this Visit. # noqa: E501 - - Timestamp of the event with millisecond precision in Unix time. # noqa: E501 - - :return: The timestamp of this Visit. # noqa: E501 - """ - return self._timestamp - - @timestamp.setter - def timestamp(self, timestamp: int): - """Sets the timestamp of this Visit. - - Timestamp of the event with millisecond precision in Unix time. # noqa: E501 - - :param timestamp: The timestamp of this Visit. # noqa: E501 - """ - if timestamp is None: - raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 - - self._timestamp = timestamp - - @property - def time(self) -> datetime: - """Gets the time of this Visit. # noqa: E501 - - Time expressed according to ISO 8601 in UTC format. # noqa: E501 - - :return: The time of this Visit. # noqa: E501 - """ - return self._time - - @time.setter - def time(self, time: datetime): - """Sets the time of this Visit. - - Time expressed according to ISO 8601 in UTC format. # noqa: E501 - - :param time: The time of this Visit. # noqa: E501 - """ - if time is None: - raise ValueError("Invalid value for `time`, must not be `None`") # noqa: E501 - - self._time = time - - @property - def url(self) -> str: - """Gets the url of this Visit. # noqa: E501 - - Page URL from which the identification request was sent. # noqa: E501 - - :return: The url of this Visit. # noqa: E501 - """ - return self._url - - @url.setter - def url(self, url: str): - """Sets the url of this Visit. - - Page URL from which the identification request was sent. # noqa: E501 - - :param url: The url of this Visit. # noqa: E501 - """ - if url is None: - raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 - - self._url = url - - @property - def tag(self) -> Optional[Dict[str, object]]: - """Gets the tag of this Visit. # noqa: E501 - - A customer-provided value or an object that was sent with identification request. # noqa: E501 - - :return: The tag of this Visit. # noqa: E501 - """ - return self._tag - - @tag.setter - def tag(self, tag: Optional[Dict[str, object]]): - """Sets the tag of this Visit. - - A customer-provided value or an object that was sent with identification request. # noqa: E501 - - :param tag: The tag of this Visit. # noqa: E501 - """ - - self._tag = tag - - @property - def linked_id(self) -> Optional[str]: - """Gets the linked_id of this Visit. # noqa: E501 - - A customer-provided id that was sent with identification request. # noqa: E501 - - :return: The linked_id of this Visit. # noqa: E501 - """ - return self._linked_id - - @linked_id.setter - def linked_id(self, linked_id: Optional[str]): - """Sets the linked_id of this Visit. - - A customer-provided id that was sent with identification request. # noqa: E501 - - :param linked_id: The linked_id of this Visit. # noqa: E501 - """ - - self._linked_id = linked_id - - @property - def confidence(self) -> Optional[Confidence]: - """Gets the confidence of this Visit. # noqa: E501 - - - :return: The confidence of this Visit. # noqa: E501 - """ - return self._confidence - - @confidence.setter - def confidence(self, confidence: Optional[Confidence]): - """Sets the confidence of this Visit. - - - :param confidence: The confidence of this Visit. # noqa: E501 - """ - - self._confidence = confidence - - @property - def visitor_found(self) -> bool: - """Gets the visitor_found of this Visit. # noqa: E501 - - Attribute represents if a visitor had been identified before. # noqa: E501 - - :return: The visitor_found of this Visit. # noqa: E501 - """ - return self._visitor_found - - @visitor_found.setter - def visitor_found(self, visitor_found: bool): - """Sets the visitor_found of this Visit. - - Attribute represents if a visitor had been identified before. # noqa: E501 - - :param visitor_found: The visitor_found of this Visit. # noqa: E501 - """ - if visitor_found is None: - raise ValueError("Invalid value for `visitor_found`, must not be `None`") # noqa: E501 - - self._visitor_found = visitor_found - - @property - def first_seen_at(self) -> SeenAt: - """Gets the first_seen_at of this Visit. # noqa: E501 - - - :return: The first_seen_at of this Visit. # noqa: E501 - """ - return self._first_seen_at - - @first_seen_at.setter - def first_seen_at(self, first_seen_at: SeenAt): - """Sets the first_seen_at of this Visit. - - - :param first_seen_at: The first_seen_at of this Visit. # noqa: E501 - """ - if first_seen_at is None: - raise ValueError("Invalid value for `first_seen_at`, must not be `None`") # noqa: E501 - - self._first_seen_at = first_seen_at - - @property - def last_seen_at(self) -> SeenAt: - """Gets the last_seen_at of this Visit. # noqa: E501 - - - :return: The last_seen_at of this Visit. # noqa: E501 - """ - return self._last_seen_at - - @last_seen_at.setter - def last_seen_at(self, last_seen_at: SeenAt): - """Sets the last_seen_at of this Visit. - - - :param last_seen_at: The last_seen_at of this Visit. # noqa: E501 - """ - if last_seen_at is None: - raise ValueError("Invalid value for `last_seen_at`, must not be `None`") # noqa: E501 - - self._last_seen_at = last_seen_at - diff --git a/fingerprint_pro_server_api_sdk/models/vpn_result.py b/fingerprint_pro_server_api_sdk/models/vpn_result.py index 74d6571f..bc7914de 100644 --- a/fingerprint_pro_server_api_sdk/models/vpn_result.py +++ b/fingerprint_pro_server_api_sdk/models/vpn_result.py @@ -32,28 +32,32 @@ class VpnResult(BaseModel): 'result': 'bool', 'origin_timezone': 'str', 'origin_country': 'str', - 'methods': 'VpnResultMethods' + 'methods': 'VpnResultMethods', + 'confidence': 'str' } attribute_map = { 'result': 'result', 'origin_timezone': 'originTimezone', 'origin_country': 'originCountry', - 'methods': 'methods' + 'methods': 'methods', + 'confidence': 'confidence' } - def __init__(self, result=None, origin_timezone=None, origin_country=None, methods=None): # noqa: E501 + def __init__(self, result=None, origin_timezone=None, origin_country=None, methods=None, confidence=None): # noqa: E501 """VpnResult - a model defined in Swagger""" # noqa: E501 self._result = None self._origin_timezone = None self._origin_country = None self._methods = None + self._confidence = None self.discriminator = None self.result = result self.origin_timezone = origin_timezone if origin_country is not None: self.origin_country = origin_country self.methods = methods + self.confidence = confidence @property def result(self) -> bool: @@ -143,3 +147,32 @@ def methods(self, methods: VpnResultMethods): self._methods = methods + @property + def confidence(self) -> str: + """Gets the confidence of this VpnResult. # noqa: E501 + + A confidence rating for the VPN detection result — \"low\", \"medium\", or \"high\". Depends on the combination of results returned from all VPN detection methods. # noqa: E501 + + :return: The confidence of this VpnResult. # noqa: E501 + """ + return self._confidence + + @confidence.setter + def confidence(self, confidence: str): + """Sets the confidence of this VpnResult. + + A confidence rating for the VPN detection result — \"low\", \"medium\", or \"high\". Depends on the combination of results returned from all VPN detection methods. # noqa: E501 + + :param confidence: The confidence of this VpnResult. # noqa: E501 + """ + if confidence is None: + raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501 + allowed_values = ["low", "medium", "high"] # noqa: E501 + if (confidence not in allowed_values): + raise ValueError( + "Invalid value for `confidence` ({0}), must be one of {1}" # noqa: E501 + .format(confidence, allowed_values) + ) + + self._confidence = confidence + diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index f6e6d701..3ee7eb49 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -290,19 +290,58 @@ paths: Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. - All delete requests are queued: + ### Which data is deleted? + - Browser (or device) properties - * Recent data (10 days or newer) belonging to the specified visitor will - be deleted within 24 hours. + - Identification requests made from this browser (or device) - * Data from older (11 days or more) identification events will be - deleted after 90 days. + #### Browser (or device) properties - If you are interested in using this API, please [contact our support - team](https://fingerprint.com/support/) to enable it for you. Otherwise, - you will receive a 403. + - Represents the data that Fingerprint collected from this specific + browser (or device) and everything inferred and derived from it. + + - Upon request to delete, this data is deleted asynchronously (typically + within a few minutes) and it will no longer be used to identify this + browser (or device) for your [Fingerprint + Application](https://dev.fingerprint.com/docs/glossary#fingerprint-application). + + + #### Identification requests made from this browser (or device) + + - Fingerprint stores the identification requests made from a browser (or + device) for up to 30 (or 90) days depending on your plan. To learn more, + see [Data + Retention](https://dev.fingerprint.com/docs/regions#data-retention). + + - Upon request to delete, the identification requests that were made by + this browser + - Within the past 10 days are deleted within 24 hrs. + - Outside of 10 days are allowed to purge as per your data retention period. + + ### Corollary + + After requesting to delete a visitor ID, + + - If the same browser (or device) requests to identify, it will receive + a different visitor ID. + + - If you request [`/events` + API](https://dev.fingerprint.com/reference/getevent) with a `request_id` + that was made outside of the 10 days, you will still receive a valid + response. + + - If you request [`/visitors` + API](https://dev.fingerprint.com/reference/getvisits) for the deleted + visitor ID, the response will include identification requests that were + made outside of those 10 days. + + + ### Interested? + + Please [contact our support team](https://fingerprint.com/support/) to + enable it for you. Otherwise, you will receive a 403. parameters: - name: visitor_id in: path @@ -471,6 +510,7 @@ paths: publicVPN: false auxiliaryMobile: false osMismatch: false + confidence: high proxy: result: false tampering: @@ -548,1264 +588,511 @@ components: in: query name: api_key schemas: - Response: + BrowserDetails: type: object additionalProperties: false properties: - visitorId: + browserName: type: string - visits: - type: array - items: - title: ResponseVisits - type: object - properties: - requestId: - description: Unique identifier of the user's identification request. - type: string - example: 1654815516083.OX6kx8 - browserDetails: - $ref: '#/components/schemas/BrowserDetails' - incognito: - description: Flag if user used incognito session. - type: boolean - ip: - type: string - format: ipv4 - example: 8.8.8.8 - ipLocation: - type: object - additionalProperties: false - deprecated: true - description: >- - This field is **deprecated** and will not return a result for - **applications created after January 23rd, 2024**. Please use - the [IP Geolocation Smart - signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) - for geolocation information. - properties: - accuracyRadius: - description: >- - The IP address is likely to be within this radius (in km) - of the specified location. - type: integer - minimum: 0 - latitude: - type: number - format: double - minimum: -90 - maximum: 90 - longitude: - type: number - format: double - minimum: -180 - maximum: 180 - postalCode: - type: string - timezone: - type: string - format: timezone - city: - type: object - additionalProperties: false - title: DeprecatedIPLocationCity - properties: - name: - type: string - country: - $ref: '#/components/schemas/Location' - continent: - $ref: '#/components/schemas/Location' - subdivisions: - type: array - items: - $ref: '#/components/schemas/Subdivision' - title: DeprecatedIPLocation - timestamp: - description: >- - Timestamp of the event with millisecond precision in Unix - time. - type: integer - format: int64 - example: 1654815516086 - time: - title: Time - description: Time expressed according to ISO 8601 in UTC format. - type: string - format: date-time - example: '2022-06-09T22:58:36Z' - url: - description: Page URL from which the identification request was sent. - type: string - example: https://some.website/path?query=params - tag: - description: >- - A customer-provided value or an object that was sent with - identification request. - type: object - additionalProperties: true - linkedId: - description: >- - A customer-provided id that was sent with identification - request. - type: string - example: someID - confidence: - $ref: '#/components/schemas/Confidence' - visitorFound: - description: Attribute represents if a visitor had been identified before. - type: boolean - firstSeenAt: - $ref: '#/components/schemas/SeenAt' - lastSeenAt: - $ref: '#/components/schemas/SeenAt' - additionalProperties: false - required: - - browserDetails - - firstSeenAt - - incognito - - ip - - lastSeenAt - - requestId - - time - - timestamp - - url - - visitorFound - - tag - lastTimestamp: - description: > - ⚠️ Deprecated paging attribute, please use `paginationKey` instead. - Timestamp of the last visit in the current page of results. - type: integer - format: int64 - example: 1654815517198 - paginationKey: - description: >- - Request ID of the last visit in the current page of results. Use - this value in the following request as the `paginationKey` parameter - to get the next page of results. + example: Chrome + browserMajorVersion: type: string - example: 1654815517198.azN4IZ + example: '101' + browserFullVersion: + type: string + example: 101.0.4951 + os: + type: string + example: Windows + osVersion: + type: string + example: '10' + device: + type: string + example: Other + userAgent: + type: string + example: >- + Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, + like Gecko) Chrome/101.0.4951.41 Safari/537.36 + botProbability: + type: integer required: - - visitorId - - visits - title: PaginatedResponse - description: >- - Fields `lastTimestamp` and `paginationKey` added when `limit` or - `before` parameter provided and there is more data to show - ErrorCommon403Response: + - browserFullVersion + - browserMajorVersion + - browserName + - device + - os + - osVersion + - userAgent + title: BrowserDetails + Location: type: object additionalProperties: false properties: - error: - type: object - additionalProperties: false - title: Common403ErrorResponse - properties: - code: - type: string - description: | - Error code: - * `TokenRequired` - `Auth-API-Key` header is missing or empty - * `TokenNotFound` - No Fingerprint application found for specified secret key - * `SubscriptionNotActive` - Fingerprint application is not active - * `WrongRegion` - server and application region differ - * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application - enum: - - TokenRequired - - TokenNotFound - - SubscriptionNotActive - - WrongRegion - - FeatureNotEnabled - example: TokenRequired - message: - type: string - example: secret key is required - required: - - code - - message - ErrorCommon429Response: + code: + type: string + minLength: 2 + maxLength: 2 + example: US + name: + type: string + example: United States + required: + - code + - name + title: Location + Subdivision: type: object additionalProperties: false properties: - error: - type: object - additionalProperties: false - properties: - code: - type: string - description: | - Error code: * `TooManyRequests` - The request is throttled. - enum: - - TooManyRequests - example: TooManyRequests - message: - type: string - example: request throttled - required: - - code - - message - ErrorEvent404Response: + isoCode: + type: string + example: '10' + name: + type: string + example: Hlavni mesto Praha + Confidence: type: object additionalProperties: false properties: - error: - type: object - additionalProperties: false - title: ErrorEvent404ResponseError - properties: - code: - type: string - description: | - Error code: - * `RequestNotFound` - The specified request ID was not found. It never existed, expired, or it has been deleted. - enum: - - RequestNotFound - example: RequestNotFound - message: - type: string - example: request id is not found - required: - - code - - message - ErrorVisits403: + score: + description: >- + The confidence score is a floating-point number between 0 and 1 that + represents the probability of accurate identification. + type: number + format: float + minimum: 0 + maximum: 1 + revision: + description: >- + The revision name of the method used to calculate the Confidence + score. This field is only present for customers who opted in to an + alternative calculation method. + type: string + required: + - score + title: Confidence + SeenAt: type: object additionalProperties: false properties: - error: + global: type: string - description: Error text. - example: Forbidden (HTTP 403) + nullable: true + format: date-time + example: '2022-05-05T18:28:54.535Z' + subscription: + type: string + nullable: true + format: date-time + example: '2022-06-09T22:58:05.576Z' required: - - error - TooManyRequestsResponse: + - global + - subscription + title: SeenAt + example: + global: '2022-05-05T18:28:54.535Z' + subscription: null + IdentificationError: type: object additionalProperties: false properties: - error: + code: type: string - description: Error text. - example: request throttled + description: | + Error code: + * `429 Too Many Requests` - the limit on secret API key requests per second has been exceeded + * `Failed` - internal server error + enum: + - 429 Too Many Requests + - Failed + example: 429 Too Many Requests + message: + type: string + example: too many requests required: - - error - ErrorVisitor404Response: + - code + - message + BotdDetectionResult: type: object additionalProperties: false + description: Stores bot detection result properties: - error: - type: object - additionalProperties: false - title: ErrorVisitor404ResponseError - properties: - code: - type: string - description: > - Error code: * `VisitorNotFound` - The specified visitor ID was - not found. It never existed or it may have already been deleted. - enum: - - VisitorNotFound - example: VisitorNotFound - message: - type: string - example: visitor not found - required: - - code - - message - ErrorVisitor400Response: + result: + type: string + description: | + Bot detection result: + * `notDetected` - the visitor is not a bot + * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on + * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on + enum: + - notDetected + - good + - bad + example: bad + type: + type: string + example: selenium + required: + - result + BotdResult: type: object additionalProperties: false + description: Contains all the information from Bot Detection product properties: - error: - type: object - additionalProperties: false - properties: - code: - type: string - description: > - Error code: * `RequestCannotBeParsed` - The visitor ID parameter - is missing or in the wrong format. - enum: - - RequestCannotBeParsed - example: RequestCannotBeParsed - message: - type: string - example: invalid visitor id - required: - - code - - message - WebhookVisit: - type: object - properties: - visitorId: + ip: type: string - example: 3HNey93AkBW6CRbxV6xP - clientReferrer: + format: ipv4 + example: 8.8.8.8 + description: IP address of the requesting browser or bot. + time: + title: Time + description: >- + Time in UTC when the request from the JS agent was made. We + recommend to treat requests that are older than 2 minutes as + malicious. Otherwise, request replay attacks are possible type: string - example: https://google.com?search=banking+services + format: date-time + example: '2022-06-09T22:58:36Z' + url: + description: Page URL from which identification request was sent. + type: string + example: https://example.com/login userAgent: type: string example: >- Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 + requestId: + type: string + example: 1681392853693.lRiBBD + linkedId: + type: string + example: Automatic tests bot bot: $ref: '#/components/schemas/BotdDetectionResult' - ipInfo: - $ref: '#/components/schemas/IpInfoResult' - incognito: - description: Flag if user used incognito session. - type: boolean - rootApps: - $ref: '#/components/schemas/RootAppsResult' - emulator: - $ref: '#/components/schemas/EmulatorResult' - clonedApp: - $ref: '#/components/schemas/ClonedAppResult' - factoryReset: - $ref: '#/components/schemas/FactoryResetResult' - jailbroken: - $ref: '#/components/schemas/JailbrokenResult' - frida: - $ref: '#/components/schemas/FridaResult' - ipBlocklist: - $ref: '#/components/schemas/IpBlockListResult' - tor: - $ref: '#/components/schemas/TorResult' - privacySettings: - $ref: '#/components/schemas/PrivacySettingsResult' - virtualMachine: - $ref: '#/components/schemas/VirtualMachineResult' - vpn: - $ref: '#/components/schemas/VpnResult' - proxy: - $ref: '#/components/schemas/ProxyResult' - tampering: - $ref: '#/components/schemas/TamperingResult' - rawDeviceAttributes: - $ref: '#/components/schemas/RawDeviceAttributesResult' - highActivity: - $ref: '#/components/schemas/HighActivityResult' - locationSpoofing: - $ref: '#/components/schemas/LocationSpoofingResult' - suspectScore: - $ref: '#/components/schemas/SuspectScoreResult' - remoteControl: - $ref: '#/components/schemas/RemoteControlResult' - velocity: - $ref: '#/components/schemas/VelocityResult' - developerTools: - $ref: '#/components/schemas/DeveloperToolsResult' - requestId: - description: Unique identifier of the user's identification request. + required: + - bot + - url + - ip + - time + - userAgent + - requestId + ProductError: + type: object + additionalProperties: false + properties: + code: type: string - example: 1654815516083.OX6kx8 - browserDetails: - $ref: '#/components/schemas/BrowserDetails' - ip: + description: | + Error code: + * `TooManyRequests` - the limit on secret API key requests per second has been exceeded + * `Failed` - internal server error + enum: + - TooManyRequests + - Failed + example: TooManyRequests + message: type: string - format: ipv4 - example: 8.8.8.8 - ipLocation: - type: object - additionalProperties: false - deprecated: true + example: too many requests + required: + - code + - message + IPLocation: + type: object + additionalProperties: false + properties: + accuracyRadius: description: >- - This field is **deprecated** and will not return a result for - **applications created after January 23rd, 2024**. Please use the - [IP Geolocation Smart - signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) - for geolocation information. - properties: - accuracyRadius: - description: >- - The IP address is likely to be within this radius (in km) of the - specified location. - type: integer - minimum: 0 - latitude: - type: number - format: double - minimum: -90 - maximum: 90 - longitude: - type: number - format: double - minimum: -180 - maximum: 180 - postalCode: - type: string - timezone: - type: string - format: timezone - city: - type: object - additionalProperties: false - title: DeprecatedIPLocationCity - properties: - name: - type: string - country: - $ref: '#/components/schemas/Location' - continent: - $ref: '#/components/schemas/Location' - subdivisions: - type: array - items: - $ref: '#/components/schemas/Subdivision' - title: DeprecatedIPLocation - timestamp: - description: Timestamp of the event with millisecond precision in Unix time. + The IP address is likely to be within this radius (in km) of the + specified location. type: integer - format: int64 - example: 1654815516086 - time: - title: Time - description: Time expressed according to ISO 8601 in UTC format. + minimum: 0 + example: 1000 + latitude: + type: number + format: double + minimum: -90 + maximum: 90 + example: 37.75 + longitude: + type: number + format: double + minimum: -180 + maximum: 180 + example: -97.82 + postalCode: type: string - format: date-time - example: '2022-06-09T22:58:36Z' - url: - description: Page URL from which the identification request was sent. + example: 130 00 + timezone: type: string - example: https://some.website/path?query=params - tag: - description: >- - A customer-provided value or an object that was sent with - identification request. + format: timezone + example: America/Chicago + city: type: object - additionalProperties: true - linkedId: - description: A customer-provided id that was sent with identification request. - type: string - example: someID - confidence: - $ref: '#/components/schemas/Confidence' - visitorFound: - description: Attribute represents if a visitor had been identified before. - type: boolean - firstSeenAt: - $ref: '#/components/schemas/SeenAt' - lastSeenAt: - $ref: '#/components/schemas/SeenAt' + additionalProperties: false + title: IPLocationCity + properties: + name: + type: string + example: Prague + country: + $ref: '#/components/schemas/Location' + continent: + $ref: '#/components/schemas/Location' + subdivisions: + type: array + items: + $ref: '#/components/schemas/Subdivision' + title: IPLocation + ASN: + type: object additionalProperties: false + properties: + asn: + type: string + example: '7922' + network: + type: string + example: 73.136.0.0/13 + name: + type: string + example: COMCAST-7922 required: - - visitorId - - browserDetails - - firstSeenAt - - incognito - - ip - - lastSeenAt - - requestId - - time - - timestamp - - url - - visitorFound - Visit: + - asn + - network + title: ASN + DataCenter: type: object additionalProperties: false properties: - requestId: - description: Unique identifier of the user's identification request. - type: string - example: 1654815516083.OX6kx8 - browserDetails: - $ref: '#/components/schemas/BrowserDetails' - incognito: - description: Flag if user used incognito session. + result: type: boolean - ip: + name: type: string - format: ipv4 - example: 8.8.8.8 - ipLocation: + example: DediPath + required: + - result + title: DataCenter + IpInfoResult: + type: object + description: >- + Details about the request IP address. Has separate fields for v4 and v6 + IP address versions. + additionalProperties: false + properties: + v4: type: object additionalProperties: false - deprecated: true - description: >- - This field is **deprecated** and will not return a result for - **applications created after January 23rd, 2024**. Please use the - [IP Geolocation Smart - signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) - for geolocation information. properties: - accuracyRadius: - description: >- - The IP address is likely to be within this radius (in km) of the - specified location. - type: integer - minimum: 0 - latitude: - type: number - format: double - minimum: -90 - maximum: 90 - longitude: - type: number - format: double - minimum: -180 - maximum: 180 - postalCode: - type: string - timezone: + address: type: string - format: timezone - city: - type: object - additionalProperties: false - title: DeprecatedIPLocationCity - properties: - name: - type: string - country: - $ref: '#/components/schemas/Location' - continent: - $ref: '#/components/schemas/Location' - subdivisions: - type: array - items: - $ref: '#/components/schemas/Subdivision' - title: DeprecatedIPLocation - timestamp: - description: Timestamp of the event with millisecond precision in Unix time. - type: integer - format: int64 - example: 1654815516086 - time: - title: Time - description: Time expressed according to ISO 8601 in UTC format. - type: string - format: date-time - example: '2022-06-09T22:58:36Z' - url: - description: Page URL from which the identification request was sent. - type: string - example: https://some.website/path?query=params - tag: - description: >- - A customer-provided value or an object that was sent with - identification request. + format: ipv4 + example: 94.142.239.124 + geolocation: + $ref: '#/components/schemas/IPLocation' + asn: + $ref: '#/components/schemas/ASN' + datacenter: + $ref: '#/components/schemas/DataCenter' + required: + - address + - geolocation + v6: type: object - additionalProperties: true - linkedId: - description: A customer-provided id that was sent with identification request. - type: string - example: someID - confidence: - $ref: '#/components/schemas/Confidence' - visitorFound: - description: Attribute represents if a visitor had been identified before. - type: boolean - firstSeenAt: - $ref: '#/components/schemas/SeenAt' - lastSeenAt: - $ref: '#/components/schemas/SeenAt' - required: - - browserDetails - - firstSeenAt - - incognito - - ip - - lastSeenAt - - requestId - - time - - timestamp - - url - - visitorFound - title: Visit - BrowserDetails: + additionalProperties: false + properties: + address: + type: string + format: ipv6 + example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 + geolocation: + $ref: '#/components/schemas/IPLocation' + asn: + $ref: '#/components/schemas/ASN' + datacenter: + $ref: '#/components/schemas/DataCenter' + required: + - address + - geolocation + IncognitoResult: type: object additionalProperties: false properties: - browserName: - type: string - example: Chrome - browserMajorVersion: - type: string - example: '101' - browserFullVersion: - type: string - example: 101.0.4951 - os: - type: string - example: Windows - osVersion: - type: string - example: '10' - device: - type: string - example: Other - userAgent: - type: string - example: >- - Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, - like Gecko) Chrome/101.0.4951.41 Safari/537.36 - botProbability: - type: integer + result: + type: boolean + description: > + `true` if we detected incognito mode used in the browser, `false` + otherwise. + example: false required: - - browserFullVersion - - browserMajorVersion - - browserName - - device - - os - - osVersion - - userAgent - title: BrowserDetails - Confidence: + - result + RootAppsResult: type: object additionalProperties: false properties: - score: - description: >- - The confidence score is a floating-point number between 0 and 1 that - represents the probability of accurate identification. - type: number - format: float - minimum: 0 - maximum: 1 - revision: - description: >- - The revision name of the method used to calculate the Confidence - score. This field is only present for customers who opted in to an - alternative calculation method. - type: string + result: + type: boolean + description: > + Android specific root management apps detection. There are 2 values: + • `true` - Root Management Apps detected (e.g. Magisk) • `false` - + No Root Management Apps detected or the client isn't Android. + example: false required: - - score - title: Confidence - SeenAt: + - result + EmulatorResult: type: object additionalProperties: false properties: - global: - type: string - nullable: true - format: date-time - example: '2022-05-05T18:28:54.535Z' - subscription: + result: + type: boolean + description: > + Android specific emulator detection. There are 2 values: • `true` - + Emulated environment detected (e.g. launch inside of AVD) • `false` + - No signs of emulated environment detected or the client is not + Android. + example: false + required: + - result + ClonedAppResult: + type: object + additionalProperties: false + properties: + result: + type: boolean + description: > + Android specific cloned application detection. There are 2 values: • + `true` - Presence of app cloners work detected (e.g. fully cloned + application found or launch of it inside of a not main working + profile detected). • `false` - No signs of cloned application + detected or the client is not Android. + example: false + required: + - result + FactoryResetResult: + type: object + additionalProperties: false + properties: + time: + description: > + Indicates the time (in UTC) of the most recent factory reset that + happened on the **mobile device**. + + When a factory reset cannot be detected on the mobile device or when + the request is initiated from a browser, this field will correspond + to the *epoch* time (i.e 1 Jan 1970 UTC). + + See [Factory Reset + Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) + to learn more about this Smart Signal. type: string - nullable: true format: date-time - example: '2022-06-09T22:58:05.576Z' + example: '2022-06-09T22:58:36Z' + timestamp: + description: > + This field is just another representation of the value in the `time` + field. + + The time of the most recent factory reset that happened on the + **mobile device** is expressed as Unix epoch time. + type: integer + format: int64 + example: 1654815517198 required: - - global - - subscription - title: SeenAt - example: - global: '2022-05-05T18:28:54.535Z' - subscription: null - ASN: + - time + - timestamp + JailbrokenResult: type: object additionalProperties: false properties: - asn: - type: string - example: '7922' - network: - type: string - example: 73.136.0.0/13 - name: - type: string - example: COMCAST-7922 + result: + type: boolean + description: > + iOS specific jailbreak detection. There are 2 values: • `true` - + Jailbreak detected • `false` - No signs of jailbreak or the client + is not iOS. + example: false required: - - asn - - network - title: ASN - DataCenter: + - result + FridaResult: type: object additionalProperties: false properties: result: type: boolean - name: - type: string - example: DediPath + description: > + [Frida](https://frida.re/docs/) detection for Android and iOS + devices. There are 2 values: • `true` - Frida detected • `false` - + No signs of Frida or the client is not a mobile device. + example: false required: - result - title: DataCenter - IPLocation: + IpBlockListResult: type: object additionalProperties: false properties: - accuracyRadius: - description: >- - The IP address is likely to be within this radius (in km) of the - specified location. - type: integer - minimum: 0 - example: 1000 - latitude: - type: number - format: double - minimum: -90 - maximum: 90 - example: 37.75 - longitude: - type: number - format: double - minimum: -180 - maximum: 180 - example: -97.82 - postalCode: - type: string - example: 130 00 - timezone: - type: string - format: timezone - example: America/Chicago - city: + result: + type: boolean + description: > + `true` if request IP address is part of any database that we use to + search for known malicious actors, `false` otherwise. + example: false + details: type: object additionalProperties: false - title: IPLocationCity properties: - name: - type: string - example: Prague - country: - $ref: '#/components/schemas/Location' - continent: - $ref: '#/components/schemas/Location' - subdivisions: - type: array - items: - $ref: '#/components/schemas/Subdivision' - title: IPLocation - Location: + emailSpam: + type: boolean + description: IP address was part of a known email spam attack (SMTP). + example: false + attackSource: + type: boolean + description: IP address was part of a known network attack (SSH/HTTPS). + example: false + required: + - emailSpam + - attackSource + required: + - result + - details + TorResult: type: object additionalProperties: false properties: - code: - type: string - minLength: 2 - maxLength: 2 - example: US - name: - type: string - example: United States - required: - - code - - name - title: Location - Subdivision: - type: object - additionalProperties: false - properties: - isoCode: - type: string - example: '10' - name: - type: string - example: Hlavni mesto Praha - ProductsResponse: - type: object - description: >- - Contains all information about the request identified by `requestId`, - depending on the pricing plan (Pro, Pro Plus, Enterprise) - additionalProperties: false - properties: - identification: - type: object - additionalProperties: false - title: ProductsResponseIdentification - properties: - data: - title: ProductsResponseIdentificationData - type: object - properties: - requestId: - description: Unique identifier of the user's identification request. - type: string - example: 1654815516083.OX6kx8 - browserDetails: - $ref: '#/components/schemas/BrowserDetails' - incognito: - description: Flag if user used incognito session. - type: boolean - ip: - type: string - format: ipv4 - example: 8.8.8.8 - ipLocation: - type: object - additionalProperties: false - deprecated: true - description: >- - This field is **deprecated** and will not return a result - for **applications created after January 23rd, 2024**. - Please use the [IP Geolocation Smart - signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) - for geolocation information. - properties: - accuracyRadius: - description: >- - The IP address is likely to be within this radius (in - km) of the specified location. - type: integer - minimum: 0 - latitude: - type: number - format: double - minimum: -90 - maximum: 90 - longitude: - type: number - format: double - minimum: -180 - maximum: 180 - postalCode: - type: string - timezone: - type: string - format: timezone - city: - type: object - additionalProperties: false - title: DeprecatedIPLocationCity - properties: - name: - type: string - country: - $ref: '#/components/schemas/Location' - continent: - $ref: '#/components/schemas/Location' - subdivisions: - type: array - items: - $ref: '#/components/schemas/Subdivision' - title: DeprecatedIPLocation - timestamp: - description: >- - Timestamp of the event with millisecond precision in Unix - time. - type: integer - format: int64 - example: 1654815516086 - time: - title: Time - description: Time expressed according to ISO 8601 in UTC format. - type: string - format: date-time - example: '2022-06-09T22:58:36Z' - url: - description: Page URL from which the identification request was sent. - type: string - example: https://some.website/path?query=params - tag: - description: >- - A customer-provided value or an object that was sent with - identification request. - type: object - additionalProperties: true - linkedId: - description: >- - A customer-provided id that was sent with identification - request. - type: string - example: someID - confidence: - $ref: '#/components/schemas/Confidence' - visitorFound: - description: >- - Attribute represents if a visitor had been identified - before. - type: boolean - firstSeenAt: - $ref: '#/components/schemas/SeenAt' - lastSeenAt: - $ref: '#/components/schemas/SeenAt' - visitorId: - type: string - description: > - String of 20 characters that uniquely identifies the - visitor's browser. - example: - - Ibk1527CUFmcnjLwIs4A - additionalProperties: false - required: - - browserDetails - - firstSeenAt - - incognito - - ip - - lastSeenAt - - requestId - - time - - timestamp - - url - - visitorFound - - visitorId - - tag - error: - $ref: '#/components/schemas/IdentificationError' - botd: - title: ProductsResponseBotd - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/BotdResult' - error: - $ref: '#/components/schemas/ProductError' - ipInfo: - title: SignalResponseIpInfo - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/IpInfoResult' - error: - $ref: '#/components/schemas/ProductError' - incognito: - title: SignalResponseIncognito - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/IncognitoResult' - error: - $ref: '#/components/schemas/IdentificationError' - rootApps: - title: SignalResponseRootApps - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/RootAppsResult' - error: - $ref: '#/components/schemas/ProductError' - emulator: - title: SignalResponseEmulator - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/EmulatorResult' - error: - $ref: '#/components/schemas/ProductError' - clonedApp: - title: SignalResponseClonedApp - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/ClonedAppResult' - error: - $ref: '#/components/schemas/ProductError' - factoryReset: - title: SignalResponseFactoryReset - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/FactoryResetResult' - error: - $ref: '#/components/schemas/ProductError' - jailbroken: - title: SignalResponseJailbroken - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/JailbrokenResult' - error: - $ref: '#/components/schemas/ProductError' - frida: - title: SignalResponseFrida - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/FridaResult' - error: - $ref: '#/components/schemas/ProductError' - ipBlocklist: - title: SignalResponseIpBlocklist - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/IpBlockListResult' - error: - $ref: '#/components/schemas/ProductError' - tor: - title: SignalResponseTor - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/TorResult' - error: - $ref: '#/components/schemas/ProductError' - privacySettings: - title: SignalResponsePrivacySettings - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/PrivacySettingsResult' - error: - $ref: '#/components/schemas/ProductError' - virtualMachine: - title: SignalResponseVirtualMachine - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/VirtualMachineResult' - error: - $ref: '#/components/schemas/ProductError' - vpn: - title: SignalResponseVpn - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/VpnResult' - error: - $ref: '#/components/schemas/ProductError' - proxy: - title: SignalResponseProxy - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/ProxyResult' - error: - $ref: '#/components/schemas/ProductError' - tampering: - title: SignalResponseTampering - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/TamperingResult' - error: - $ref: '#/components/schemas/IdentificationError' - highActivity: - title: SignalResponseHighActivity - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/HighActivityResult' - error: - $ref: '#/components/schemas/ProductError' - locationSpoofing: - title: SignalResponseLocationSpoofing - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/LocationSpoofingResult' - error: - $ref: '#/components/schemas/ProductError' - suspectScore: - title: SignalResponseSuspectScore - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/SuspectScoreResult' - error: - $ref: '#/components/schemas/ProductError' - rawDeviceAttributes: - title: SignalResponseRawDeviceAttributes - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/RawDeviceAttributesResult' - error: - $ref: '#/components/schemas/IdentificationError' - remoteControl: - title: SignalResponseRemoteControl - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/RemoteControlResult' - error: - $ref: '#/components/schemas/ProductError' - velocity: - title: SignalResponseVelocity - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/VelocityResult' - error: - $ref: '#/components/schemas/ProductError' - developerTools: - title: SignalResponseDeveloperTools - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/DeveloperToolsResult' - error: - $ref: '#/components/schemas/ProductError' - EventResponse: - description: >- - Contains results from all activated products - Fingerprint Pro, Bot - Detection, and others. - type: object - additionalProperties: false - properties: - products: - $ref: '#/components/schemas/ProductsResponse' - error: - $ref: '#/components/schemas/ProductError' - required: - - products - IdentificationError: - type: object - additionalProperties: false - properties: - code: - type: string - description: | - Error code: - * `429 Too Many Requests` - the limit on secret API key requests per second has been exceeded - * `Failed` - internal server error - enum: - - 429 Too Many Requests - - Failed - example: 429 Too Many Requests - message: - type: string - example: too many requests - required: - - code - - message - BotdResult: - type: object - additionalProperties: false - description: Contains all the information from Bot Detection product - properties: - ip: - type: string - format: ipv4 - example: 8.8.8.8 - description: IP address of the requesting browser or bot. - time: - title: Time - description: >- - Time in UTC when the request from the JS agent was made. We - recommend to treat requests that are older than 2 minutes as - malicious. Otherwise, request replay attacks are possible - type: string - format: date-time - example: '2022-06-09T22:58:36Z' - url: - description: Page URL from which identification request was sent. - type: string - example: https://example.com/login - userAgent: - type: string - example: >- - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 - (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 - requestId: - type: string - example: 1681392853693.lRiBBD - linkedId: - type: string - example: Automatic tests bot - bot: - $ref: '#/components/schemas/BotdDetectionResult' + result: + type: boolean + description: > + `true` if the request IP address is a known tor exit node, `false` + otherwise. + example: false required: - - bot - - url - - ip - - time - - userAgent - - requestId - BotdDetectionResult: + - result + PrivacySettingsResult: type: object additionalProperties: false - description: Stores bot detection result properties: result: - type: string - description: | - Bot detection result: - * `notDetected` - the visitor is not a bot - * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on - * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on - enum: - - notDetected - - good - - bad - example: bad - type: - type: string - example: selenium + type: boolean + description: > + `true` if the request is from a privacy aware browser (e.g. Tor) or + from a browser in which fingerprinting is blocked. Otherwise + `false`. + example: false required: - result - IpInfoResult: - type: object - description: >- - Details about the request IP address. Has separate fields for v4 and v6 - IP address versions. - additionalProperties: false - properties: - v4: - type: object - additionalProperties: false - properties: - address: - type: string - format: ipv4 - example: 94.142.239.124 - geolocation: - $ref: '#/components/schemas/IPLocation' - asn: - $ref: '#/components/schemas/ASN' - datacenter: - $ref: '#/components/schemas/DataCenter' - required: - - address - - geolocation - v6: - type: object - additionalProperties: false - properties: - address: - type: string - format: ipv6 - example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 - geolocation: - $ref: '#/components/schemas/IPLocation' - asn: - $ref: '#/components/schemas/ASN' - datacenter: - $ref: '#/components/schemas/DataCenter' - required: - - address - - geolocation - IpBlockListResult: + VirtualMachineResult: type: object additionalProperties: false properties: result: type: boolean description: > - `true` if request IP address is part of any database that we use to - search for known malicious actors, `false` otherwise. + `true` if the request came from a browser running inside a virtual + machine (e.g. VMWare), `false` otherwise. example: false - details: - type: object - additionalProperties: false - properties: - emailSpam: - type: boolean - description: IP address was part of a known email spam attack (SMTP). - example: false - attackSource: - type: boolean - description: IP address was part of a known network attack (SSH/HTTPS). - example: false - required: - - emailSpam - - attackSource required: - result - - details VpnResult: type: object additionalProperties: false @@ -1859,10 +1146,34 @@ components: - publicVPN - auxiliaryMobile - osMismatch + confidence: + type: string + enum: + - low + - medium + - high + description: >- + A confidence rating for the VPN detection result — "low", "medium", + or "high". Depends on the combination of results returned from all + VPN detection methods. + example: low required: - result - originTimezone - methods + - confidence + ProxyResult: + type: object + additionalProperties: false + properties: + result: + type: boolean + description: > + `true` if the request IP address is used by a public proxy provider, + `false` otherwise. + example: false + required: + - result TamperingResult: type: object additionalProperties: false @@ -1930,36 +1241,6 @@ components: example: 0 required: - result - VelocityResult: - type: object - description: > - Sums key data points for a specific `visitorId` at three distinct time - intervals: 5 minutes, 1 hour, and 24 hours as follows: - - - Number of identification events attributed to the visitor ID - Number - of distinct IP addresses associated to the visitor ID. - Number of - distinct countries associated with the visitor ID. - Number of distinct - `linkedId`s associated with the visitor ID. - - The `24h` interval of `distinctIp`, `distinctLinkedId`, and - `distinctCountry` will be omitted if the number of `events` for the - visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher - than 20.000. - additionalProperties: false - properties: - distinctIp: - $ref: '#/components/schemas/VelocityIntervals' - distinctLinkedId: - $ref: '#/components/schemas/VelocityIntervals' - distinctCountry: - $ref: '#/components/schemas/VelocityIntervals' - events: - $ref: '#/components/schemas/VelocityIntervals' - required: - - distinctIp - - distinctLinkedId - - distinctCountry - - events RawDeviceAttributesResult: type: object description: > @@ -1990,309 +1271,969 @@ components: - message title: error type: object - value: - title: value - FactoryResetResult: - type: object - additionalProperties: false - properties: - time: - description: > - Indicates the time (in UTC) of the most recent factory reset that - happened on the **mobile device**. - - When a factory reset cannot be detected on the mobile device or when - the request is initiated from a browser, this field will correspond - to the *epoch* time (i.e 1 Jan 1970 UTC). - - See [Factory Reset - Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) - to learn more about this Smart Signal. - type: string - format: date-time - example: '2022-06-09T22:58:36Z' - timestamp: - description: > - This field is just another representation of the value in the `time` - field. - - The time of the most recent factory reset that happened on the - **mobile device** is expressed as Unix epoch time. - type: integer - format: int64 - example: 1654815517198 - required: - - time - - timestamp - ClonedAppResult: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: > - Android specific cloned application detection. There are 2 values: • - `true` - Presence of app cloners work detected (e.g. fully cloned - application found or launch of it inside of a not main working - profile detected). • `false` - No signs of cloned application - detected or the client is not Android. - example: false - required: - - result - EmulatorResult: + value: + title: value + RemoteControlResult: type: object additionalProperties: false properties: result: type: boolean description: > - Android specific emulator detection. There are 2 values: • `true` - - Emulated environment detected (e.g. launch inside of AVD) • `false` - - No signs of emulated environment detected or the client is not - Android. + `true` if the request came from a machine being remotely controlled + (e.g. TeamViewer), `false` otherwise. example: false required: - result - RootAppsResult: + VelocityIntervalResult: type: object + description: > + Is absent if the velocity data could not be generated for the visitor + ID. additionalProperties: false properties: - result: - type: boolean + 5m: + type: integer + example: 1 + 1h: + type: integer + example: 1 + 24h: + type: integer description: > - Android specific root management apps detection. There are 2 values: - • `true` - Root Management Apps detected (e.g. Magisk) • `false` - - No Root Management Apps detected or the client isn't Android. - example: false + The `24h` interval of `distinctIp`, `distinctLinkedId`, and + `distinctCountry` will be omitted if the number of `events`` for the + visitor ID in the last 24 hours (`events.intervals.['24h']`) is + higher than 20.000. + example: 1 required: - - result - IncognitoResult: + - 5m + - 1h + VelocityIntervals: type: object additionalProperties: false properties: - result: - type: boolean - description: > - `true` if we detected incognito mode used in the browser, `false` - otherwise. - example: false + intervals: + $ref: '#/components/schemas/VelocityIntervalResult' + VelocityResult: + type: object + description: > + Sums key data points for a specific `visitorId` at three distinct time + intervals: 5 minutes, 1 hour, and 24 hours as follows: + + - Number of identification events attributed to the visitor ID - Number + of distinct IP addresses associated to the visitor ID. - Number of + distinct countries associated with the visitor ID. - Number of distinct + `linkedId`s associated with the visitor ID. + + The `24h` interval of `distinctIp`, `distinctLinkedId`, and + `distinctCountry` will be omitted if the number of `events` for the + visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher + than 20.000. + additionalProperties: false + properties: + distinctIp: + $ref: '#/components/schemas/VelocityIntervals' + distinctLinkedId: + $ref: '#/components/schemas/VelocityIntervals' + distinctCountry: + $ref: '#/components/schemas/VelocityIntervals' + events: + $ref: '#/components/schemas/VelocityIntervals' required: - - result - JailbrokenResult: + - distinctIp + - distinctLinkedId + - distinctCountry + - events + DeveloperToolsResult: type: object additionalProperties: false properties: result: type: boolean description: > - iOS specific jailbreak detection. There are 2 values: • `true` - - Jailbreak detected • `false` - No signs of jailbreak or the client - is not iOS. + `true` if the browser is Chrome with DevTools open or Firefox with + Developer Tools open, `false` otherwise. example: false required: - result - FridaResult: + ProductsResponse: + type: object + description: >- + Contains all information about the request identified by `requestId`, + depending on the pricing plan (Pro, Pro Plus, Enterprise) + additionalProperties: false + properties: + identification: + type: object + additionalProperties: false + title: ProductsResponseIdentification + properties: + data: + title: ProductsResponseIdentificationData + type: object + properties: + requestId: + description: Unique identifier of the user's identification request. + type: string + example: 1654815516083.OX6kx8 + browserDetails: + $ref: '#/components/schemas/BrowserDetails' + incognito: + description: Flag if user used incognito session. + type: boolean + ip: + type: string + format: ipv4 + example: 8.8.8.8 + ipLocation: + type: object + additionalProperties: false + deprecated: true + description: >- + This field is **deprecated** and will not return a result + for **applications created after January 23rd, 2024**. + Please use the [IP Geolocation Smart + signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) + for geolocation information. + properties: + accuracyRadius: + description: >- + The IP address is likely to be within this radius (in + km) of the specified location. + type: integer + minimum: 0 + latitude: + type: number + format: double + minimum: -90 + maximum: 90 + longitude: + type: number + format: double + minimum: -180 + maximum: 180 + postalCode: + type: string + timezone: + type: string + format: timezone + city: + type: object + additionalProperties: false + title: DeprecatedIPLocationCity + properties: + name: + type: string + country: + $ref: '#/components/schemas/Location' + continent: + $ref: '#/components/schemas/Location' + subdivisions: + type: array + items: + $ref: '#/components/schemas/Subdivision' + title: DeprecatedIPLocation + timestamp: + description: >- + Timestamp of the event with millisecond precision in Unix + time. + type: integer + format: int64 + example: 1654815516086 + time: + title: Time + description: Time expressed according to ISO 8601 in UTC format. + type: string + format: date-time + example: '2022-06-09T22:58:36Z' + url: + description: Page URL from which the identification request was sent. + type: string + example: https://some.website/path?query=params + tag: + description: >- + A customer-provided value or an object that was sent with + identification request. + type: object + additionalProperties: true + linkedId: + description: >- + A customer-provided id that was sent with identification + request. + type: string + example: someID + confidence: + $ref: '#/components/schemas/Confidence' + visitorFound: + description: >- + Attribute represents if a visitor had been identified + before. + type: boolean + firstSeenAt: + $ref: '#/components/schemas/SeenAt' + lastSeenAt: + $ref: '#/components/schemas/SeenAt' + visitorId: + type: string + description: > + String of 20 characters that uniquely identifies the + visitor's browser. + example: + - Ibk1527CUFmcnjLwIs4A + additionalProperties: false + required: + - browserDetails + - firstSeenAt + - incognito + - ip + - lastSeenAt + - requestId + - time + - timestamp + - url + - visitorFound + - visitorId + - tag + error: + $ref: '#/components/schemas/IdentificationError' + botd: + title: ProductsResponseBotd + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/BotdResult' + error: + $ref: '#/components/schemas/ProductError' + ipInfo: + title: SignalResponseIpInfo + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/IpInfoResult' + error: + $ref: '#/components/schemas/ProductError' + incognito: + title: SignalResponseIncognito + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/IncognitoResult' + error: + $ref: '#/components/schemas/IdentificationError' + rootApps: + title: SignalResponseRootApps + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/RootAppsResult' + error: + $ref: '#/components/schemas/ProductError' + emulator: + title: SignalResponseEmulator + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/EmulatorResult' + error: + $ref: '#/components/schemas/ProductError' + clonedApp: + title: SignalResponseClonedApp + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/ClonedAppResult' + error: + $ref: '#/components/schemas/ProductError' + factoryReset: + title: SignalResponseFactoryReset + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/FactoryResetResult' + error: + $ref: '#/components/schemas/ProductError' + jailbroken: + title: SignalResponseJailbroken + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/JailbrokenResult' + error: + $ref: '#/components/schemas/ProductError' + frida: + title: SignalResponseFrida + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/FridaResult' + error: + $ref: '#/components/schemas/ProductError' + ipBlocklist: + title: SignalResponseIpBlocklist + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/IpBlockListResult' + error: + $ref: '#/components/schemas/ProductError' + tor: + title: SignalResponseTor + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/TorResult' + error: + $ref: '#/components/schemas/ProductError' + privacySettings: + title: SignalResponsePrivacySettings + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/PrivacySettingsResult' + error: + $ref: '#/components/schemas/ProductError' + virtualMachine: + title: SignalResponseVirtualMachine + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/VirtualMachineResult' + error: + $ref: '#/components/schemas/ProductError' + vpn: + title: SignalResponseVpn + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/VpnResult' + error: + $ref: '#/components/schemas/ProductError' + proxy: + title: SignalResponseProxy + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/ProxyResult' + error: + $ref: '#/components/schemas/ProductError' + tampering: + title: SignalResponseTampering + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/TamperingResult' + error: + $ref: '#/components/schemas/IdentificationError' + highActivity: + title: SignalResponseHighActivity + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/HighActivityResult' + error: + $ref: '#/components/schemas/ProductError' + locationSpoofing: + title: SignalResponseLocationSpoofing + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/LocationSpoofingResult' + error: + $ref: '#/components/schemas/ProductError' + suspectScore: + title: SignalResponseSuspectScore + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/SuspectScoreResult' + error: + $ref: '#/components/schemas/ProductError' + rawDeviceAttributes: + title: SignalResponseRawDeviceAttributes + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/RawDeviceAttributesResult' + error: + $ref: '#/components/schemas/IdentificationError' + remoteControl: + title: SignalResponseRemoteControl + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/RemoteControlResult' + error: + $ref: '#/components/schemas/ProductError' + velocity: + title: SignalResponseVelocity + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/VelocityResult' + error: + $ref: '#/components/schemas/ProductError' + developerTools: + title: SignalResponseDeveloperTools + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/DeveloperToolsResult' + error: + $ref: '#/components/schemas/ProductError' + EventResponse: + description: >- + Contains results from all activated products - Fingerprint Pro, Bot + Detection, and others. type: object additionalProperties: false properties: - result: - type: boolean - description: > - [Frida](https://frida.re/docs/) detection for Android and iOS - devices. There are 2 values: • `true` - Frida detected • `false` - - No signs of Frida or the client is not a mobile device. - example: false + products: + $ref: '#/components/schemas/ProductsResponse' + error: + $ref: '#/components/schemas/ProductError' required: - - result - TorResult: + - products + ErrorCommon403Response: type: object additionalProperties: false properties: - result: - type: boolean - description: > - `true` if the request IP address is a known tor exit node, `false` - otherwise. - example: false - required: - - result - PrivacySettingsResult: + error: + type: object + additionalProperties: false + title: Common403ErrorResponse + properties: + code: + type: string + description: | + Error code: + * `TokenRequired` - `Auth-API-Key` header is missing or empty + * `TokenNotFound` - No Fingerprint application found for specified secret key + * `SubscriptionNotActive` - Fingerprint application is not active + * `WrongRegion` - server and application region differ + * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application + enum: + - TokenRequired + - TokenNotFound + - SubscriptionNotActive + - WrongRegion + - FeatureNotEnabled + example: TokenRequired + message: + type: string + example: secret key is required + required: + - code + - message + ErrorEvent404Response: type: object additionalProperties: false properties: - result: - type: boolean - description: > - `true` if the request is from a privacy aware browser (e.g. Tor) or - from a browser in which fingerprinting is blocked. Otherwise - `false`. - example: false - required: - - result - VirtualMachineResult: + error: + type: object + additionalProperties: false + title: ErrorEvent404ResponseError + properties: + code: + type: string + description: | + Error code: + * `RequestNotFound` - The specified request ID was not found. It never existed, expired, or it has been deleted. + enum: + - RequestNotFound + example: RequestNotFound + message: + type: string + example: request id is not found + required: + - code + - message + EventUpdateRequest: type: object - additionalProperties: false properties: - result: + linkedId: + type: string + description: LinkedID value to assign to the existing event + tag: + type: object + description: >- + Full `tag` value to be set to the existing event. Replaces any + existing `tag` payload completely. + suspect: type: boolean - description: > - `true` if the request came from a browser running inside a virtual - machine (e.g. VMWare), `false` otherwise. - example: false - required: - - result - ProxyResult: + description: Suspect flag indicating observed suspicious or fraudulent event + ErrorUpdateEvent400Response: type: object additionalProperties: false properties: - result: - type: boolean - description: > - `true` if the request IP address is used by a public proxy provider, - `false` otherwise. - example: false - required: - - result - ProductError: + error: + type: object + additionalProperties: false + title: ErrorUpdateEvent400ResponseError + properties: + code: + type: string + description: > + Error code: * `RequestCannotBeParsed` - the JSON content of the + request contains some errors that prevented us from parsing it + (wrong type/surpassed limits) * `Failed` - the event is more + than 10 days old and cannot be updated + enum: + - RequestCannotBeParsed + - Failed + example: RequestCannotBeParsed + message: + type: string + description: Details about the underlying issue with the input payload + example: suspect flag must be a boolean + required: + - code + - message + ErrorUpdateEvent409Response: type: object additionalProperties: false properties: - code: - type: string - description: | - Error code: - * `TooManyRequests` - the limit on secret API key requests per second has been exceeded - * `Failed` - internal server error - enum: - - TooManyRequests - - Failed - example: TooManyRequests - message: - type: string - example: too many requests - required: - - code - - message - RemoteControlResult: + error: + type: object + additionalProperties: false + title: ErrorUpdateEvent409ResponseError + properties: + code: + type: string + description: > + Error code: * `StateNotReady` - The event specified with request + id is not ready for updates yet. Try again. + + This error happens in rare cases when update API is called + immediately after receiving the request id on the client. In + case you need to send information right away, we recommend using + the JS agent API instead. + enum: + - StateNotReady + example: StateNotReady + message: + type: string + example: resource is not mutable yet, try again + required: + - code + - message + Response: type: object additionalProperties: false properties: - result: - type: boolean + visitorId: + type: string + visits: + type: array + items: + title: ResponseVisits + type: object + properties: + requestId: + description: Unique identifier of the user's identification request. + type: string + example: 1654815516083.OX6kx8 + browserDetails: + $ref: '#/components/schemas/BrowserDetails' + incognito: + description: Flag if user used incognito session. + type: boolean + ip: + type: string + format: ipv4 + example: 8.8.8.8 + ipLocation: + type: object + additionalProperties: false + deprecated: true + description: >- + This field is **deprecated** and will not return a result for + **applications created after January 23rd, 2024**. Please use + the [IP Geolocation Smart + signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) + for geolocation information. + properties: + accuracyRadius: + description: >- + The IP address is likely to be within this radius (in km) + of the specified location. + type: integer + minimum: 0 + latitude: + type: number + format: double + minimum: -90 + maximum: 90 + longitude: + type: number + format: double + minimum: -180 + maximum: 180 + postalCode: + type: string + timezone: + type: string + format: timezone + city: + type: object + additionalProperties: false + title: DeprecatedIPLocationCity + properties: + name: + type: string + country: + $ref: '#/components/schemas/Location' + continent: + $ref: '#/components/schemas/Location' + subdivisions: + type: array + items: + $ref: '#/components/schemas/Subdivision' + title: DeprecatedIPLocation + timestamp: + description: >- + Timestamp of the event with millisecond precision in Unix + time. + type: integer + format: int64 + example: 1654815516086 + time: + title: Time + description: Time expressed according to ISO 8601 in UTC format. + type: string + format: date-time + example: '2022-06-09T22:58:36Z' + url: + description: Page URL from which the identification request was sent. + type: string + example: https://some.website/path?query=params + tag: + description: >- + A customer-provided value or an object that was sent with + identification request. + type: object + additionalProperties: true + linkedId: + description: >- + A customer-provided id that was sent with identification + request. + type: string + example: someID + confidence: + $ref: '#/components/schemas/Confidence' + visitorFound: + description: Attribute represents if a visitor had been identified before. + type: boolean + firstSeenAt: + $ref: '#/components/schemas/SeenAt' + lastSeenAt: + $ref: '#/components/schemas/SeenAt' + additionalProperties: false + required: + - browserDetails + - firstSeenAt + - incognito + - ip + - lastSeenAt + - requestId + - time + - timestamp + - url + - visitorFound + - tag + lastTimestamp: description: > - `true` if the request came from a machine being remotely controlled - (e.g. TeamViewer), `false` otherwise. - example: false + ⚠️ Deprecated paging attribute, please use `paginationKey` instead. + Timestamp of the last visit in the current page of results. + type: integer + format: int64 + example: 1654815517198 + paginationKey: + description: >- + Request ID of the last visit in the current page of results. Use + this value in the following request as the `paginationKey` parameter + to get the next page of results. + type: string + example: 1654815517198.azN4IZ required: - - result - DeveloperToolsResult: + - visitorId + - visits + title: PaginatedResponse + description: >- + Fields `lastTimestamp` and `paginationKey` added when `limit` or + `before` parameter provided and there is more data to show + ErrorVisits403: type: object additionalProperties: false properties: - result: - type: boolean - description: > - `true` if the browser is Chrome with DevTools open or Firefox with - Developer Tools open, `false` otherwise. - example: false + error: + type: string + description: Error text. + example: Forbidden (HTTP 403) required: - - result - EventUpdateRequest: + - error + TooManyRequestsResponse: type: object + additionalProperties: false properties: - linkedId: + error: type: string - description: LinkedID value to assign to the existing event - tag: - type: object - description: >- - Full `tag` value to be set to the existing event. Replaces any - existing `tag` payload completely. - suspect: - type: boolean - description: Suspect flag indicating observed suspicious or fraudulent event - ErrorUpdateEvent400Response: + description: Error text. + example: request throttled + required: + - error + ErrorVisitor400Response: type: object additionalProperties: false properties: error: type: object additionalProperties: false - title: ErrorUpdateEvent400ResponseError properties: code: type: string description: > - Error code: * `RequestCannotBeParsed` - the JSON content of the - request contains some errors that prevented us from parsing it - (wrong type/surpassed limits) * `Failed` - the event is more - than 10 days old and cannot be updated + Error code: * `RequestCannotBeParsed` - The visitor ID parameter + is missing or in the wrong format. enum: - RequestCannotBeParsed - - Failed example: RequestCannotBeParsed message: type: string - description: Details about the underlying issue with the input payload - example: suspect flag must be a boolean + example: invalid visitor id required: - code - message - ErrorUpdateEvent409Response: + ErrorVisitor404Response: type: object additionalProperties: false properties: error: type: object additionalProperties: false - title: ErrorUpdateEvent409ResponseError + title: ErrorVisitor404ResponseError properties: code: type: string description: > - Error code: * `StateNotReady` - The event specified with request - id is not ready for updates yet. Try again. - - This error happens in rare cases when update API is called - immediately after receiving the request id on the client. In - case you need to send information right away, we recommend using - the JS agent API instead. + Error code: * `VisitorNotFound` - The specified visitor ID was + not found. It never existed or it may have already been deleted. enum: - - StateNotReady - example: StateNotReady + - VisitorNotFound + example: VisitorNotFound message: type: string - example: resource is not mutable yet, try again + example: visitor not found required: - code - message - VelocityIntervals: + ErrorCommon429Response: type: object additionalProperties: false properties: - intervals: - $ref: '#/components/schemas/VelocityIntervalResult' - VelocityIntervalResult: + error: + type: object + additionalProperties: false + properties: + code: + type: string + description: | + Error code: * `TooManyRequests` - The request is throttled. + enum: + - TooManyRequests + example: TooManyRequests + message: + type: string + example: request throttled + required: + - code + - message + WebhookVisit: type: object - description: > - Is absent if the velocity data could not be generated for the visitor - ID. - additionalProperties: false properties: - 5m: - type: integer - example: 1 - 1h: - type: integer - example: 1 - 24h: + visitorId: + type: string + example: 3HNey93AkBW6CRbxV6xP + clientReferrer: + type: string + example: https://google.com?search=banking+services + userAgent: + type: string + example: >- + Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 + (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 + bot: + $ref: '#/components/schemas/BotdDetectionResult' + ipInfo: + $ref: '#/components/schemas/IpInfoResult' + incognito: + description: Flag if user used incognito session. + type: boolean + rootApps: + $ref: '#/components/schemas/RootAppsResult' + emulator: + $ref: '#/components/schemas/EmulatorResult' + clonedApp: + $ref: '#/components/schemas/ClonedAppResult' + factoryReset: + $ref: '#/components/schemas/FactoryResetResult' + jailbroken: + $ref: '#/components/schemas/JailbrokenResult' + frida: + $ref: '#/components/schemas/FridaResult' + ipBlocklist: + $ref: '#/components/schemas/IpBlockListResult' + tor: + $ref: '#/components/schemas/TorResult' + privacySettings: + $ref: '#/components/schemas/PrivacySettingsResult' + virtualMachine: + $ref: '#/components/schemas/VirtualMachineResult' + vpn: + $ref: '#/components/schemas/VpnResult' + proxy: + $ref: '#/components/schemas/ProxyResult' + tampering: + $ref: '#/components/schemas/TamperingResult' + rawDeviceAttributes: + $ref: '#/components/schemas/RawDeviceAttributesResult' + highActivity: + $ref: '#/components/schemas/HighActivityResult' + locationSpoofing: + $ref: '#/components/schemas/LocationSpoofingResult' + suspectScore: + $ref: '#/components/schemas/SuspectScoreResult' + remoteControl: + $ref: '#/components/schemas/RemoteControlResult' + velocity: + $ref: '#/components/schemas/VelocityResult' + developerTools: + $ref: '#/components/schemas/DeveloperToolsResult' + requestId: + description: Unique identifier of the user's identification request. + type: string + example: 1654815516083.OX6kx8 + browserDetails: + $ref: '#/components/schemas/BrowserDetails' + ip: + type: string + format: ipv4 + example: 8.8.8.8 + ipLocation: + type: object + additionalProperties: false + deprecated: true + description: >- + This field is **deprecated** and will not return a result for + **applications created after January 23rd, 2024**. Please use the + [IP Geolocation Smart + signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) + for geolocation information. + properties: + accuracyRadius: + description: >- + The IP address is likely to be within this radius (in km) of the + specified location. + type: integer + minimum: 0 + latitude: + type: number + format: double + minimum: -90 + maximum: 90 + longitude: + type: number + format: double + minimum: -180 + maximum: 180 + postalCode: + type: string + timezone: + type: string + format: timezone + city: + type: object + additionalProperties: false + title: DeprecatedIPLocationCity + properties: + name: + type: string + country: + $ref: '#/components/schemas/Location' + continent: + $ref: '#/components/schemas/Location' + subdivisions: + type: array + items: + $ref: '#/components/schemas/Subdivision' + title: DeprecatedIPLocation + timestamp: + description: Timestamp of the event with millisecond precision in Unix time. type: integer - description: > - The `24h` interval of `distinctIp`, `distinctLinkedId`, and - `distinctCountry` will be omitted if the number of `events`` for the - visitor ID in the last 24 hours (`events.intervals.['24h']`) is - higher than 20.000. - example: 1 + format: int64 + example: 1654815516086 + time: + title: Time + description: Time expressed according to ISO 8601 in UTC format. + type: string + format: date-time + example: '2022-06-09T22:58:36Z' + url: + description: Page URL from which the identification request was sent. + type: string + example: https://some.website/path?query=params + tag: + description: >- + A customer-provided value or an object that was sent with + identification request. + type: object + additionalProperties: true + linkedId: + description: A customer-provided id that was sent with identification request. + type: string + example: someID + confidence: + $ref: '#/components/schemas/Confidence' + visitorFound: + description: Attribute represents if a visitor had been identified before. + type: boolean + firstSeenAt: + $ref: '#/components/schemas/SeenAt' + lastSeenAt: + $ref: '#/components/schemas/SeenAt' + additionalProperties: false required: - - 5m - - 1h + - visitorId + - browserDetails + - firstSeenAt + - incognito + - ip + - lastSeenAt + - requestId + - time + - timestamp + - url + - visitorFound diff --git a/test/mocks/get_event_200.json b/test/mocks/get_event_200.json index 6361db17..025ff4a4 100644 --- a/test/mocks/get_event_200.json +++ b/test/mocks/get_event_200.json @@ -180,7 +180,8 @@ "publicVPN": false, "auxiliaryMobile": false, "osMismatch": false - } + }, + "confidence": "high" } }, "proxy": { diff --git a/test/mocks/get_event_200_identification_too_many_requests_error_all_fields.json b/test/mocks/get_event_200_identification_too_many_requests_error_all_fields.json new file mode 100644 index 00000000..06462139 --- /dev/null +++ b/test/mocks/get_event_200_identification_too_many_requests_error_all_fields.json @@ -0,0 +1,112 @@ +{ + "products": { + "identification": { + "error": { + "code": "429 Too Many Requests", + "message": "too many requests" + } + }, + "botd": { + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } + }, + "rootApps": { + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } + }, + "emulator": { + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } + }, + "ipInfo": { + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } + }, + "ipBlocklist": { + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } + }, + "tor": { + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } + }, + "vpn": { + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } + }, + "proxy": { + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } + }, + "incognito": { + "error": { + "code": "429 Too Many Requests", + "message": "too many requests" + } + }, + "tampering": { + "error": { + "code": "429 Too Many Requests", + "message": "too many requests" + } + }, + "clonedApp": { + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } + }, + "factoryReset": { + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } + }, + "jailbroken": { + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } + }, + "frida": { + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } + }, + "privacySettings": { + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } + }, + "virtualMachine": { + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } + }, + "rawDeviceAttributes": { + "error": { + "code": "429 Too Many Requests", + "message": "too many requests" + } + } + } +} diff --git a/test/mocks/get_event_200_wrong_shape.json b/test/mocks/get_event_200_wrong_shape.json deleted file mode 100644 index 3eb426a8..00000000 --- a/test/mocks/get_event_200_wrong_shape.json +++ /dev/null @@ -1,310 +0,0 @@ -{ - "products": { - "identification": { - "data": { - "visitorId": "Ibk1527CUFmcnjLwIs4A9", - "requestId": "1708102555327.NLOjmg", - "incognito": "Chrome", - "linkedId": { - "id": 1234567890 - }, - "tag": {}, - "time": "2019-05-21T16:40:13Z", - "timestamp": 1582299576512, - "url": "https://www.example.com/login?hope{this{works[!", - "ip": "61.127.217.15", - "ipLocation": { - "accuracyRadius": 10, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "61202", - "timezone": "Europe/Dusseldorf", - "city": { - "name": "Dusseldorf" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "63", - "name": "North Rhine-Westphalia" - } - ] - }, - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "74", - "browserFullVersion": "74.0.3729", - "os": "Windows", - "osVersion": "7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." - }, - "confidence": { - "score": 0.97 - }, - "visitorFound": false, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": null, - "subscription": null - } - } - }, - "botd": { - "data": { - "bot": { - "result": "notDetected" - }, - "url": "https://www.example.com/login?hope{this{works}[!", - "ip": "61.127.217.15", - "time": "2019-05-21T16:40:13Z", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36", - "requestId": "1708102555327.NLOjmg" - } - }, - "rootApps": { - "data": { - "result": false - } - }, - "emulator": { - "data": { - "result": false - } - }, - "ipInfo": { - "data": { - "v4": { - "address": "94.142.239.124", - "geolocation": { - "accuracyRadius": 20, - "latitude": 50.05, - "longitude": 14.4, - "postalCode": "150 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "asn": { - "asn": "7922", - "name": "COMCAST-7922", - "network": "73.136.0.0/13" - }, - "datacenter": { - "result": true, - "name": "DediPath" - } - }, - "v6": { - "address": "2001:db8:3333:4444:5555:6666:7777:8888", - "geolocation": { - "accuracyRadius": 5, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "10112", - "timezone": "Europe/Berlin", - "city": { - "name": "Berlin" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "BE", - "name": "Land Berlin" - } - ] - }, - "asn": { - "asn": "6805", - "name": "Telefonica Germany", - "network": "2a02:3100::/24" - }, - "datacenter": { - "result": false, - "name": "" - } - } - } - }, - "ipBlocklist": { - "data": { - "result": false, - "details": { - "emailSpam": false, - "attackSource": false - } - } - }, - "tor": { - "data": { - "result": false - } - }, - "vpn": { - "data": { - "result": false, - "originTimezone": "Europe/Berlin", - "originCountry": "unknown", - "methods": { - "timezoneMismatch": false, - "publicVPN": false, - "auxiliaryMobile": false, - "osMismatch": false - } - } - }, - "proxy": { - "data": { - "result": false - } - }, - "incognito": { - "data": { - "result": false - } - }, - "tampering": { - "data": { - "result": false, - "anomalyScore": 0.1955 - } - }, - "clonedApp": { - "data": { - "result": false - } - }, - "factoryReset": { - "data": { - "time": "1970-01-01T00:00:00Z", - "timestamp": 0 - } - }, - "jailbroken": { - "data": { - "result": false - } - }, - "frida": { - "data": { - "result": false - } - }, - "privacySettings": { - "data": { - "result": false - } - }, - "virtualMachine": { - "data": { - "result": false - } - }, - "rawDeviceAttributes": { - "data": { - "architecture": { - "value": 127 - }, - "audio": { - "value": 35.73832903057337 - }, - "canvas": { - "value": { - "Winding": true, - "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", - "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" - } - }, - "colorDepth": { - "value": 30 - }, - "colorGamut": { - "value": "p3" - }, - "contrast": { - "value": 0 - }, - "cookiesEnabled": { - "value": true - }, - "cpuClass": {}, - "fonts": { - "value": ["Arial Unicode MS", "Gill Sans", "Helvetica Neue", "Menlo"] - } - } - }, - "highActivity": { - "data": { - "result": false - } - }, - "locationSpoofing": { - "data": { - "result": false - } - }, - "remoteControl": { - "data": { - "result": false - } - }, - "velocity": { - "data": { - "distinctIp": { - "intervals": { - "5m": 1, - "1h": 1, - "24h": 1 - } - }, - "distinctLinkedId": {}, - "distinctCountry": { - "intervals": { - "5m": 1, - "1h": 2, - "24h": 2 - } - }, - "events": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - } - } - } - } -}} diff --git a/test/mocks/get_visits_429_too_many_requests_error_empty_header.json b/test/mocks/get_visits_429_too_many_requests_error_empty_header.json deleted file mode 100644 index 00d00f2e..00000000 --- a/test/mocks/get_visits_429_too_many_requests_error_empty_header.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "error": "too many requests" -} diff --git a/test/mocks/related-visitors/get_related_visitors_200.json b/test/mocks/related-visitors/get_related_visitors_200.json new file mode 100644 index 00000000..7a46a69e --- /dev/null +++ b/test/mocks/related-visitors/get_related_visitors_200.json @@ -0,0 +1,10 @@ +{ + "relatedVisitors": [ + { + "visitorId": "NtCUJGceWX9RpvSbhvOm" + }, + { + "visitorId": "25ee02iZwGxeyT0jMNkZ" + } + ] +} diff --git a/test/mocks/related-visitors/get_related_visitors_200_empty.json b/test/mocks/related-visitors/get_related_visitors_200_empty.json new file mode 100644 index 00000000..6c9b02c1 --- /dev/null +++ b/test/mocks/related-visitors/get_related_visitors_200_empty.json @@ -0,0 +1,3 @@ +{ + "relatedVisitors": [] +} diff --git a/test/mocks/sealed_result.json b/test/mocks/sealed_result.json deleted file mode 100644 index 718764bc..00000000 --- a/test/mocks/sealed_result.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "products": { - "identification": { - "data": { - "visitorId": "2ZEDCZEfOfXjEmMuE3tq", - "requestId": "1703067132750.Z5hutJ", - "browserDetails": { - "browserName": "Safari", - "browserMajorVersion": "17", - "browserFullVersion": "17.3", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Safari/605.1.15" - }, - "incognito": false, - "ip": "::1", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 59.3241, - "longitude": 18.0517, - "postalCode": "100 05", - "timezone": "Europe/Stockholm", - "city": { - "name": "Stockholm" - }, - "country": { - "code": "SE", - "name": "Sweden" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "AB", - "name": "Stockholm County" - } - ] - }, - "timestamp": 1703067136286, - "time": "2023-12-20T10:12:16Z", - "url": "http://localhost:8080/", - "tag": { - "foo": "bar" - }, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2023-12-15T12:13:55.103Z", - "subscription": "2023-12-15T12:13:55.103Z" - }, - "lastSeenAt": { - "global": "2023-12-19T11:39:51.52Z", - "subscription": "2023-12-19T11:39:51.52Z" - } - } - }, - "botd": { - "data": { - "bot": { - "result": "notDetected" - }, - "meta": { - "foo": "bar" - }, - "url": "http://localhost:8080/", - "ip": "::1", - "time": "2023-12-20T10:12:13.894Z", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Safari/605.1.15", - "requestId": "1703067132750.Z5hutJ" - } - } - } -} \ No newline at end of file diff --git a/test/mocks/400_error_empty_visitor_id.json b/test/mocks/shared/400_error_empty_visitor_id.json similarity index 100% rename from test/mocks/400_error_empty_visitor_id.json rename to test/mocks/shared/400_error_empty_visitor_id.json diff --git a/test/mocks/400_error_incorrect_visitor_id.json b/test/mocks/shared/400_error_incorrect_visitor_id.json similarity index 100% rename from test/mocks/400_error_incorrect_visitor_id.json rename to test/mocks/shared/400_error_incorrect_visitor_id.json diff --git a/test/mocks/403_error_feature_not_enabled.json b/test/mocks/shared/403_error_feature_not_enabled.json similarity index 100% rename from test/mocks/403_error_feature_not_enabled.json rename to test/mocks/shared/403_error_feature_not_enabled.json diff --git a/test/mocks/403_error_token_not_found.json b/test/mocks/shared/403_error_token_not_found.json similarity index 100% rename from test/mocks/403_error_token_not_found.json rename to test/mocks/shared/403_error_token_not_found.json diff --git a/test/mocks/403_error_token_required.json b/test/mocks/shared/403_error_token_required.json similarity index 100% rename from test/mocks/403_error_token_required.json rename to test/mocks/shared/403_error_token_required.json diff --git a/test/mocks/403_error_wrong_region.json b/test/mocks/shared/403_error_wrong_region.json similarity index 100% rename from test/mocks/403_error_wrong_region.json rename to test/mocks/shared/403_error_wrong_region.json diff --git a/test/mocks/404_error_visitor_not_found.json b/test/mocks/shared/404_error_visitor_not_found.json similarity index 100% rename from test/mocks/404_error_visitor_not_found.json rename to test/mocks/shared/404_error_visitor_not_found.json diff --git a/test/mocks/429_error_too_many_requests.json b/test/mocks/shared/429_error_too_many_requests.json similarity index 100% rename from test/mocks/429_error_too_many_requests.json rename to test/mocks/shared/429_error_too_many_requests.json diff --git a/test/mocks/update_event_multiple_fields_request.json b/test/mocks/update_event_multiple_fields_request.json new file mode 100644 index 00000000..f85d2e75 --- /dev/null +++ b/test/mocks/update_event_multiple_fields_request.json @@ -0,0 +1,7 @@ +{ + "linkedId": "myNewLinkedId", + "tag": { + "myTag": "myNewValue" + }, + "suspect": true +} diff --git a/test/mocks/update_event_one_field_request.json b/test/mocks/update_event_one_field_request.json new file mode 100644 index 00000000..0ebd1549 --- /dev/null +++ b/test/mocks/update_event_one_field_request.json @@ -0,0 +1,3 @@ +{ + "linkedId": "myNewLinkedId" +} diff --git a/test/mocks/webhook.json b/test/mocks/webhook.json index 15332a06..ceab1c79 100644 --- a/test/mocks/webhook.json +++ b/test/mocks/webhook.json @@ -125,7 +125,8 @@ "publicVPN": false, "auxiliaryMobile": false, "osMismatch": false - } + }, + "confidence": "high" }, "proxy": { "result": false From 9a5ceb2c0d5316b2ebf455ce946c1d5ff7ed84fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Mon, 7 Oct 2024 12:11:18 +0200 Subject: [PATCH 2/3] test: fix tests --- .../get_event_200_with_broken_format.json | 283 ++++++++++++++++++ test/test_fingerprint_api.py | 27 +- test/test_sealed.py | 105 ++++++- 3 files changed, 392 insertions(+), 23 deletions(-) create mode 100644 test/mocks/get_event_200_with_broken_format.json diff --git a/test/mocks/get_event_200_with_broken_format.json b/test/mocks/get_event_200_with_broken_format.json new file mode 100644 index 00000000..4ac8b6f5 --- /dev/null +++ b/test/mocks/get_event_200_with_broken_format.json @@ -0,0 +1,283 @@ +{ + "products": { + "identification": { + "data": { + "visitorId": "Ibk1527CUFmcnjLwIs4A9", + "requestId": "1708102555327.NLOjmg", + "incognito": true, + "linkedId": { + "broken": "format" + }, + "tag": {}, + "time": "2019-05-21T16:40:13Z", + "timestamp": 1582299576512, + "url": "https://www.example.com/login?hope{this{works[!", + "ip": "61.127.217.15", + "ipLocation": { + "accuracyRadius": 10, + "latitude": 49.982, + "longitude": 36.2566, + "postalCode": "61202", + "timezone": "Europe/Dusseldorf", + "city": { + "name": "Dusseldorf" + }, + "country": { + "code": "DE", + "name": "Germany" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "subdivisions": [ + { + "isoCode": "63", + "name": "North Rhine-Westphalia" + } + ] + }, + "browserDetails": { + "browserName": "Chrome", + "browserMajorVersion": "74", + "browserFullVersion": "74.0.3729", + "os": "Windows", + "osVersion": "7", + "device": "Other", + "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." + }, + "confidence": { + "score": 0.97 + }, + "visitorFound": false, + "firstSeenAt": { + "global": "2022-03-16T11:26:45.362Z", + "subscription": "2022-03-16T11:31:01.101Z" + }, + "lastSeenAt": { + "global": null, + "subscription": null + } + } + }, + "botd": { + "data": { + "bot": { + "result": "notDetected" + }, + "url": "https://www.example.com/login?hope{this{works}[!", + "ip": "61.127.217.15", + "time": "2019-05-21T16:40:13Z", + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36", + "requestId": "1708102555327.NLOjmg" + } + }, + "rootApps": { + "data": { + "result": false + } + }, + "emulator": { + "data": { + "result": false + } + }, + "ipInfo": { + "data": { + "v4": { + "address": "94.142.239.124", + "geolocation": { + "accuracyRadius": 20, + "latitude": 50.05, + "longitude": 14.4, + "postalCode": "150 00", + "timezone": "Europe/Prague", + "city": { + "name": "Prague" + }, + "country": { + "code": "CZ", + "name": "Czechia" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "subdivisions": [ + { + "isoCode": "10", + "name": "Hlavni mesto Praha" + } + ] + }, + "asn": { + "asn": "7922", + "name": "COMCAST-7922", + "network": "73.136.0.0/13" + }, + "datacenter": { + "result": true, + "name": "DediPath" + } + }, + "v6": { + "address": "2001:db8:3333:4444:5555:6666:7777:8888", + "geolocation": { + "accuracyRadius": 5, + "latitude": 49.982, + "longitude": 36.2566, + "postalCode": "10112", + "timezone": "Europe/Berlin", + "city": { + "name": "Berlin" + }, + "country": { + "code": "DE", + "name": "Germany" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "subdivisions": [ + { + "isoCode": "BE", + "name": "Land Berlin" + } + ] + }, + "asn": { + "asn": "6805", + "name": "Telefonica Germany", + "network": "2a02:3100::/24" + }, + "datacenter": { + "result": false, + "name": "" + } + } + } + }, + "ipBlocklist": { + "data": { + "result": false, + "details": { + "emailSpam": false, + "attackSource": false + } + } + }, + "tor": { + "data": { + "result": false + } + }, + "vpn": { + "data": { + "result": false, + "originTimezone": "Europe/Berlin", + "originCountry": "unknown", + "methods": { + "timezoneMismatch": false, + "publicVPN": false, + "auxiliaryMobile": false + } + } + }, + "proxy": { + "data": { + "result": false + } + }, + "incognito": { + "data": { + "result": false + } + }, + "tampering": { + "data": { + "result": false, + "anomalyScore": 0.1955 + } + }, + "clonedApp": { + "data": { + "result": false + } + }, + "factoryReset": { + "data": { + "time": "1970-01-01T00:00:00Z", + "timestamp": 0 + } + }, + "jailbroken": { + "data": { + "result": false + } + }, + "frida": { + "data": { + "result": false + } + }, + "privacySettings": { + "data": { + "result": false + } + }, + "virtualMachine": { + "data": { + "result": false + } + }, + "rawDeviceAttributes": { + "data": { + "architecture": { + "value": 127 + }, + "audio": { + "value": 35.73832903057337 + }, + "canvas": { + "value": { + "Winding": true, + "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", + "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" + } + }, + "colorDepth": { + "value": 30 + }, + "colorGamut": { + "value": "p3" + }, + "contrast": { + "value": 0 + }, + "cookiesEnabled": { + "value": true + }, + "cpuClass": {}, + "fonts": { + "value": [ + "Arial Unicode MS", + "Gill Sans", + "Helvetica Neue", + "Menlo" + ] + } + } + }, + "highActivity": { + "data": { + "result": false + } + }, + "locationSpoofing": { + "data": { + "result": false + } + } + } +} diff --git a/test/test_fingerprint_api.py b/test/test_fingerprint_api.py index ddee452b..7e494a4c 100644 --- a/test/test_fingerprint_api.py +++ b/test/test_fingerprint_api.py @@ -11,6 +11,7 @@ """ import io +import os import unittest import urllib3 @@ -30,9 +31,14 @@ class MockPoolManager(object): - def __init__(self, tc): + + + def __init__(self, tc, request_headers=None): + if request_headers is None: + request_headers = {} self._tc = tc self._reqs = [] + self.request_headers = request_headers def expect_request(self, *args, **kwargs): self._reqs.append((args, kwargs)) @@ -72,14 +78,15 @@ def request(self, *args, **kwargs): if mock_file_by_first_argument == 'update_event': return urllib3.HTTPResponse(status=200, body='OK') try: - with io.open('./test/mocks/' + mock_file_by_first_argument, 'r', encoding='utf-8') as mock_file: + path = './test/mocks/' + mock_file_by_first_argument + + if not os.path.isfile(path): + path = './test/mocks/shared/' + mock_file_by_first_argument + + with io.open(path, 'r', encoding='utf-8') as mock_file: answer_mock = mock_file.read() mock_file.close() - headers = {} - if mock_file_by_first_argument == 'get_visits_429_too_many_requests_error.json': - headers.update({'Retry-After': '4'}) - - return urllib3.HTTPResponse(status=status, body=answer_mock, headers=headers) + return urllib3.HTTPResponse(status=status, body=answer_mock, headers=self.request_headers) except IOError as e: print(e) return urllib3.HTTPResponse(status=200, body='{"visitorId": "%s", "visits": []}' % mock_file_by_first_argument) @@ -161,7 +168,7 @@ def test_get_visits_error_403(self): def test_get_visits_error_429(self): """Test checks correct code run result in case of 429 error for get_visits method""" - mock_pool = MockPoolManager(self) + mock_pool = MockPoolManager(self, request_headers={'Retry-After': '4'}) self.api.api_client.rest_client.pool_manager = mock_pool mock_file = 'get_visits_429_too_many_requests_error.json' mock_pool.expect_request('GET', TestFingerprintApi.get_visitors_path(visitor_id=mock_file), @@ -177,7 +184,7 @@ def test_get_visits_error_429_empty_retry_after(self): """Test checks retry after value in exception in case of 429 error for get_visits method""" mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool - mock_file = 'get_visits_429_too_many_requests_error_empty_header.json' + mock_file = 'get_visits_429_too_many_requests_error.json' mock_pool.expect_request('GET', TestFingerprintApi.get_visitors_path(visitor_id=mock_file), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None, status=429) @@ -501,7 +508,7 @@ def test_get_event_wrong_shape(self): mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool - mock_file = 'get_event_200_wrong_shape.json' + mock_file = 'get_event_200_with_broken_format.json' mock_pool.expect_request('GET', TestFingerprintApi.get_events_path(request_id=mock_file), fields=[self.integration_info], headers=self.request_headers, preload_content=True, timeout=None) diff --git a/test/test_sealed.py b/test/test_sealed.py index 658f870c..f8023114 100644 --- a/test/test_sealed.py +++ b/test/test_sealed.py @@ -2,6 +2,7 @@ import io import json import unittest +from unittest import expectedFailure from fingerprint_pro_server_api_sdk import ApiClientDeserializer, DecryptionAlgorithm, DecryptionKey, \ unseal_event_response, UnsealError, UnsealAggregateError, EventResponse, ProductsResponse, \ @@ -12,22 +13,100 @@ class TestSealed(unittest.TestCase): invalid_key = base64.b64decode('a2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53=') def test_unseal_aes256gcm(self): - with io.open("./test/mocks/sealed_result.json", 'r', encoding='utf-8') as f: - expected_result = ApiClientDeserializer.deserialize(json.load(f), 'EventResponse') + sealed_result = '''{ + "products": { + "identification": { + "data": { + "visitorId": "2ZEDCZEfOfXjEmMuE3tq", + "requestId": "1703067132750.Z5hutJ", + "browserDetails": { + "browserName": "Safari", + "browserMajorVersion": "17", + "browserFullVersion": "17.3", + "os": "Mac OS X", + "osVersion": "10.15.7", + "device": "Other", + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Safari/605.1.15" + }, + "incognito": false, + "ip": "::1", + "ipLocation": { + "accuracyRadius": 1000, + "latitude": 59.3241, + "longitude": 18.0517, + "postalCode": "100 05", + "timezone": "Europe/Stockholm", + "city": { + "name": "Stockholm" + }, + "country": { + "code": "SE", + "name": "Sweden" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "subdivisions": [ + { + "isoCode": "AB", + "name": "Stockholm County" + } + ] + }, + "timestamp": 1703067136286, + "time": "2023-12-20T10:12:16Z", + "url": "http://localhost:8080/", + "tag": { + "foo": "bar" + }, + "confidence": { + "score": 1 + }, + "visitorFound": true, + "firstSeenAt": { + "global": "2023-12-15T12:13:55.103Z", + "subscription": "2023-12-15T12:13:55.103Z" + }, + "lastSeenAt": { + "global": "2023-12-19T11:39:51.52Z", + "subscription": "2023-12-19T11:39:51.52Z" + } + } + }, + "botd": { + "data": { + "bot": { + "result": "notDetected" + }, + "meta": { + "foo": "bar" + }, + "url": "http://localhost:8080/", + "ip": "::1", + "time": "2023-12-20T10:12:13.894Z", + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Safari/605.1.15", + "requestId": "1703067132750.Z5hutJ" + } + } + } +}''' + expected_result = ApiClientDeserializer.deserialize(json.loads(sealed_result), 'EventResponse') - sealed_data = base64.b64decode( - '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==') + sealed_data = base64.b64decode( + '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==') - result = unseal_event_response(sealed_data, [ - DecryptionKey(self.invalid_key, DecryptionAlgorithm['Aes256Gcm']), - DecryptionKey(self.valid_key, DecryptionAlgorithm['Aes256Gcm']), - ]) + result = unseal_event_response(sealed_data, [ + DecryptionKey(self.invalid_key, DecryptionAlgorithm['Aes256Gcm']), + DecryptionKey(self.valid_key, DecryptionAlgorithm['Aes256Gcm']), + ]) + + self.assertEqual(result, expected_result) + self.assertIsInstance(result, EventResponse) + self.assertIsInstance(result.products, ProductsResponse) + self.assertIsInstance(result.products.identification, ProductsResponseIdentification) + self.assertIsInstance(result.products.identification.data.browser_details, BrowserDetails) - self.assertEqual(result, expected_result) - self.assertIsInstance(result, EventResponse) - self.assertIsInstance(result.products, ProductsResponse) - self.assertIsInstance(result.products.identification, ProductsResponseIdentification) - self.assertIsInstance(result.products.identification.data.browser_details, BrowserDetails) def test_unseal_invalid_header(self): sealed_data = base64.b64decode( From d66f13ea3607d8ce3d50573e8eef977b57a10b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Mon, 7 Oct 2024 12:12:13 +0200 Subject: [PATCH 3/3] chore: remove update event changeset --- .changeset/wild-oranges-feel.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .changeset/wild-oranges-feel.md diff --git a/.changeset/wild-oranges-feel.md b/.changeset/wild-oranges-feel.md deleted file mode 100644 index 6cb90873..00000000 --- a/.changeset/wild-oranges-feel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'fingerprint-pro-server-api-python-sdk': minor ---- - -**events**: Introduce `PUT` endpoint for `/events` API