Skip to content

Commit

Permalink
feat: update OpenAPI schema
Browse files Browse the repository at this point in the history
  • Loading branch information
ilfa committed Nov 25, 2024
1 parent 5076f0d commit 3b6d78f
Show file tree
Hide file tree
Showing 23 changed files with 507 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/forty-seas-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fingerprint-pro-server-api-java-sdk': minor
---

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

**events**: Add a `suspect` field to the `identification` product schema
2 changes: 1 addition & 1 deletion .schema-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.1.0
v2.2.0
2 changes: 1 addition & 1 deletion docs/FactoryReset.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**time** | **OffsetDateTime** | Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. | |
|**timestamp** | **Long** | This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. | |
|**timestamp** | **Long** | 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. | |



1 change: 1 addition & 0 deletions docs/Identification.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
|**ip** | **String** | IP address of the requesting browser or bot. | |
|**ipLocation** | [**DeprecatedGeolocation**](DeprecatedGeolocation.md) | | [optional] |
|**linkedId** | **String** | A customer-provided id that was sent with the request. | [optional] |
|**suspect** | **Boolean** | Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent). | [optional] |
|**timestamp** | **Long** | Timestamp of the event with millisecond precision in Unix time. | |
|**time** | **OffsetDateTime** | Time expressed according to ISO 8601 in UTC format, when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. | |
|**url** | **String** | Page URL from which the request was sent. | |
Expand Down
1 change: 1 addition & 0 deletions docs/VPNMethods.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
|**publicVPN** | **Boolean** | Request IP address is owned and used by a public VPN service provider. | |
|**auxiliaryMobile** | **Boolean** | This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. | |
|**osMismatch** | **Boolean** | The browser runs on a different operating system than the operating system inferred from the request network signature. | |
|**relay** | **Boolean** | Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. | |



2 changes: 1 addition & 1 deletion docs/WebhookFactoryReset.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**time** | **OffsetDateTime** | Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. | [optional] |
|**timestamp** | **Long** | This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. | [optional] |
|**timestamp** | **Long** | This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. | [optional] |



