From 84fac2bca03309f7c2a05635412390af8deff5f6 Mon Sep 17 00:00:00 2001 From: TheUnderScorer Date: Thu, 3 Oct 2024 13:08:02 +0000 Subject: [PATCH] feat: update OpenAPI schema --- .changeset/orange-taxis-fetch.md | 5 + .schema-version | 1 + README.md | 1 - docs/Api/FingerprintApi.md | 2 +- docs/Model/Visit.md | 22 - docs/Model/VpnResult.md | 1 + res/fingerprint-server-api.yaml | 2729 ++++++++--------- src/Model/Visit.php | 659 ---- src/Model/VpnResult.php | 74 +- test/mocks/get_event_200.json | 3 +- ...on_too_many_requests_error_all_fields.json | 112 + .../get_event_200_with_broken_format.json | 283 -- .../get_event_200_with_unknown_field.json | 285 -- .../get_related_visitors_200.json | 10 + .../get_related_visitors_200_empty.json | 3 + .../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 +- 26 files changed, 1551 insertions(+), 2652 deletions(-) create mode 100644 .changeset/orange-taxis-fetch.md create mode 100644 .schema-version delete mode 100644 docs/Model/Visit.md delete mode 100644 src/Model/Visit.php create mode 100644 test/mocks/get_event_200_identification_too_many_requests_error_all_fields.json delete mode 100644 test/mocks/get_event_200_with_broken_format.json delete mode 100644 test/mocks/get_event_200_with_unknown_field.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 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..7258e506 --- /dev/null +++ b/.changeset/orange-taxis-fetch.md @@ -0,0 +1,5 @@ +--- +'fingerprint-pro-server-api-php-sdk': minor +--- + +**visitors**: Add the confidence field to the VPN Detection Smart Signal \ No newline at end of file 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 66b77a52..cce94de4 100644 --- a/README.md +++ b/README.md @@ -328,7 +328,6 @@ Class | Method | HTTP request | Description - [VelocityIntervals](docs/Model/VelocityIntervals.md) - [VelocityResult](docs/Model/VelocityResult.md) - [VirtualMachineResult](docs/Model/VirtualMachineResult.md) - - [Visit](docs/Model/Visit.md) - [VpnResult](docs/Model/VpnResult.md) - [VpnResultMethods](docs/Model/VpnResultMethods.md) - [WebhookVisit](docs/Model/WebhookVisit.md) diff --git a/docs/Api/FingerprintApi.md b/docs/Api/FingerprintApi.md index 7f367e17..e21e4b76 100644 --- a/docs/Api/FingerprintApi.md +++ b/docs/Api/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 ```php diff --git a/docs/Model/Visit.md b/docs/Model/Visit.md deleted file mode 100644 index a2fe21c9..00000000 --- a/docs/Model/Visit.md +++ /dev/null @@ -1,22 +0,0 @@ -# Visit - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**request_id** | **string** | Unique identifier of the user's identification request. | -**browser_details** | [**\Fingerprint\ServerAPI\Model\BrowserDetails**](BrowserDetails.md) | | -**incognito** | **bool** | Flag if user used incognito session. | -**ip** | **string** | | -**ip_location** | [**\Fingerprint\ServerAPI\Model\DeprecatedIPLocation**](DeprecatedIPLocation.md) | | [optional] -**timestamp** | **int** | Timestamp of the event with millisecond precision in Unix time. | -**time** | [**\DateTime**](\DateTime.md) | Time expressed according to ISO 8601 in UTC format. | -**url** | **string** | Page URL from which the identification request was sent. | -**tag** | **map[string,object]** | A customer-provided value or an object that was sent with identification request. | [optional] -**linked_id** | **string** | A customer-provided id that was sent with identification request. | [optional] -**confidence** | [**\Fingerprint\ServerAPI\Model\Confidence**](Confidence.md) | | [optional] -**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) | | - -[[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 b3f9897e..b0cc66b5 100644 --- a/docs/Model/VpnResult.md +++ b/docs/Model/VpnResult.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **origin_timezone** | **string** | Local timezone which is used in timezoneMismatch method. | **origin_country** | **string** | Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). | [optional] **methods** | [**\Fingerprint\ServerAPI\Model\VpnResultMethods**](VpnResultMethods.md) | | +**confidence** | **string** | 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/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/src/Model/Visit.php b/src/Model/Visit.php deleted file mode 100644 index 1ec382f2..00000000 --- a/src/Model/Visit.php +++ /dev/null @@ -1,659 +0,0 @@ - 'string', - 'browser_details' => '\Fingerprint\ServerAPI\Model\BrowserDetails', - 'incognito' => 'bool', - 'ip' => 'string', - 'ip_location' => '\Fingerprint\ServerAPI\Model\DeprecatedIPLocation', - 'timestamp' => 'int', - 'time' => '\DateTime', - 'url' => 'string', - 'tag' => 'map[string,object]', - 'linked_id' => 'string', - 'confidence' => '\Fingerprint\ServerAPI\Model\Confidence', - 'visitor_found' => 'bool', - 'first_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt', - 'last_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt']; - - /** - * Array of property to format mappings. Used for (de)serialization. - * - * @var string[] - */ - protected static array $swaggerFormats = [ - 'request_id' => null, - 'browser_details' => null, - 'incognito' => null, - 'ip' => 'ipv4', - 'ip_location' => null, - 'timestamp' => 'int64', - 'time' => 'date-time', - 'url' => null, - 'tag' => null, - 'linked_id' => null, - 'confidence' => null, - 'visitor_found' => null, - 'first_seen_at' => null, - 'last_seen_at' => null]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name. - * - * @var string[] - */ - protected static array $attributeMap = [ - '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']; - - /** - * Array of attributes to setter functions (for deserialization of responses). - * - * @var string[] - */ - protected static array $setters = [ - 'request_id' => 'setRequestId', - 'browser_details' => 'setBrowserDetails', - 'incognito' => 'setIncognito', - 'ip' => 'setIp', - 'ip_location' => 'setIpLocation', - 'timestamp' => 'setTimestamp', - 'time' => 'setTime', - 'url' => 'setUrl', - 'tag' => 'setTag', - 'linked_id' => 'setLinkedId', - 'confidence' => 'setConfidence', - 'visitor_found' => 'setVisitorFound', - 'first_seen_at' => 'setFirstSeenAt', - 'last_seen_at' => 'setLastSeenAt']; - - /** - * Array of attributes to getter functions (for serialization of requests). - * - * @var string[] - */ - protected static array $getters = [ - 'request_id' => 'getRequestId', - 'browser_details' => 'getBrowserDetails', - 'incognito' => 'getIncognito', - 'ip' => 'getIp', - 'ip_location' => 'getIpLocation', - 'timestamp' => 'getTimestamp', - 'time' => 'getTime', - 'url' => 'getUrl', - 'tag' => 'getTag', - 'linked_id' => 'getLinkedId', - 'confidence' => 'getConfidence', - 'visitor_found' => 'getVisitorFound', - 'first_seen_at' => 'getFirstSeenAt', - 'last_seen_at' => 'getLastSeenAt']; - - /** - * Associative array for storing property values. - * - * @var mixed[] - */ - protected array $container = []; - - /** - * Constructor. - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = 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['incognito'] = isset($data['incognito']) ? $data['incognito'] : null; - $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; - $this->container['ip_location'] = isset($data['ip_location']) ? $data['ip_location'] : null; - $this->container['timestamp'] = isset($data['timestamp']) ? $data['timestamp'] : null; - $this->container['time'] = isset($data['time']) ? $data['time'] : null; - $this->container['url'] = isset($data['url']) ? $data['url'] : null; - $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; - $this->container['linked_id'] = isset($data['linked_id']) ? $data['linked_id'] : null; - $this->container['confidence'] = isset($data['confidence']) ? $data['confidence'] : null; - $this->container['visitor_found'] = isset($data['visitor_found']) ? $data['visitor_found'] : null; - $this->container['first_seen_at'] = isset($data['first_seen_at']) ? $data['first_seen_at'] : null; - $this->container['last_seen_at'] = isset($data['last_seen_at']) ? $data['last_seen_at'] : null; - } - - /** - * Gets the string presentation of the object. - * - */ - public function __toString(): string - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } - - /** - * Array of property to type mappings. Used for (de)serialization. - */ - public static function swaggerTypes(): array - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization. - */ - public static function swaggerFormats(): array - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name. - */ - public static function attributeMap(): array - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses). - */ - public static function setters(): array - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests). - */ - public static function getters(): array - { - return self::$getters; - } - - /** - * The original name of the model. - */ - public function getModelName(): string - { - return self::$swaggerModelName; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties(): array - { - $invalidProperties = []; - - if (null === $this->container['request_id']) { - $invalidProperties[] = "'request_id' can't be null"; - } - if (null === $this->container['browser_details']) { - $invalidProperties[] = "'browser_details' can't be null"; - } - if (null === $this->container['incognito']) { - $invalidProperties[] = "'incognito' can't be null"; - } - if (null === $this->container['ip']) { - $invalidProperties[] = "'ip' can't be null"; - } - if (null === $this->container['timestamp']) { - $invalidProperties[] = "'timestamp' can't be null"; - } - if (null === $this->container['time']) { - $invalidProperties[] = "'time' can't be null"; - } - if (null === $this->container['url']) { - $invalidProperties[] = "'url' can't be null"; - } - if (null === $this->container['visitor_found']) { - $invalidProperties[] = "'visitor_found' can't be null"; - } - if (null === $this->container['first_seen_at']) { - $invalidProperties[] = "'first_seen_at' can't be null"; - } - if (null === $this->container['last_seen_at']) { - $invalidProperties[] = "'last_seen_at' can't be null"; - } - - 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(): bool - { - return 0 === count($this->listInvalidProperties()); - } - - /** - * Gets request_id. - */ - public function getRequestId(): string - { - return $this->container['request_id']; - } - - /** - * Sets request_id. - * - * @param string $request_id unique identifier of the user's identification request - * - * @return $this - */ - public function setRequestId(string $request_id): self - { - $this->container['request_id'] = $request_id; - - return $this; - } - - /** - * Gets browser_details. - */ - public function getBrowserDetails(): BrowserDetails - { - return $this->container['browser_details']; - } - - /** - * Sets browser_details. - * - * @param BrowserDetails $browser_details browser_details - * - * @return $this - */ - public function setBrowserDetails(BrowserDetails $browser_details): self - { - $this->container['browser_details'] = $browser_details; - - return $this; - } - - /** - * Gets incognito. - */ - public function getIncognito(): bool - { - return $this->container['incognito']; - } - - /** - * Sets incognito. - * - * @param bool $incognito flag if user used incognito session - * - * @return $this - */ - public function setIncognito(bool $incognito): self - { - $this->container['incognito'] = $incognito; - - return $this; - } - - /** - * Gets ip. - */ - public function getIp(): string - { - return $this->container['ip']; - } - - /** - * Sets ip. - * - * @param string $ip ip - * - * @return $this - */ - public function setIp(string $ip): self - { - $this->container['ip'] = $ip; - - return $this; - } - - /** - * Gets ip_location. - */ - public function getIpLocation(): ?DeprecatedIPLocation - { - return $this->container['ip_location']; - } - - /** - * Sets ip_location. - * - * @param ?\Fingerprint\ServerAPI\Model\DeprecatedIPLocation $ip_location ip_location - * - * @return $this - */ - public function setIpLocation(?DeprecatedIPLocation $ip_location): self - { - $this->container['ip_location'] = $ip_location; - - return $this; - } - - /** - * Gets timestamp. - */ - public function getTimestamp(): int - { - return $this->container['timestamp']; - } - - /** - * Sets timestamp. - * - * @param int $timestamp timestamp of the event with millisecond precision in Unix time - * - * @return $this - */ - public function setTimestamp(int $timestamp): self - { - $this->container['timestamp'] = $timestamp; - - return $this; - } - - /** - * Gets time. - */ - public function getTime(): \DateTime - { - return $this->container['time']; - } - - /** - * Sets time. - * - * @param \DateTime $time time expressed according to ISO 8601 in UTC format - * - * @return $this - */ - public function setTime(\DateTime $time): self - { - $this->container['time'] = $time; - - return $this; - } - - /** - * Gets url. - */ - public function getUrl(): string - { - return $this->container['url']; - } - - /** - * Sets url. - * - * @param string $url page URL from which the identification request was sent - * - * @return $this - */ - public function setUrl(string $url): self - { - $this->container['url'] = $url; - - return $this; - } - - /** - * Gets tag. - * - * @return ?map[string,object] - */ - public function getTag(): ?array - { - return $this->container['tag']; - } - - /** - * Sets tag. - * - * @param ?map[string,object] $tag A customer-provided value or an object that was sent with identification request - * - * @return $this - */ - public function setTag(?array $tag): self - { - $this->container['tag'] = $tag; - - return $this; - } - - /** - * Gets linked_id. - */ - public function getLinkedId(): ?string - { - return $this->container['linked_id']; - } - - /** - * Sets linked_id. - * - * @param ?string $linked_id a customer-provided id that was sent with identification request - * - * @return $this - */ - public function setLinkedId(?string $linked_id): self - { - $this->container['linked_id'] = $linked_id; - - return $this; - } - - /** - * Gets confidence. - */ - public function getConfidence(): ?Confidence - { - return $this->container['confidence']; - } - - /** - * Sets confidence. - * - * @param ?\Fingerprint\ServerAPI\Model\Confidence $confidence confidence - * - * @return $this - */ - public function setConfidence(?Confidence $confidence): self - { - $this->container['confidence'] = $confidence; - - return $this; - } - - /** - * Gets visitor_found. - */ - public function getVisitorFound(): bool - { - return $this->container['visitor_found']; - } - - /** - * Sets visitor_found. - * - * @param bool $visitor_found attribute represents if a visitor had been identified before - * - * @return $this - */ - public function setVisitorFound(bool $visitor_found): self - { - $this->container['visitor_found'] = $visitor_found; - - return $this; - } - - /** - * Gets first_seen_at. - */ - public function getFirstSeenAt(): SeenAt - { - return $this->container['first_seen_at']; - } - - /** - * Sets first_seen_at. - * - * @param SeenAt $first_seen_at first_seen_at - * - * @return $this - */ - public function setFirstSeenAt(SeenAt $first_seen_at): self - { - $this->container['first_seen_at'] = $first_seen_at; - - return $this; - } - - /** - * Gets last_seen_at. - */ - public function getLastSeenAt(): SeenAt - { - return $this->container['last_seen_at']; - } - - /** - * Sets last_seen_at. - * - * @param SeenAt $last_seen_at last_seen_at - * - * @return $this - */ - public function setLastSeenAt(SeenAt $last_seen_at): self - { - $this->container['last_seen_at'] = $last_seen_at; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param int $offset Offset - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param int $offset Offset - */ - public function offsetGet($offset): mixed - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param int $offset Offset - * @param mixed $value Value to be set - */ - public function offsetSet($offset, mixed $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param int $offset Offset - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } -} diff --git a/src/Model/VpnResult.php b/src/Model/VpnResult.php index a06f6c8d..c035b7a2 100644 --- a/src/Model/VpnResult.php +++ b/src/Model/VpnResult.php @@ -40,6 +40,10 @@ */ class VpnResult implements ModelInterface, \ArrayAccess { + public const CONFIDENCE_LOW = 'low'; + public const CONFIDENCE_MEDIUM = 'medium'; + public const CONFIDENCE_HIGH = 'high'; + /** * The original name of the model. * @@ -55,7 +59,8 @@ class VpnResult implements ModelInterface, \ArrayAccess 'result' => 'bool', 'origin_timezone' => 'string', 'origin_country' => 'string', - 'methods' => '\Fingerprint\ServerAPI\Model\VpnResultMethods']; + 'methods' => '\Fingerprint\ServerAPI\Model\VpnResultMethods', + 'confidence' => 'string']; /** * Array of property to format mappings. Used for (de)serialization. @@ -66,7 +71,8 @@ class VpnResult implements ModelInterface, \ArrayAccess 'result' => null, 'origin_timezone' => null, 'origin_country' => null, - 'methods' => null]; + 'methods' => null, + 'confidence' => null]; /** * Array of attributes where the key is the local name, @@ -78,7 +84,8 @@ class VpnResult implements ModelInterface, \ArrayAccess 'result' => 'result', 'origin_timezone' => 'originTimezone', 'origin_country' => 'originCountry', - 'methods' => 'methods']; + 'methods' => 'methods', + 'confidence' => 'confidence']; /** * Array of attributes to setter functions (for deserialization of responses). @@ -89,7 +96,8 @@ class VpnResult implements ModelInterface, \ArrayAccess 'result' => 'setResult', 'origin_timezone' => 'setOriginTimezone', 'origin_country' => 'setOriginCountry', - 'methods' => 'setMethods']; + 'methods' => 'setMethods', + 'confidence' => 'setConfidence']; /** * Array of attributes to getter functions (for serialization of requests). @@ -100,7 +108,8 @@ class VpnResult implements ModelInterface, \ArrayAccess 'result' => 'getResult', 'origin_timezone' => 'getOriginTimezone', 'origin_country' => 'getOriginCountry', - 'methods' => 'getMethods']; + 'methods' => 'getMethods', + 'confidence' => 'getConfidence']; /** * Associative array for storing property values. @@ -121,6 +130,7 @@ public function __construct(?array $data = null) $this->container['origin_timezone'] = isset($data['origin_timezone']) ? $data['origin_timezone'] : null; $this->container['origin_country'] = isset($data['origin_country']) ? $data['origin_country'] : null; $this->container['methods'] = isset($data['methods']) ? $data['methods'] : null; + $this->container['confidence'] = isset($data['confidence']) ? $data['confidence'] : null; } /** @@ -188,6 +198,19 @@ public function getModelName(): string return self::$swaggerModelName; } + /** + * Gets allowable values of the enum. + * + * @return string[] + */ + public function getConfidenceAllowableValues(): array + { + return [ + self::CONFIDENCE_LOW, + self::CONFIDENCE_MEDIUM, + self::CONFIDENCE_HIGH, ]; + } + /** * Show all the invalid properties with reasons. * @@ -206,6 +229,16 @@ public function listInvalidProperties(): array if (null === $this->container['methods']) { $invalidProperties[] = "'methods' can't be null"; } + if (null === $this->container['confidence']) { + $invalidProperties[] = "'confidence' can't be null"; + } + $allowedValues = $this->getConfidenceAllowableValues(); + if (!is_null($this->container['confidence']) && !in_array($this->container['confidence'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'confidence', must be one of '%s'", + implode("', '", $allowedValues) + ); + } return $invalidProperties; } @@ -309,6 +342,37 @@ public function setMethods(VpnResultMethods $methods): self return $this; } + /** + * Gets confidence. + */ + public function getConfidence(): string + { + return $this->container['confidence']; + } + + /** + * Sets confidence. + * + * @param string $confidence A confidence rating for the VPN detection result — \"low\", \"medium\", or \"high\". Depends on the combination of results returned from all VPN detection methods. + * + * @return $this + */ + public function setConfidence(string $confidence): self + { + $allowedValues = $this->getConfidenceAllowableValues(); + if (!in_array($confidence, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'confidence', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $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 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_with_broken_format.json b/test/mocks/get_event_200_with_broken_format.json deleted file mode 100644 index 4ac8b6f5..00000000 --- a/test/mocks/get_event_200_with_broken_format.json +++ /dev/null @@ -1,283 +0,0 @@ -{ - "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/mocks/get_event_200_with_unknown_field.json b/test/mocks/get_event_200_with_unknown_field.json deleted file mode 100644 index eba63e09..00000000 --- a/test/mocks/get_event_200_with_unknown_field.json +++ /dev/null @@ -1,285 +0,0 @@ -{ - "unknown": "field", - "products": { - "unknown": "field", - "identification": { - "unknown": "field", - "data": { - "unknown": "field", - "visitorId": "Ibk1527CUFmcnjLwIs4A9", - "requestId": "1708102555327.NLOjmg", - "incognito": true, - "linkedId": "somelinkedId", - "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/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/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