Skip to content

Commit

Permalink
Merge pull request #18 from fingerprintjs/botd-url-field
Browse files Browse the repository at this point in the history
Add to botd url field
  • Loading branch information
ilfa authored Oct 25, 2022
2 parents a4310c7 + 24bfdf0 commit dd258f0
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/BotdResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions docs/FingerprintApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ except ApiException as e:

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**request_id** | **str**| Request ID |

### Return type
Expand Down Expand Up @@ -92,6 +94,8 @@ except ApiException as e:

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**visitor_id** | **str**| |
**request_id** | **str**| Filter events by requestId | [optional]
**linked_id** | **str**| Filter events by custom identifier | [optional]
Expand Down
31 changes: 30 additions & 1 deletion fingerprint_pro_server_api_sdk/models/botd_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions res/fingerprint-server-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -3182,7 +3183,6 @@ components:
- visitorFound
Visit:
type: object
additionalProperties: false
properties:
requestId:
description: Unique identifier of the user's identification request.
Expand Down Expand Up @@ -3517,7 +3517,6 @@ components:
$ref: '#/components/schemas/ProductsResponse'
BotdResult:
type: object
additionalProperties: false
description: Contains all the information from BOTD product
properties:
ip:
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions template/api_doc.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ except ApiException as e:
```

### Parameters
{{^allParams}}This endpoint does not need any parameter.
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#@last}}
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------{{/allParams}}
------------- | ------------- | ------------- | -------------{{/@last}}{{/allParams}}
{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
{{/allParams}}

Expand All @@ -55,7 +55,7 @@ Name | Type | Description | Notes

### Authorization

[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery)
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^@last}}, {{/@last}}{{/authMethods}}

### HTTP request headers

Expand Down
1 change: 1 addition & 0 deletions test/mocks/get_event.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"bot": {
"result": "notDetected"
},
"url": "https://www.example.com/login",
"ip": "61.127.217.15",
"time": "2019-05-21T16:40:13Z"
}
Expand Down

0 comments on commit dd258f0

Please sign in to comment.