Skip to content

Commit

Permalink
feat: update OpenAPI schema
Browse files Browse the repository at this point in the history
  • Loading branch information
ilfa committed Nov 25, 2024
1 parent e6d9558 commit cff0ef7
Show file tree
Hide file tree
Showing 25 changed files with 506 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/deep-sides-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fingerprint-pro-server-api-python-sdk': patch
---

Fix errors examples `403_feature_not_enabled` and `403_subscription_not_active`.
5 changes: 5 additions & 0 deletions .changeset/forty-seas-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fingerprint-pro-server-api-python-sdk': minor
---

Add `relay` detection method to the VPN Detection Smart Signal
5 changes: 5 additions & 0 deletions .changeset/orange-poets-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fingerprint-pro-server-api-python-sdk': minor
---

**events**: Add a `suspect` field to the `identification` product schema
5 changes: 5 additions & 0 deletions .changeset/shy-worms-wish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fingerprint-pro-server-api-python-sdk': minor
---

Remove `ipv4` format from `ip` field in `Botd`, `Identification`, `Visit` and `Webhook` models.
2 changes: 1 addition & 1 deletion .schema-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.0.0
v2.2.0
2 changes: 1 addition & 1 deletion docs/FactoryReset.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**time** | **datetime** | 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. |
**timestamp** | **int** | 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. |
**timestamp** | **int** | 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. |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

1 change: 1 addition & 0 deletions docs/Identification.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Name | Type | Description | Notes
**ip** | **str** | IP address of the requesting browser or bot. |
**ip_location** | [**DeprecatedGeolocation**](DeprecatedGeolocation.md) | | [optional]
**linked_id** | **str** | A customer-provided id that was sent with the request. | [optional]
**suspect** | **bool** | Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent). | [optional]
**timestamp** | **int** | Timestamp of the event with millisecond precision in Unix time. |
**time** | **datetime** | Time expressed according to ISO 8601 in UTC format, 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. |
**url** | **str** | Page URL from which the request was sent. |
Expand Down
1 change: 1 addition & 0 deletions docs/VPNMethods.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Name | Type | Description | Notes
**public_vpn** | **bool** | Request IP address is owned and used by a public VPN service provider. |
**auxiliary_mobile** | **bool** | This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. |
**os_mismatch** | **bool** | The browser runs on a different operating system than the operating system inferred from the request network signature. |
**relay** | **bool** | Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

2 changes: 1 addition & 1 deletion docs/WebhookFactoryReset.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**time** | **datetime** | 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. | [optional]
**timestamp** | **int** | 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. | [optional]
**timestamp** | **int** | 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. | [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)

4 changes: 2 additions & 2 deletions fingerprint_pro_server_api_sdk/models/factory_reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def time(self, time: datetime):
def timestamp(self) -> int:
"""Gets the timestamp of this FactoryReset. # noqa: E501
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. # noqa: E501
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. # noqa: E501
:return: The timestamp of this FactoryReset. # noqa: E501
"""
Expand All @@ -83,7 +83,7 @@ def timestamp(self) -> int:
def timestamp(self, timestamp: int):
"""Sets the timestamp of this FactoryReset.
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. # noqa: E501
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. # noqa: E501
:param timestamp: The timestamp of this FactoryReset. # noqa: E501
"""
Expand Down
28 changes: 27 additions & 1 deletion fingerprint_pro_server_api_sdk/models/identification.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Identification(BaseModel):
'ip': 'str',
'ip_location': 'DeprecatedGeolocation',
'linked_id': 'str',
'suspect': 'bool',
'timestamp': 'int',
'time': 'datetime',
'url': 'str',
Expand All @@ -62,6 +63,7 @@ class Identification(BaseModel):
'ip': 'ip',
'ip_location': 'ipLocation',
'linked_id': 'linkedId',
'suspect': 'suspect',
'timestamp': 'timestamp',
'time': 'time',
'url': 'url',
Expand All @@ -73,7 +75,7 @@ class Identification(BaseModel):
'components': 'components'
}

