From 24bfdf0339bf9965b7e5a31e0871304c87562c7e Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Tue, 18 Oct 2022 19:02:33 +0200 Subject: [PATCH] feat: update schema to support url field for botd result --- docs/BotdResult.md | 1 + .../models/botd_result.py | 31 ++++++++++++++++++- res/fingerprint-server-api.yaml | 9 ++++-- test/mocks/get_event.json | 1 + 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/docs/BotdResult.md b/docs/BotdResult.md index af676d6a..0adca28a 100644 --- a/docs/BotdResult.md +++ b/docs/BotdResult.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ip** | **str** | IP address of the requesting browser or bot. | **time** | **datetime** | 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 | +**url** | **str** | Page URL from which identification request was sent. | **bot** | [**BotdDetectionResult**](BotdDetectionResult.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/fingerprint_pro_server_api_sdk/models/botd_result.py b/fingerprint_pro_server_api_sdk/models/botd_result.py index db790429..38ba0bc9 100644 --- a/fingerprint_pro_server_api_sdk/models/botd_result.py +++ b/fingerprint_pro_server_api_sdk/models/botd_result.py @@ -30,23 +30,27 @@ class BotdResult(object): swagger_types = { 'ip': 'str', 'time': 'datetime', + 'url': 'str', 'bot': 'BotdDetectionResult' } attribute_map = { 'ip': 'ip', 'time': 'time', + 'url': 'url', 'bot': 'bot' } - def __init__(self, ip=None, time=None, bot=None): # noqa: E501 + def __init__(self, ip=None, time=None, url=None, bot=None): # noqa: E501 """BotdResult - a model defined in Swagger""" # noqa: E501 self._ip = None self._time = None + self._url = None self._bot = None self.discriminator = None self.ip = ip self.time = time + self.url = url self.bot = bot @property @@ -99,6 +103,31 @@ def time(self, time): self._time = time + @property + def url(self): + """Gets the url of this BotdResult. # noqa: E501 + + Page URL from which identification request was sent. # noqa: E501 + + :return: The url of this BotdResult. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this BotdResult. + + Page URL from which identification request was sent. # noqa: E501 + + :param url: The url of this BotdResult. # noqa: E501 + :type: str + """ + if url is None: + raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 + + self._url = url + @property def bot(self): """Gets the bot of this BotdResult. # noqa: E501 diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index afe0c85f..07807805 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -102,6 +102,7 @@ paths: data: bot: result: notDetected + url: https://www.example.com/login ip: 61.127.217.15 time: '2019-05-21T16:40:13Z' '400': @@ -3182,7 +3183,6 @@ components: - visitorFound Visit: type: object - additionalProperties: false properties: requestId: description: Unique identifier of the user's identification request. @@ -3517,7 +3517,6 @@ components: $ref: '#/components/schemas/ProductsResponse' BotdResult: type: object - additionalProperties: false description: Contains all the information from BOTD product properties: ip: @@ -3534,12 +3533,18 @@ components: type: string format: date-time example: '2022-06-09T22:58:36Z' + url: + description: Page URL from which identification request was sent. + type: string + format: uri-reference + example: https://b.fpjs.sh/ bot: $ref: '#/components/schemas/BotdDetectionResult' example: result: notDetected required: - bot + - url - ip - time BotdDetectionResult: diff --git a/test/mocks/get_event.json b/test/mocks/get_event.json index 9ed8697b..4e1eccd6 100644 --- a/test/mocks/get_event.json +++ b/test/mocks/get_event.json @@ -62,6 +62,7 @@ "bot": { "result": "notDetected" }, + "url": "https://www.example.com/login", "ip": "61.127.217.15", "time": "2019-05-21T16:40:13Z" }