29 changes: 27 additions & 2 deletions res/fingerprint-server-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ paths:
publicVPN: false
auxiliaryMobile: false
osMismatch: false
relay: false
proxy:
result: false
tampering:
Expand Down Expand Up @@ -848,6 +849,12 @@ components:
linkedId:
type: string
description: A customer-provided id that was sent with the request.
suspect:
description: >-
Field is `true` if you have previously set the `suspect` flag for
this event using the [Server API Update event
endpoint](https://dev.fingerprint.com/reference/updateevent).
type: boolean
timestamp:
description: Timestamp of the event with millisecond precision in Unix time.
type: integer
Expand Down Expand Up @@ -1218,6 +1225,7 @@ components:
- publicVPN
- auxiliaryMobile
- osMismatch
- relay
properties:
timezoneMismatch:
type: boolean
Expand All @@ -1239,6 +1247,23 @@ components:
description: >-
The browser runs on a different operating system than the operating
system inferred from the request network signature.
relay:
type: boolean
description: >
Request IP address belongs to a relay service provider, indicating
the use of relay services like [Apple Private
relay](https://support.apple.com/en-us/102602) or [Cloudflare
Warp](https://developers.cloudflare.com/warp-client/).
* Like VPNs, relay services anonymize the visitor's true IP address.
* Unlike traditional VPNs, relay services don't let visitors spoof
their location by choosing an exit node in a different country.
This field allows you to differentiate VPN users and relay service
users in your fraud prevention logic.
VPN:
type: object
additionalProperties: false
Expand Down Expand Up @@ -1400,7 +1425,7 @@ components:
field.
The time of the most recent factory reset that happened on the
**mobile device** is expressed as Unix epoch time.
**mobile device** is expressed as Unix epoch time.
ProductFactoryReset:
type: object
additionalProperties: false
Expand Down Expand Up @@ -2022,7 +2047,7 @@ components:
field.
The time of the most recent factory reset that happened on the
**mobile device** is expressed as Unix epoch time.
**mobile device** is expressed as Unix epoch time.
WebhookJailbroken:
type: object
additionalProperties: false
Expand Down
4 changes: 2 additions & 2 deletions sdk/src/main/java/com/fingerprint/model/FactoryReset.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ public FactoryReset timestamp(Long timestamp) {
}

/**
* 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.
* 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.
* @return timestamp
**/
@jakarta.annotation.Nonnull
@Schema(required = true, 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. ")
@Schema(required = true, 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. ")
@JsonProperty(JSON_PROPERTY_TIMESTAMP)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

Expand Down
34 changes: 33 additions & 1 deletion sdk/src/main/java/com/fingerprint/model/Identification.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
Identification.JSON_PROPERTY_IP,
Identification.JSON_PROPERTY_IP_LOCATION,
Identification.JSON_PROPERTY_LINKED_ID,
Identification.JSON_PROPERTY_SUSPECT,
Identification.JSON_PROPERTY_TIMESTAMP,
Identification.JSON_PROPERTY_TIME,
Identification.JSON_PROPERTY_URL,
Expand Down Expand Up @@ -65,6 +66,9 @@ public class Identification {
public static final String JSON_PROPERTY_LINKED_ID = "linkedId";
private String linkedId;

public static final String JSON_PROPERTY_SUSPECT = "suspect";
private Boolean suspect;

public static final String JSON_PROPERTY_TIMESTAMP = "timestamp";
private Long timestamp;

Expand Down Expand Up @@ -279,6 +283,32 @@ public void setLinkedId(String linkedId) {
}


public Identification suspect(Boolean suspect) {
this.suspect = suspect;
return this;
}

/**
* Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent).
* @return suspect
**/
@jakarta.annotation.Nullable
@Schema(description = "Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent).")
@JsonProperty(JSON_PROPERTY_SUSPECT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public Boolean getSuspect() {
return suspect;
}


@JsonProperty(JSON_PROPERTY_SUSPECT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSuspect(Boolean suspect) {
this.suspect = suspect;
}


public Identification timestamp(Long timestamp) {
this.timestamp = timestamp;
return this;
Expand Down Expand Up @@ -545,6 +575,7 @@ public boolean equals(Object o) {
Objects.equals(this.ip, identification.ip) &&
Objects.equals(this.ipLocation, identification.ipLocation) &&
Objects.equals(this.linkedId, identification.linkedId) &&
Objects.equals(this.suspect, identification.suspect) &&
Objects.equals(this.timestamp, identification.timestamp) &&
Objects.equals(this.time, identification.time) &&
Objects.equals(this.url, identification.url) &&
Expand All @@ -558,7 +589,7 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(visitorId, requestId, browserDetails, incognito, ip, ipLocation, linkedId, timestamp, time, url, tag, confidence, visitorFound, firstSeenAt, lastSeenAt, components);
return Objects.hash(visitorId, requestId, browserDetails, incognito, ip, ipLocation, linkedId, suspect, timestamp, time, url, tag, confidence, visitorFound, firstSeenAt, lastSeenAt, components);
}

@Override
Expand All @@ -572,6 +603,7 @@ public String toString() {
sb.append(" ip: ").append(toIndentedString(ip)).append("\n");
sb.append(" ipLocation: ").append(toIndentedString(ipLocation)).append("\n");
sb.append(" linkedId: ").append(toIndentedString(linkedId)).append("\n");
sb.append(" suspect: ").append(toIndentedString(suspect)).append("\n");
sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n");
sb.append(" time: ").append(toIndentedString(time)).append("\n");
sb.append(" url: ").append(toIndentedString(url)).append("\n");
Expand Down
38 changes: 35 additions & 3 deletions sdk/src/main/java/com/fingerprint/model/VPNMethods.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
VPNMethods.JSON_PROPERTY_TIMEZONE_MISMATCH,
VPNMethods.JSON_PROPERTY_PUBLIC_V_P_N,
VPNMethods.JSON_PROPERTY_AUXILIARY_MOBILE,
VPNMethods.JSON_PROPERTY_OS_MISMATCH
VPNMethods.JSON_PROPERTY_OS_MISMATCH,
VPNMethods.JSON_PROPERTY_RELAY
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0")
public class VPNMethods {
Expand All @@ -36,6 +37,9 @@ public class VPNMethods {
public static final String JSON_PROPERTY_OS_MISMATCH = "osMismatch";
private Boolean osMismatch;

public static final String JSON_PROPERTY_RELAY = "relay";
private Boolean relay;

public VPNMethods() {
}

Expand Down Expand Up @@ -143,6 +147,32 @@ public void setOsMismatch(Boolean osMismatch) {
}


public VPNMethods relay(Boolean relay) {
this.relay = relay;
return this;
}

/**
* Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic.
* @return relay
**/
@jakarta.annotation.Nonnull
@Schema(required = true, description = "Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. ")
@JsonProperty(JSON_PROPERTY_RELAY)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

public Boolean getRelay() {
return relay;
}


@JsonProperty(JSON_PROPERTY_RELAY)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setRelay(Boolean relay) {
this.relay = relay;
}


/**
* Return true if this VPNMethods object is equal to o.
*/
Expand All @@ -158,12 +188,13 @@ public boolean equals(Object o) {
return Objects.equals(this.timezoneMismatch, vpNMethods.timezoneMismatch) &&
Objects.equals(this.publicVPN, vpNMethods.publicVPN) &&
Objects.equals(this.auxiliaryMobile, vpNMethods.auxiliaryMobile) &&
Objects.equals(this.osMismatch, vpNMethods.osMismatch);
Objects.equals(this.osMismatch, vpNMethods.osMismatch) &&
Objects.equals(this.relay, vpNMethods.relay);
}

@Override
public int hashCode() {
return Objects.hash(timezoneMismatch, publicVPN, auxiliaryMobile, osMismatch);
return Objects.hash(timezoneMismatch, publicVPN, auxiliaryMobile, osMismatch, relay);
}

@Override
Expand All @@ -174,6 +205,7 @@ public String toString() {
sb.append(" publicVPN: ").append(toIndentedString(publicVPN)).append("\n");
sb.append(" auxiliaryMobile: ").append(toIndentedString(auxiliaryMobile)).append("\n");
sb.append(" osMismatch: ").append(toIndentedString(osMismatch)).append("\n");
sb.append(" relay: ").append(toIndentedString(relay)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ public WebhookFactoryReset timestamp(Long timestamp) {
}

/**
* 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.
* 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.
* @return timestamp
**/
@jakarta.annotation.Nullable
@Schema(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. ")
@Schema(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. ")
@JsonProperty(JSON_PROPERTY_TIMESTAMP)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

Expand Down
6 changes: 6 additions & 0 deletions sdk/src/test/resources/mocks/errors/400_bot_type_invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"error": {
"code": "RequestCannotBeParsed",
"message": "invalid bot type"
}
}
6 changes: 6 additions & 0 deletions sdk/src/test/resources/mocks/errors/400_end_time_invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"error": {
"code": "RequestCannotBeParsed",
"message": "invalid end time"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"error": {
"code": "RequestCannotBeParsed",
"message": "invalid ip address"
}
}
6 changes: 6 additions & 0 deletions sdk/src/test/resources/mocks/errors/400_limit_invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"error": {
"code": "RequestCannotBeParsed",
"message": "invalid limit"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"error": {
"code": "RequestCannotBeParsed",
"message": "linked_id can't be greater than 256 characters long"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"error": {
"code": "RequestCannotBeParsed",
"message": "invalid pagination key"
}
}
6 changes: 6 additions & 0 deletions sdk/src/test/resources/mocks/errors/400_reverse_invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"error": {
"code": "RequestCannotBeParsed",
"message": "invalid reverse param"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"error": {
"code": "RequestCannotBeParsed",
"message": "invalid start time"
}
}
3 changes: 2 additions & 1 deletion sdk/src/test/resources/mocks/get_event_200.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@
"timezoneMismatch": false,
"publicVPN": false,
"auxiliaryMobile": false,
"osMismatch": false
"osMismatch": false,
"relay": false
}
}
},
Expand Down
Loading

0 comments on commit 3b6d78f

Please sign in to comment.