From c370f3c832e01b0b518cebc021f3d518c3d6fa13 Mon Sep 17 00:00:00 2001 From: ilfa Date: Mon, 2 Jun 2025 16:10:58 +0000 Subject: [PATCH] feat: sync OpenAPI schema to v2.7.0 --- .changeset/modern-moons-pick.md | 5 ++ .schema-version | 2 +- README.md | 1 + docs/Model/Proxy.md | 3 +- docs/Model/ProxyConfidence.md | 6 +++ docs/Model/WebhookProxy.md | 3 +- res/fingerprint-server-api.yaml | 24 ++++++++-- src/Model/Proxy.php | 43 ++++++++++++++--- src/Model/ProxyConfidence.php | 46 +++++++++++++++++++ src/Model/WebhookProxy.php | 40 +++++++++++++--- test/mocks/get_event_200.json | 5 +- .../get_event_200_with_broken_format.json | 5 +- .../get_event_200_with_unknown_field.json | 5 +- test/mocks/get_event_search_200.json | 3 +- test/mocks/webhook.json | 5 +- 15 files changed, 168 insertions(+), 28 deletions(-) create mode 100644 .changeset/modern-moons-pick.md create mode 100644 docs/Model/ProxyConfidence.md create mode 100644 src/Model/ProxyConfidence.php diff --git a/.changeset/modern-moons-pick.md b/.changeset/modern-moons-pick.md new file mode 100644 index 00000000..7ca32a23 --- /dev/null +++ b/.changeset/modern-moons-pick.md @@ -0,0 +1,5 @@ +--- +'fingerprint-pro-server-api-php-sdk': minor +--- + +Add `confidence` property to the Proxy detection Smart Signal, which now supports both residential and public web proxies. \ No newline at end of file diff --git a/.schema-version b/.schema-version index 7433fb30..5c9dc9d0 100644 --- a/.schema-version +++ b/.schema-version @@ -1 +1 @@ -v2.6.0 \ No newline at end of file +v2.7.0 \ No newline at end of file diff --git a/README.md b/README.md index 52048709..43b36685 100644 --- a/README.md +++ b/README.md @@ -318,6 +318,7 @@ Class | Method | HTTP request | Description - [ProductVirtualMachine](docs/Model/ProductVirtualMachine.md) - [Products](docs/Model/Products.md) - [Proxy](docs/Model/Proxy.md) + - [ProxyConfidence](docs/Model/ProxyConfidence.md) - [RelatedVisitor](docs/Model/RelatedVisitor.md) - [RelatedVisitorsResponse](docs/Model/RelatedVisitorsResponse.md) - [RemoteControl](docs/Model/RemoteControl.md) diff --git a/docs/Model/Proxy.md b/docs/Model/Proxy.md index 3d8a8372..5b768cfa 100644 --- a/docs/Model/Proxy.md +++ b/docs/Model/Proxy.md @@ -3,7 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**result** | **bool** | `true` if the request IP address is used by a public proxy provider, `false` otherwise. | +**result** | **bool** | IP address was used by a public proxy provider or belonged to a known recent residential proxy | +**confidence** | [**\Fingerprint\ServerAPI\Model\ProxyConfidence**](ProxyConfidence.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/Model/ProxyConfidence.md b/docs/Model/ProxyConfidence.md new file mode 100644 index 00000000..9bf10ad9 --- /dev/null +++ b/docs/Model/ProxyConfidence.md @@ -0,0 +1,6 @@ +# ProxyConfidence +Confidence level of the proxy detection. +If a proxy is not detected, confidence is "high". +If it's detected, can be "low", "medium", or "high". + + diff --git a/docs/Model/WebhookProxy.md b/docs/Model/WebhookProxy.md index 536c07a9..40f443f4 100644 --- a/docs/Model/WebhookProxy.md +++ b/docs/Model/WebhookProxy.md @@ -3,7 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**result** | **bool** | `true` if the request IP address is used by a public proxy provider, `false` otherwise. | [optional] +**result** | **bool** | IP address was used by a public proxy provider or belonged to a known recent residential proxy | [optional] +**confidence** | [**\Fingerprint\ServerAPI\Model\ProxyConfidence**](ProxyConfidence.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/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index e7bd3ba9..acc13706 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -953,6 +953,7 @@ paths: relay: false proxy: result: false + confidence: high tampering: result: false anomalyScore: 0 @@ -1724,17 +1725,30 @@ components: $ref: '#/components/schemas/VPN' error: $ref: '#/components/schemas/Error' + ProxyConfidence: + type: string + enum: + - low + - medium + - high + description: | + Confidence level of the proxy detection. + If a proxy is not detected, confidence is "high". + If it's detected, can be "low", "medium", or "high". Proxy: type: object additionalProperties: false required: - result + - confidence properties: result: type: boolean description: > - `true` if the request IP address is used by a public proxy provider, - `false` otherwise. + IP address was used by a public proxy provider or belonged to a + known recent residential proxy + confidence: + $ref: '#/components/schemas/ProxyConfidence' ProductProxy: type: object additionalProperties: false @@ -2485,8 +2499,10 @@ components: result: type: boolean description: > - `true` if the request IP address is used by a public proxy provider, - `false` otherwise. + IP address was used by a public proxy provider or belonged to a + known recent residential proxy + confidence: + $ref: '#/components/schemas/ProxyConfidence' WebhookTampering: type: object additionalProperties: false diff --git a/src/Model/Proxy.php b/src/Model/Proxy.php index c40dff94..ce2885fb 100644 --- a/src/Model/Proxy.php +++ b/src/Model/Proxy.php @@ -52,7 +52,8 @@ class Proxy implements ModelInterface, \ArrayAccess * @var string[] */ protected static array $swaggerTypes = [ - 'result' => 'bool']; + 'result' => 'bool', + 'confidence' => '\Fingerprint\ServerAPI\Model\ProxyConfidence']; /** * Array of property to format mappings. Used for (de)serialization. @@ -60,7 +61,8 @@ class Proxy implements ModelInterface, \ArrayAccess * @var string[] */ protected static array $swaggerFormats = [ - 'result' => null]; + 'result' => null, + 'confidence' => null]; /** * Array of attributes where the key is the local name, @@ -69,7 +71,8 @@ class Proxy implements ModelInterface, \ArrayAccess * @var string[] */ protected static array $attributeMap = [ - 'result' => 'result']; + 'result' => 'result', + 'confidence' => 'confidence']; /** * Array of attributes to setter functions (for deserialization of responses). @@ -77,7 +80,8 @@ class Proxy implements ModelInterface, \ArrayAccess * @var string[] */ protected static array $setters = [ - 'result' => 'setResult']; + 'result' => 'setResult', + 'confidence' => 'setConfidence']; /** * Array of attributes to getter functions (for serialization of requests). @@ -85,7 +89,8 @@ class Proxy implements ModelInterface, \ArrayAccess * @var string[] */ protected static array $getters = [ - 'result' => 'getResult']; + 'result' => 'getResult', + 'confidence' => 'getConfidence']; /** * Associative array for storing property values. @@ -103,6 +108,7 @@ class Proxy implements ModelInterface, \ArrayAccess public function __construct(?array $data = null) { $this->container['result'] = isset($data['result']) ? $data['result'] : null; + $this->container['confidence'] = isset($data['confidence']) ? $data['confidence'] : null; } /** @@ -175,6 +181,9 @@ public function listInvalidProperties(): array if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } + if (null === $this->container['confidence']) { + $invalidProperties[] = "'confidence' can't be null"; + } return $invalidProperties; } @@ -201,7 +210,7 @@ public function getResult(): bool /** * Sets result. * - * @param bool $result `true` if the request IP address is used by a public proxy provider, `false` otherwise + * @param bool $result IP address was used by a public proxy provider or belonged to a known recent residential proxy * * @return $this */ @@ -212,6 +221,28 @@ public function setResult(bool $result): self return $this; } + /** + * Gets confidence. + */ + public function getConfidence(): ProxyConfidence + { + return $this->container['confidence']; + } + + /** + * Sets confidence. + * + * @param ProxyConfidence $confidence confidence + * + * @return $this + */ + public function setConfidence(ProxyConfidence $confidence): self + { + $this->container['confidence'] = $confidence; + + return $this; + } + /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/ProxyConfidence.php b/src/Model/ProxyConfidence.php new file mode 100644 index 00000000..43eeaccb --- /dev/null +++ b/src/Model/ProxyConfidence.php @@ -0,0 +1,46 @@ + 'bool']; + 'result' => 'bool', + 'confidence' => '\Fingerprint\ServerAPI\Model\ProxyConfidence']; /** * Array of property to format mappings. Used for (de)serialization. @@ -60,7 +61,8 @@ class WebhookProxy implements ModelInterface, \ArrayAccess * @var string[] */ protected static array $swaggerFormats = [ - 'result' => null]; + 'result' => null, + 'confidence' => null]; /** * Array of attributes where the key is the local name, @@ -69,7 +71,8 @@ class WebhookProxy implements ModelInterface, \ArrayAccess * @var string[] */ protected static array $attributeMap = [ - 'result' => 'result']; + 'result' => 'result', + 'confidence' => 'confidence']; /** * Array of attributes to setter functions (for deserialization of responses). @@ -77,7 +80,8 @@ class WebhookProxy implements ModelInterface, \ArrayAccess * @var string[] */ protected static array $setters = [ - 'result' => 'setResult']; + 'result' => 'setResult', + 'confidence' => 'setConfidence']; /** * Array of attributes to getter functions (for serialization of requests). @@ -85,7 +89,8 @@ class WebhookProxy implements ModelInterface, \ArrayAccess * @var string[] */ protected static array $getters = [ - 'result' => 'getResult']; + 'result' => 'getResult', + 'confidence' => 'getConfidence']; /** * Associative array for storing property values. @@ -103,6 +108,7 @@ class WebhookProxy implements ModelInterface, \ArrayAccess public function __construct(?array $data = null) { $this->container['result'] = isset($data['result']) ? $data['result'] : null; + $this->container['confidence'] = isset($data['confidence']) ? $data['confidence'] : null; } /** @@ -195,7 +201,7 @@ public function getResult(): ?bool /** * Sets result. * - * @param ?bool $result `true` if the request IP address is used by a public proxy provider, `false` otherwise + * @param ?bool $result IP address was used by a public proxy provider or belonged to a known recent residential proxy * * @return $this */ @@ -206,6 +212,28 @@ public function setResult(?bool $result): self return $this; } + /** + * Gets confidence. + */ + public function getConfidence(): ?ProxyConfidence + { + return $this->container['confidence']; + } + + /** + * Sets confidence. + * + * @param ?\Fingerprint\ServerAPI\Model\ProxyConfidence $confidence confidence + * + * @return $this + */ + public function setConfidence(?ProxyConfidence $confidence): self + { + $this->container['confidence'] = $confidence; + + return $this; + } + /** * Returns true if offset exists. False otherwise. * diff --git a/test/mocks/get_event_200.json b/test/mocks/get_event_200.json index e88b5603..f2c2e651 100644 --- a/test/mocks/get_event_200.json +++ b/test/mocks/get_event_200.json @@ -187,7 +187,8 @@ }, "proxy": { "data": { - "result": false + "result": false, + "confidence": "high" } }, "incognito": { @@ -339,4 +340,4 @@ } } } -} +} \ No newline at end of file diff --git a/test/mocks/get_event_200_with_broken_format.json b/test/mocks/get_event_200_with_broken_format.json index 1c4a2119..29962f1c 100644 --- a/test/mocks/get_event_200_with_broken_format.json +++ b/test/mocks/get_event_200_with_broken_format.json @@ -186,7 +186,8 @@ }, "proxy": { "data": { - "result": false + "result": false, + "confidence": "high" } }, "incognito": { @@ -285,4 +286,4 @@ } } } -} +} \ No newline at end of file diff --git a/test/mocks/get_event_200_with_unknown_field.json b/test/mocks/get_event_200_with_unknown_field.json index 39111b39..7f72ea37 100644 --- a/test/mocks/get_event_200_with_unknown_field.json +++ b/test/mocks/get_event_200_with_unknown_field.json @@ -188,7 +188,8 @@ }, "proxy": { "data": { - "result": false + "result": false, + "confidence": "high" } }, "incognito": { @@ -287,4 +288,4 @@ } } } -} +} \ No newline at end of file diff --git a/test/mocks/get_event_search_200.json b/test/mocks/get_event_search_200.json index b90f62c9..ceae5a3d 100644 --- a/test/mocks/get_event_search_200.json +++ b/test/mocks/get_event_search_200.json @@ -189,7 +189,8 @@ }, "proxy": { "data": { - "result": false + "result": false, + "confidence": "high" } }, "incognito": { diff --git a/test/mocks/webhook.json b/test/mocks/webhook.json index 24c5b528..45dfc1e8 100644 --- a/test/mocks/webhook.json +++ b/test/mocks/webhook.json @@ -130,7 +130,8 @@ } }, "proxy": { - "result": false + "result": false, + "confidence": "high" }, "tampering": { "result": false, @@ -246,4 +247,4 @@ "mitmAttack": { "result": false } -} +} \ No newline at end of file