def __init__(self, visitor_id=None, request_id=None, browser_details=None, incognito=None, ip=None, ip_location=None, linked_id=None, timestamp=None, time=None, url=None, tag=None, confidence=None, visitor_found=None, first_seen_at=None, last_seen_at=None, components=None): # noqa: E501
def __init__(self, visitor_id=None, request_id=None, browser_details=None, incognito=None, ip=None, ip_location=None, linked_id=None, suspect=None, timestamp=None, time=None, url=None, tag=None, confidence=None, visitor_found=None, first_seen_at=None, last_seen_at=None, components=None): # noqa: E501
"""Identification - a model defined in Swagger""" # noqa: E501
self._visitor_id = None
self._request_id = None
Expand All @@ -82,6 +84,7 @@ def __init__(self, visitor_id=None, request_id=None, browser_details=None, incog
self._ip = None
self._ip_location = None
self._linked_id = None
self._suspect = None
self._timestamp = None
self._time = None
self._url = None
Expand All @@ -101,6 +104,8 @@ def __init__(self, visitor_id=None, request_id=None, browser_details=None, incog
self.ip_location = ip_location
if linked_id is not None:
self.linked_id = linked_id
if suspect is not None:
self.suspect = suspect
self.timestamp = timestamp
self.time = time
self.url = url
Expand Down Expand Up @@ -266,6 +271,27 @@ def linked_id(self, linked_id: Optional[str]):

self._linked_id = linked_id

@property
def suspect(self) -> Optional[bool]:
"""Gets the suspect of this Identification. # noqa: E501
Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent). # noqa: E501
:return: The suspect of this Identification. # noqa: E501
"""
return self._suspect

@suspect.setter
def suspect(self, suspect: Optional[bool]):
"""Sets the suspect of this Identification.
Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent). # noqa: E501
:param suspect: The suspect of this Identification. # noqa: E501
"""

self._suspect = suspect

@property
def timestamp(self) -> int:
"""Gets the timestamp of this Identification. # noqa: E501
Expand Down
33 changes: 30 additions & 3 deletions fingerprint_pro_server_api_sdk/models/vpn_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,31 @@ class VPNMethods(BaseModel):
'timezone_mismatch': 'bool',
'public_vpn': 'bool',
'auxiliary_mobile': 'bool',
'os_mismatch': 'bool'
'os_mismatch': 'bool',
'relay': 'bool'
}

attribute_map = {
'timezone_mismatch': 'timezoneMismatch',
'public_vpn': 'publicVPN',
'auxiliary_mobile': 'auxiliaryMobile',
'os_mismatch': 'osMismatch'
'os_mismatch': 'osMismatch',
'relay': 'relay'
}

def __init__(self, timezone_mismatch=None, public_vpn=None, auxiliary_mobile=None, os_mismatch=None): # noqa: E501
def __init__(self, timezone_mismatch=None, public_vpn=None, auxiliary_mobile=None, os_mismatch=None, relay=None): # noqa: E501
"""VPNMethods - a model defined in Swagger""" # noqa: E501
self._timezone_mismatch = None
self._public_vpn = None
self._auxiliary_mobile = None
self._os_mismatch = None
self._relay = None
self.discriminator = None
self.timezone_mismatch = timezone_mismatch
self.public_vpn = public_vpn
self.auxiliary_mobile = auxiliary_mobile
self.os_mismatch = os_mismatch
self.relay = relay

@property
def timezone_mismatch(self) -> bool:
Expand Down Expand Up @@ -145,3 +149,26 @@ def os_mismatch(self, os_mismatch: bool):

self._os_mismatch = os_mismatch

@property
def relay(self) -> bool:
"""Gets the relay of this VPNMethods. # noqa: E501
Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. # noqa: E501
:return: The relay of this VPNMethods. # noqa: E501
"""
return self._relay

@relay.setter
def relay(self, relay: bool):
"""Sets the relay of this VPNMethods.
Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. # noqa: E501
:param relay: The relay of this VPNMethods. # noqa: E501
"""
if relay is None:
raise ValueError("Invalid value for `relay`, must not be `None`") # noqa: E501

self._relay = relay

Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def time(self, time: Optional[datetime]):
def timestamp(self) -> Optional[int]:
"""Gets the timestamp of this WebhookFactoryReset. # noqa: E501
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. # noqa: E501
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. # noqa: E501
:return: The timestamp of this WebhookFactoryReset. # noqa: E501
"""
Expand All @@ -83,7 +83,7 @@ def timestamp(self) -> Optional[int]:
def timestamp(self, timestamp: Optional[int]):
"""Sets the timestamp of this WebhookFactoryReset.
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. # noqa: E501
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. # noqa: E501
:param timestamp: The timestamp of this WebhookFactoryReset. # noqa: E501
"""
Expand Down
29 changes: 27 additions & 2 deletions res/fingerprint-server-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ paths:
publicVPN: false
auxiliaryMobile: false
osMismatch: false
relay: false
proxy:
result: false
tampering:
Expand Down Expand Up @@ -848,6 +849,12 @@ components:
linkedId:
type: string
description: A customer-provided id that was sent with the request.
suspect:
description: >-
Field is `true` if you have previously set the `suspect` flag for
this event using the [Server API Update event
endpoint](https://dev.fingerprint.com/reference/updateevent).
type: boolean
timestamp:
description: Timestamp of the event with millisecond precision in Unix time.
type: integer
Expand Down Expand Up @@ -1218,6 +1225,7 @@ components:
- publicVPN
- auxiliaryMobile
- osMismatch
- relay
properties:
timezoneMismatch:
type: boolean
Expand All @@ -1239,6 +1247,23 @@ components:
description: >-
The browser runs on a different operating system than the operating
system inferred from the request network signature.
relay:
type: boolean
description: >
Request IP address belongs to a relay service provider, indicating
the use of relay services like [Apple Private
relay](https://support.apple.com/en-us/102602) or [Cloudflare
Warp](https://developers.cloudflare.com/warp-client/).
* Like VPNs, relay services anonymize the visitor's true IP address.
* Unlike traditional VPNs, relay services don't let visitors spoof
their location by choosing an exit node in a different country.
This field allows you to differentiate VPN users and relay service
users in your fraud prevention logic.
VPN:
type: object
additionalProperties: false
Expand Down Expand Up @@ -1400,7 +1425,7 @@ components:
field.
The time of the most recent factory reset that happened on the
**mobile device** is expressed as Unix epoch time.
**mobile device** is expressed as Unix epoch time.
ProductFactoryReset:
type: object
additionalProperties: false
Expand Down Expand Up @@ -2022,7 +2047,7 @@ components:
field.
The time of the most recent factory reset that happened on the
**mobile device** is expressed as Unix epoch time.
**mobile device** is expressed as Unix epoch time.
WebhookJailbroken:
type: object
additionalProperties: false
Expand Down
6 changes: 6 additions & 0 deletions test/mocks/errors/400_bot_type_invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"error": {
"code": "RequestCannotBeParsed",
"message": "invalid bot type"
}
}
6 changes: 6 additions & 0 deletions test/mocks/errors/400_end_time_invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"error": {
"code": "RequestCannotBeParsed",
"message": "invalid end time"
}
}
6 changes: 6 additions & 0 deletions test/mocks/errors/400_ip_address_invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"error": {
"code": "RequestCannotBeParsed",
"message": "invalid ip address"
}
}
6 changes: 6 additions & 0 deletions test/mocks/errors/400_limit_invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"error": {
"code": "RequestCannotBeParsed",
"message": "invalid limit"
}
}
6 changes: 6 additions & 0 deletions test/mocks/errors/400_linked_id_invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"error": {
"code": "RequestCannotBeParsed",
"message": "linked_id can't be greater than 256 characters long"
}
}
6 changes: 6 additions & 0 deletions test/mocks/errors/400_pagination_key_invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"error": {
"code": "RequestCannotBeParsed",
"message": "invalid pagination key"
}
}
6 changes: 6 additions & 0 deletions test/mocks/errors/400_reverse_invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"error": {
"code": "RequestCannotBeParsed",
"message": "invalid reverse param"
}
}
6 changes: 6 additions & 0 deletions test/mocks/errors/400_start_time_invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"error": {
"code": "RequestCannotBeParsed",
"message": "invalid start time"
}
}
3 changes: 2 additions & 1 deletion test/mocks/get_event_200.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@
"timezoneMismatch": false,
"publicVPN": false,
"auxiliaryMobile": false,
"osMismatch": false
"osMismatch": false,
"relay": false
}
}
},
Expand Down
Loading

0 comments on commit cff0ef7

Please sign in to comment.