From e35961cf93a86a0e3d3ebe6d373452e3f7918853 Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Thu, 23 Nov 2023 19:07:53 +0100 Subject: [PATCH] feat: add `highActivity` and `locationSpoofing` signals, support `originTimezone` for `vpn` signal --- README.md | 4 + docs/Model/HighActivityResult.md | 10 + docs/Model/IPLocation.md | 2 +- docs/Model/LocationSpoofingResult.md | 9 + docs/Model/ProductsResponse.md | 2 + .../ProductsResponseIdentificationData.md | 2 +- docs/Model/SignalResponseHighActivity.md | 10 + docs/Model/SignalResponseLocationSpoofing.md | 10 + docs/Model/VpnResult.md | 1 + docs/Model/WebhookVisit.md | 2 + res/fingerprint-server-api.yaml | 162 ++++----- src/Model/HighActivityResult.php | 325 ++++++++++++++++++ src/Model/IPLocation.php | 2 +- src/Model/LocationSpoofingResult.php | 295 ++++++++++++++++ src/Model/ProductsResponse.php | 60 ++++ .../ProductsResponseIdentificationData.php | 2 +- src/Model/SignalResponseHighActivity.php | 325 ++++++++++++++++++ src/Model/SignalResponseLocationSpoofing.php | 325 ++++++++++++++++++ src/Model/VpnResult.php | 30 ++ src/Model/WebhookVisit.php | 60 ++++ test/FingerprintApiTest.php | 6 + test/mocks/get_event.json | 13 +- 22 files changed, 1548 insertions(+), 109 deletions(-) create mode 100644 docs/Model/HighActivityResult.md create mode 100644 docs/Model/LocationSpoofingResult.md create mode 100644 docs/Model/SignalResponseHighActivity.md create mode 100644 docs/Model/SignalResponseLocationSpoofing.md create mode 100644 src/Model/HighActivityResult.php create mode 100644 src/Model/LocationSpoofingResult.php create mode 100644 src/Model/SignalResponseHighActivity.php create mode 100644 src/Model/SignalResponseLocationSpoofing.php diff --git a/README.md b/README.md index ee7b0e08..095e2ba1 100644 --- a/README.md +++ b/README.md @@ -175,6 +175,7 @@ Class | Method | HTTP request | Description - [ErrorEvent404ResponseError](docs/Model/ErrorEvent404ResponseError.md) - [ErrorVisits403](docs/Model/ErrorVisits403.md) - [EventResponse](docs/Model/EventResponse.md) + - [HighActivityResult](docs/Model/HighActivityResult.md) - [IPLocation](docs/Model/IPLocation.md) - [IPLocationCity](docs/Model/IPLocationCity.md) - [IdentificationError](docs/Model/IdentificationError.md) @@ -184,6 +185,7 @@ Class | Method | HTTP request | Description - [IpInfoResultV4](docs/Model/IpInfoResultV4.md) - [IpInfoResultV6](docs/Model/IpInfoResultV6.md) - [Location](docs/Model/Location.md) + - [LocationSpoofingResult](docs/Model/LocationSpoofingResult.md) - [ManyRequestsResponse](docs/Model/ManyRequestsResponse.md) - [ProductError](docs/Model/ProductError.md) - [ProductsResponse](docs/Model/ProductsResponse.md) @@ -202,12 +204,14 @@ Class | Method | HTTP request | Description - [SignalResponseFactoryResetData](docs/Model/SignalResponseFactoryResetData.md) - [SignalResponseFrida](docs/Model/SignalResponseFrida.md) - [SignalResponseFridaData](docs/Model/SignalResponseFridaData.md) + - [SignalResponseHighActivity](docs/Model/SignalResponseHighActivity.md) - [SignalResponseIncognito](docs/Model/SignalResponseIncognito.md) - [SignalResponseIncognitoData](docs/Model/SignalResponseIncognitoData.md) - [SignalResponseIpBlocklist](docs/Model/SignalResponseIpBlocklist.md) - [SignalResponseIpInfo](docs/Model/SignalResponseIpInfo.md) - [SignalResponseJailbroken](docs/Model/SignalResponseJailbroken.md) - [SignalResponseJailbrokenData](docs/Model/SignalResponseJailbrokenData.md) + - [SignalResponseLocationSpoofing](docs/Model/SignalResponseLocationSpoofing.md) - [SignalResponsePrivacySettings](docs/Model/SignalResponsePrivacySettings.md) - [SignalResponsePrivacySettingsData](docs/Model/SignalResponsePrivacySettingsData.md) - [SignalResponseProxy](docs/Model/SignalResponseProxy.md) diff --git a/docs/Model/HighActivityResult.md b/docs/Model/HighActivityResult.md new file mode 100644 index 00000000..0597685c --- /dev/null +++ b/docs/Model/HighActivityResult.md @@ -0,0 +1,10 @@ +# HighActivityResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | **bool** | Flag indicating whether the request came from a high activity visitor. | [optional] +**daily_requests** | **float** | Number of requests from the same visitor in the previous day. | [optional] + +[[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/Model/IPLocation.md b/docs/Model/IPLocation.md index 728c5897..b9ad6d10 100644 --- a/docs/Model/IPLocation.md +++ b/docs/Model/IPLocation.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**accuracy_radius** | **int** | | [optional] +**accuracy_radius** | **int** | The IP address is likely to be within this radius (in km) of the specified location. | [optional] **latitude** | **double** | | [optional] **longitude** | **double** | | [optional] **postal_code** | **string** | | [optional] diff --git a/docs/Model/LocationSpoofingResult.md b/docs/Model/LocationSpoofingResult.md new file mode 100644 index 00000000..095c5faa --- /dev/null +++ b/docs/Model/LocationSpoofingResult.md @@ -0,0 +1,9 @@ +# LocationSpoofingResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | **bool** | Flag indicating whether the request came from a device with location spoofing enabled. | [optional] + +[[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/Model/ProductsResponse.md b/docs/Model/ProductsResponse.md index 00aa0417..cf3753c9 100644 --- a/docs/Model/ProductsResponse.md +++ b/docs/Model/ProductsResponse.md @@ -22,6 +22,8 @@ Name | Type | Description | Notes **vpn** | [**\Fingerprint\ServerAPI\Model\SignalResponseVpn**](SignalResponseVpn.md) | | [optional] **proxy** | [**\Fingerprint\ServerAPI\Model\SignalResponseProxy**](SignalResponseProxy.md) | | [optional] **tampering** | [**\Fingerprint\ServerAPI\Model\SignalResponseTampering**](SignalResponseTampering.md) | | [optional] +**high_activity** | [**\Fingerprint\ServerAPI\Model\SignalResponseHighActivity**](SignalResponseHighActivity.md) | | [optional] +**location_spoofing** | [**\Fingerprint\ServerAPI\Model\SignalResponseLocationSpoofing**](SignalResponseLocationSpoofing.md) | | [optional] **raw_device_attributes** | [**\Fingerprint\ServerAPI\Model\SignalResponseRawDeviceAttributes**](SignalResponseRawDeviceAttributes.md) | | [optional] [[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/Model/ProductsResponseIdentificationData.md b/docs/Model/ProductsResponseIdentificationData.md index 73c86d08..ff4c4125 100644 --- a/docs/Model/ProductsResponseIdentificationData.md +++ b/docs/Model/ProductsResponseIdentificationData.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes **visitor_found** | **bool** | Attribute represents if a visitor had been identified before. | **first_seen_at** | [**\Fingerprint\ServerAPI\Model\SeenAt**](SeenAt.md) | | **last_seen_at** | [**\Fingerprint\ServerAPI\Model\SeenAt**](SeenAt.md) | | -**visitor_id** | **string** | String of 20 characters that uniquely identifies the visitor's browser. **Pro Plus:** If a bot is detected (`products.botd.bot.result != \"notDetected\"`), the `visitorId` value contains a placeholder string `BotDetected000000000`. | +**visitor_id** | **string** | String of 20 characters that uniquely identifies the visitor's browser. | [[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/Model/SignalResponseHighActivity.md b/docs/Model/SignalResponseHighActivity.md new file mode 100644 index 00000000..ef05912b --- /dev/null +++ b/docs/Model/SignalResponseHighActivity.md @@ -0,0 +1,10 @@ +# SignalResponseHighActivity + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fingerprint\ServerAPI\Model\HighActivityResult**](HighActivityResult.md) | | [optional] +**error** | [**\Fingerprint\ServerAPI\Model\ProductError**](ProductError.md) | | [optional] + +[[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/Model/SignalResponseLocationSpoofing.md b/docs/Model/SignalResponseLocationSpoofing.md new file mode 100644 index 00000000..47fd839b --- /dev/null +++ b/docs/Model/SignalResponseLocationSpoofing.md @@ -0,0 +1,10 @@ +# SignalResponseLocationSpoofing + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fingerprint\ServerAPI\Model\LocationSpoofingResult**](LocationSpoofingResult.md) | | [optional] +**error** | [**\Fingerprint\ServerAPI\Model\ProductError**](ProductError.md) | | [optional] + +[[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/Model/VpnResult.md b/docs/Model/VpnResult.md index 68058850..b8a27aff 100644 --- a/docs/Model/VpnResult.md +++ b/docs/Model/VpnResult.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **result** | **bool** | VPN or other anonymizing service has been used when sending the request. | [optional] +**origin_timezone** | **string** | Local timezone which is used in timezoneMismatch method. | [optional] **methods** | [**\Fingerprint\ServerAPI\Model\VpnResultMethods**](VpnResultMethods.md) | | [optional] [[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/Model/WebhookVisit.md b/docs/Model/WebhookVisit.md index dd15eed9..4af9a51e 100644 --- a/docs/Model/WebhookVisit.md +++ b/docs/Model/WebhookVisit.md @@ -23,6 +23,8 @@ Name | Type | Description | Notes **proxy** | [**\Fingerprint\ServerAPI\Model\WebhookSignalResponseProxy**](WebhookSignalResponseProxy.md) | | [optional] **tampering** | [**\Fingerprint\ServerAPI\Model\TamperingResult**](TamperingResult.md) | | [optional] **raw_device_attributes** | [**\Fingerprint\ServerAPI\Model\RawDeviceAttributesResult**](RawDeviceAttributesResult.md) | | [optional] +**high_activity** | [**\Fingerprint\ServerAPI\Model\HighActivityResult**](HighActivityResult.md) | | [optional] +**location_spoofing** | [**\Fingerprint\ServerAPI\Model\LocationSpoofingResult**](LocationSpoofingResult.md) | | [optional] **request_id** | **string** | Unique identifier of the user's identification request. | **browser_details** | [**\Fingerprint\ServerAPI\Model\BrowserDetails**](BrowserDetails.md) | | **ip** | **string** | | diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index bdd5fc4c..d5a61a28 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -182,6 +182,7 @@ paths: vpn: data: result: false + originTimezone: Europe/Berlin methods: timezoneMismatch: false publicVPN: false @@ -231,106 +232,12 @@ paths: value: 0 cookiesEnabled: value: true - proPlusBotDetectedResponse: - summary: Bot detected on Pro Plus plan - value: - products: - identification: - data: - visitorId: BotDetected000000000 - requestId: 0KSh65EnVoB85JBmloQK - incognito: true - linkedId: somelinkedId - time: '2019-05-21T16:40:13Z' - timestamp: 1582299576512 - url: https://www.example.com/login - ip: 61.127.217.15 - ipLocation: {} - browserDetails: - browserName: '' - browserMajorVersion: '' - browserFullVersion: '' - os: '' - osVersion: '' - device: '' - userAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) .... - confidence: - score: 0.5 - comment: The real score is unknown - visitorFound: false - firstSeenAt: - global: null - subscription: null - lastSeenAt: - global: null - subscription: null - botd: - data: - bot: - result: bad - type: selenium - url: https://www.example.com/login - ip: 61.127.217.15 - time: '2019-05-21T16:40:13Z' - 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 - incognito: - data: - result: false - rootApps: - data: - result: false - emulator: - data: - result: false - ipBlocklist: + highActivity: data: result: false - details: - emailSpam: false - attackSource: false - tor: + locationSpoofing: data: result: false - vpn: - data: - result: false - methods: - timezoneMismatch: false - publicVPN: false - proxy: - data: - result: false - tampering: - data: - result: false - anomalyScore: 0 allErrorsResponse: summary: All failed signals value: @@ -3810,6 +3717,7 @@ paths: result: false vpn: result: false + originTimezone: Europe/Berlin methods: timezoneMismatch: false publicVPN: false @@ -3850,6 +3758,10 @@ paths: value: 0 cookiesEnabled: value: true + highActivity: + result: false + locationSpoofing: + result: true responses: default: description: The server doesn't validate the answer. @@ -4186,6 +4098,10 @@ components: $ref: '#/components/schemas/TamperingResult' rawDeviceAttributes: $ref: '#/components/schemas/RawDeviceAttributesResult' + highActivity: + $ref: '#/components/schemas/HighActivityResult' + locationSpoofing: + $ref: '#/components/schemas/LocationSpoofingResult' requestId: description: Unique identifier of the user's identification request. type: string @@ -4421,6 +4337,9 @@ components: 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 @@ -4563,16 +4482,8 @@ components: description: > String of 20 characters that uniquely identifies the visitor's browser. - - - **Pro Plus:** - - If a bot is detected (`products.botd.bot.result != - "notDetected"`), the `visitorId` value contains a - placeholder string `BotDetected000000000`. example: - Ibk1527CUFmcnjLwIs4A - - BotDetected000000000 additionalProperties: false required: - browserDetails @@ -4816,6 +4727,22 @@ components: $ref: '#/components/schemas/TamperingResult' error: $ref: '#/components/schemas/ProductError' + highActivity: + title: SignalResponseHighActivity + type: object + properties: + data: + $ref: '#/components/schemas/HighActivityResult' + error: + $ref: '#/components/schemas/ProductError' + locationSpoofing: + title: SignalResponseLocationSpoofing + type: object + properties: + data: + $ref: '#/components/schemas/LocationSpoofingResult' + error: + $ref: '#/components/schemas/ProductError' rawDeviceAttributes: title: SignalResponseRawDeviceAttributes type: object @@ -4975,6 +4902,10 @@ components: VPN or other anonymizing service has been used when sending the request. example: false + originTimezone: + type: string + description: Local timezone which is used in timezoneMismatch method. + example: Europe/Berlin methods: type: object properties: @@ -5014,6 +4945,29 @@ components: example: 0 minimum: 0 maximum: 1 + HighActivityResult: + type: object + properties: + result: + type: boolean + description: >- + Flag indicating whether the request came from a high activity + visitor. + example: false + dailyRequests: + type: number + description: Number of requests from the same visitor in the previous day. + example: 10 + minimum: 1 + LocationSpoofingResult: + type: object + properties: + result: + type: boolean + description: >- + Flag indicating whether the request came from a device with location + spoofing enabled. + example: false RawDeviceAttributesResult: type: object description: > diff --git a/src/Model/HighActivityResult.php b/src/Model/HighActivityResult.php new file mode 100644 index 00000000..899f1817 --- /dev/null +++ b/src/Model/HighActivityResult.php @@ -0,0 +1,325 @@ + 'bool', +'daily_requests' => 'float' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'result' => null, +'daily_requests' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'result' => 'result', +'daily_requests' => 'dailyRequests' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'result' => 'setResult', +'daily_requests' => 'setDailyRequests' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'result' => 'getResult', +'daily_requests' => 'getDailyRequests' ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['result'] = isset($data['result']) ? $data['result'] : null; + $this->container['daily_requests'] = isset($data['daily_requests']) ? $data['daily_requests'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets result + * + * @return bool + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param bool $result Flag indicating whether the request came from a high activity visitor. + * + * @return $this + */ + public function setResult($result) + { + $this->container['result'] = $result; + + return $this; + } + + /** + * Gets daily_requests + * + * @return float + */ + public function getDailyRequests() + { + return $this->container['daily_requests']; + } + + /** + * Sets daily_requests + * + * @param float $daily_requests Number of requests from the same visitor in the previous day. + * + * @return $this + */ + public function setDailyRequests($daily_requests) + { + $this->container['daily_requests'] = $daily_requests; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/IPLocation.php b/src/Model/IPLocation.php index 952a14ed..3709db3f 100644 --- a/src/Model/IPLocation.php +++ b/src/Model/IPLocation.php @@ -257,7 +257,7 @@ public function getAccuracyRadius() /** * Sets accuracy_radius * - * @param int $accuracy_radius accuracy_radius + * @param int $accuracy_radius The IP address is likely to be within this radius (in km) of the specified location. * * @return $this */ diff --git a/src/Model/LocationSpoofingResult.php b/src/Model/LocationSpoofingResult.php new file mode 100644 index 00000000..4f69eea5 --- /dev/null +++ b/src/Model/LocationSpoofingResult.php @@ -0,0 +1,295 @@ + 'bool' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'result' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'result' => 'result' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'result' => 'setResult' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'result' => 'getResult' ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['result'] = isset($data['result']) ? $data['result'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets result + * + * @return bool + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param bool $result Flag indicating whether the request came from a device with location spoofing enabled. + * + * @return $this + */ + public function setResult($result) + { + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/ProductsResponse.php b/src/Model/ProductsResponse.php index f7982644..f27157e5 100644 --- a/src/Model/ProductsResponse.php +++ b/src/Model/ProductsResponse.php @@ -74,6 +74,8 @@ class ProductsResponse implements ModelInterface, ArrayAccess 'vpn' => '\Fingerprint\ServerAPI\Model\SignalResponseVpn', 'proxy' => '\Fingerprint\ServerAPI\Model\SignalResponseProxy', 'tampering' => '\Fingerprint\ServerAPI\Model\SignalResponseTampering', +'high_activity' => '\Fingerprint\ServerAPI\Model\SignalResponseHighActivity', +'location_spoofing' => '\Fingerprint\ServerAPI\Model\SignalResponseLocationSpoofing', 'raw_device_attributes' => '\Fingerprint\ServerAPI\Model\SignalResponseRawDeviceAttributes' ]; /** @@ -99,6 +101,8 @@ class ProductsResponse implements ModelInterface, ArrayAccess 'vpn' => null, 'proxy' => null, 'tampering' => null, +'high_activity' => null, +'location_spoofing' => null, 'raw_device_attributes' => null ]; /** @@ -145,6 +149,8 @@ public static function swaggerFormats() 'vpn' => 'vpn', 'proxy' => 'proxy', 'tampering' => 'tampering', +'high_activity' => 'highActivity', +'location_spoofing' => 'locationSpoofing', 'raw_device_attributes' => 'rawDeviceAttributes' ]; /** @@ -170,6 +176,8 @@ public static function swaggerFormats() 'vpn' => 'setVpn', 'proxy' => 'setProxy', 'tampering' => 'setTampering', +'high_activity' => 'setHighActivity', +'location_spoofing' => 'setLocationSpoofing', 'raw_device_attributes' => 'setRawDeviceAttributes' ]; /** @@ -195,6 +203,8 @@ public static function swaggerFormats() 'vpn' => 'getVpn', 'proxy' => 'getProxy', 'tampering' => 'getTampering', +'high_activity' => 'getHighActivity', +'location_spoofing' => 'getLocationSpoofing', 'raw_device_attributes' => 'getRawDeviceAttributes' ]; /** @@ -272,6 +282,8 @@ public function __construct(array $data = null) $this->container['vpn'] = isset($data['vpn']) ? $data['vpn'] : null; $this->container['proxy'] = isset($data['proxy']) ? $data['proxy'] : null; $this->container['tampering'] = isset($data['tampering']) ? $data['tampering'] : null; + $this->container['high_activity'] = isset($data['high_activity']) ? $data['high_activity'] : null; + $this->container['location_spoofing'] = isset($data['location_spoofing']) ? $data['location_spoofing'] : null; $this->container['raw_device_attributes'] = isset($data['raw_device_attributes']) ? $data['raw_device_attributes'] : null; } @@ -707,6 +719,54 @@ public function setTampering($tampering) return $this; } + /** + * Gets high_activity + * + * @return \Fingerprint\ServerAPI\Model\SignalResponseHighActivity + */ + public function getHighActivity() + { + return $this->container['high_activity']; + } + + /** + * Sets high_activity + * + * @param \Fingerprint\ServerAPI\Model\SignalResponseHighActivity $high_activity high_activity + * + * @return $this + */ + public function setHighActivity($high_activity) + { + $this->container['high_activity'] = $high_activity; + + return $this; + } + + /** + * Gets location_spoofing + * + * @return \Fingerprint\ServerAPI\Model\SignalResponseLocationSpoofing + */ + public function getLocationSpoofing() + { + return $this->container['location_spoofing']; + } + + /** + * Sets location_spoofing + * + * @param \Fingerprint\ServerAPI\Model\SignalResponseLocationSpoofing $location_spoofing location_spoofing + * + * @return $this + */ + public function setLocationSpoofing($location_spoofing) + { + $this->container['location_spoofing'] = $location_spoofing; + + return $this; + } + /** * Gets raw_device_attributes * diff --git a/src/Model/ProductsResponseIdentificationData.php b/src/Model/ProductsResponseIdentificationData.php index 69b24854..79bca382 100644 --- a/src/Model/ProductsResponseIdentificationData.php +++ b/src/Model/ProductsResponseIdentificationData.php @@ -665,7 +665,7 @@ public function getVisitorId() /** * Sets visitor_id * - * @param string $visitor_id String of 20 characters that uniquely identifies the visitor's browser. **Pro Plus:** If a bot is detected (`products.botd.bot.result != \"notDetected\"`), the `visitorId` value contains a placeholder string `BotDetected000000000`. + * @param string $visitor_id String of 20 characters that uniquely identifies the visitor's browser. * * @return $this */ diff --git a/src/Model/SignalResponseHighActivity.php b/src/Model/SignalResponseHighActivity.php new file mode 100644 index 00000000..95653e16 --- /dev/null +++ b/src/Model/SignalResponseHighActivity.php @@ -0,0 +1,325 @@ + '\Fingerprint\ServerAPI\Model\HighActivityResult', +'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'data' => null, +'error' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', +'error' => 'error' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', +'error' => 'setError' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', +'error' => 'getError' ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Fingerprint\ServerAPI\Model\HighActivityResult + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fingerprint\ServerAPI\Model\HighActivityResult $data data + * + * @return $this + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets error + * + * @return \Fingerprint\ServerAPI\Model\ProductError + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * + * @return $this + */ + public function setError($error) + { + $this->container['error'] = $error; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/SignalResponseLocationSpoofing.php b/src/Model/SignalResponseLocationSpoofing.php new file mode 100644 index 00000000..49e498c4 --- /dev/null +++ b/src/Model/SignalResponseLocationSpoofing.php @@ -0,0 +1,325 @@ + '\Fingerprint\ServerAPI\Model\LocationSpoofingResult', +'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'data' => null, +'error' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', +'error' => 'error' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', +'error' => 'setError' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', +'error' => 'getError' ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Fingerprint\ServerAPI\Model\LocationSpoofingResult + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fingerprint\ServerAPI\Model\LocationSpoofingResult $data data + * + * @return $this + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets error + * + * @return \Fingerprint\ServerAPI\Model\ProductError + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * + * @return $this + */ + public function setError($error) + { + $this->container['error'] = $error; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/VpnResult.php b/src/Model/VpnResult.php index 447d3b96..f280837a 100644 --- a/src/Model/VpnResult.php +++ b/src/Model/VpnResult.php @@ -57,6 +57,7 @@ class VpnResult implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'result' => 'bool', +'origin_timezone' => 'string', 'methods' => '\Fingerprint\ServerAPI\Model\VpnResultMethods' ]; /** @@ -66,6 +67,7 @@ class VpnResult implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'result' => null, +'origin_timezone' => null, 'methods' => null ]; /** @@ -96,6 +98,7 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'result' => 'result', +'origin_timezone' => 'originTimezone', 'methods' => 'methods' ]; /** @@ -105,6 +108,7 @@ public static function swaggerFormats() */ protected static $setters = [ 'result' => 'setResult', +'origin_timezone' => 'setOriginTimezone', 'methods' => 'setMethods' ]; /** @@ -114,6 +118,7 @@ public static function swaggerFormats() */ protected static $getters = [ 'result' => 'getResult', +'origin_timezone' => 'getOriginTimezone', 'methods' => 'getMethods' ]; /** @@ -175,6 +180,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['result'] = isset($data['result']) ? $data['result'] : null; + $this->container['origin_timezone'] = isset($data['origin_timezone']) ? $data['origin_timezone'] : null; $this->container['methods'] = isset($data['methods']) ? $data['methods'] : null; } @@ -226,6 +232,30 @@ public function setResult($result) return $this; } + /** + * Gets origin_timezone + * + * @return string + */ + public function getOriginTimezone() + { + return $this->container['origin_timezone']; + } + + /** + * Sets origin_timezone + * + * @param string $origin_timezone Local timezone which is used in timezoneMismatch method. + * + * @return $this + */ + public function setOriginTimezone($origin_timezone) + { + $this->container['origin_timezone'] = $origin_timezone; + + return $this; + } + /** * Gets methods * diff --git a/src/Model/WebhookVisit.php b/src/Model/WebhookVisit.php index 3fd06253..5e5dbebb 100644 --- a/src/Model/WebhookVisit.php +++ b/src/Model/WebhookVisit.php @@ -76,6 +76,8 @@ class WebhookVisit implements ModelInterface, ArrayAccess 'proxy' => '\Fingerprint\ServerAPI\Model\WebhookSignalResponseProxy', 'tampering' => '\Fingerprint\ServerAPI\Model\TamperingResult', 'raw_device_attributes' => '\Fingerprint\ServerAPI\Model\RawDeviceAttributesResult', +'high_activity' => '\Fingerprint\ServerAPI\Model\HighActivityResult', +'location_spoofing' => '\Fingerprint\ServerAPI\Model\LocationSpoofingResult', 'request_id' => 'string', 'browser_details' => '\Fingerprint\ServerAPI\Model\BrowserDetails', 'ip' => 'string', @@ -116,6 +118,8 @@ class WebhookVisit implements ModelInterface, ArrayAccess 'proxy' => null, 'tampering' => null, 'raw_device_attributes' => null, +'high_activity' => null, +'location_spoofing' => null, 'request_id' => null, 'browser_details' => null, 'ip' => 'ipv4', @@ -177,6 +181,8 @@ public static function swaggerFormats() 'proxy' => 'proxy', 'tampering' => 'tampering', 'raw_device_attributes' => 'rawDeviceAttributes', +'high_activity' => 'highActivity', +'location_spoofing' => 'locationSpoofing', 'request_id' => 'requestId', 'browser_details' => 'browserDetails', 'ip' => 'ip', @@ -217,6 +223,8 @@ public static function swaggerFormats() 'proxy' => 'setProxy', 'tampering' => 'setTampering', 'raw_device_attributes' => 'setRawDeviceAttributes', +'high_activity' => 'setHighActivity', +'location_spoofing' => 'setLocationSpoofing', 'request_id' => 'setRequestId', 'browser_details' => 'setBrowserDetails', 'ip' => 'setIp', @@ -257,6 +265,8 @@ public static function swaggerFormats() 'proxy' => 'getProxy', 'tampering' => 'getTampering', 'raw_device_attributes' => 'getRawDeviceAttributes', +'high_activity' => 'getHighActivity', +'location_spoofing' => 'getLocationSpoofing', 'request_id' => 'getRequestId', 'browser_details' => 'getBrowserDetails', 'ip' => 'getIp', @@ -349,6 +359,8 @@ public function __construct(array $data = null) $this->container['proxy'] = isset($data['proxy']) ? $data['proxy'] : null; $this->container['tampering'] = isset($data['tampering']) ? $data['tampering'] : null; $this->container['raw_device_attributes'] = isset($data['raw_device_attributes']) ? $data['raw_device_attributes'] : null; + $this->container['high_activity'] = isset($data['high_activity']) ? $data['high_activity'] : null; + $this->container['location_spoofing'] = isset($data['location_spoofing']) ? $data['location_spoofing'] : null; $this->container['request_id'] = isset($data['request_id']) ? $data['request_id'] : null; $this->container['browser_details'] = isset($data['browser_details']) ? $data['browser_details'] : null; $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; @@ -904,6 +916,54 @@ public function setRawDeviceAttributes($raw_device_attributes) return $this; } + /** + * Gets high_activity + * + * @return \Fingerprint\ServerAPI\Model\HighActivityResult + */ + public function getHighActivity() + { + return $this->container['high_activity']; + } + + /** + * Sets high_activity + * + * @param \Fingerprint\ServerAPI\Model\HighActivityResult $high_activity high_activity + * + * @return $this + */ + public function setHighActivity($high_activity) + { + $this->container['high_activity'] = $high_activity; + + return $this; + } + + /** + * Gets location_spoofing + * + * @return \Fingerprint\ServerAPI\Model\LocationSpoofingResult + */ + public function getLocationSpoofing() + { + return $this->container['location_spoofing']; + } + + /** + * Sets location_spoofing + * + * @param \Fingerprint\ServerAPI\Model\LocationSpoofingResult $location_spoofing location_spoofing + * + * @return $this + */ + public function setLocationSpoofing($location_spoofing) + { + $this->container['location_spoofing'] = $location_spoofing; + + return $this; + } + /** * Gets request_id * diff --git a/test/FingerprintApiTest.php b/test/FingerprintApiTest.php index e8ceff81..96cb7f58 100644 --- a/test/FingerprintApiTest.php +++ b/test/FingerprintApiTest.php @@ -120,6 +120,12 @@ public function testGetEvent() $this->assertEquals('4dce9d6017c3e0c052a77252f29f2b1c', $raw_device_attributes['canvas']->value->Geometry); $this->assertEquals('srgb', $raw_device_attributes['colorGamut']->value); $this->assertTrue( $raw_device_attributes['cookiesEnabled']->value); + + $location_spuffing = $products->getLocationSpoofing()->getData(); + $this->assertFalse( $location_spuffing->getResult()); + + $high_activity = $products->getHighActivity()->getData(); + $this->assertFalse( $high_activity->getResult()); } public function testGetEventWithExtraFields() diff --git a/test/mocks/get_event.json b/test/mocks/get_event.json index 90abb41c..0a89f7d4 100644 --- a/test/mocks/get_event.json +++ b/test/mocks/get_event.json @@ -139,6 +139,7 @@ "vpn": { "data": { "result": false, + "originTimezone": "Europe/Berlin", "methods": { "timezoneMismatch": false, "publicVPN": false, @@ -216,6 +217,16 @@ "value": true } } + }, + "highActivity": { + "data": { + "result": false + } + }, + "locationSpoofing": { + "data": { + "result": false + } } } -} +} \ No newline at end of file