Skip to content

Commit

Permalink
feat: add SuspectScore smart signal support
Browse files Browse the repository at this point in the history
  • Loading branch information
TheUnderScorer committed Feb 27, 2024
1 parent 044109e commit c66373e
Show file tree
Hide file tree
Showing 9 changed files with 386 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/ProductsResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Contains all information about the request identified by `requestId`, depending
|**tampering** | [**SignalResponseTampering**](SignalResponseTampering.md) | | [optional] |
|**highActivity** | [**SignalResponseHighActivity**](SignalResponseHighActivity.md) | | [optional] |
|**locationSpoofing** | [**SignalResponseLocationSpoofing**](SignalResponseLocationSpoofing.md) | | [optional] |
|**suspectScore** | [**SignalResponseSuspectScore**](SignalResponseSuspectScore.md) | | [optional] |
|**rawDeviceAttributes** | [**SignalResponseRawDeviceAttributes**](SignalResponseRawDeviceAttributes.md) | | [optional] |


Expand Down
14 changes: 14 additions & 0 deletions docs/SignalResponseSuspectScore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@


# SignalResponseSuspectScore


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**data** | [**SuspectScoreResult**](SuspectScoreResult.md) | | [optional] |
|**error** | [**ProductError**](ProductError.md) | | [optional] |



13 changes: 13 additions & 0 deletions docs/SuspectScoreResult.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@


# SuspectScoreResult


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**result** | **Integer** | Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score | |



1 change: 1 addition & 0 deletions docs/WebhookVisit.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
|**rawDeviceAttributes** | [**Map<String, RawDeviceAttributesResultValue>**](RawDeviceAttributesResultValue.md) | It includes 35+ raw browser identification attributes to provide Fingerprint users with even more information than our standard visitor ID provides. This enables Fingerprint users to not have to run our open-source product in conjunction with Fingerprint Pro Plus and Enterprise to get those additional attributes. Warning: The raw signals data can change at any moment as we improve the product. We cannot guarantee the internal shape of raw device attributes to be stable, so typical semantic versioning rules do not apply here. Use this data with caution without assuming a specific structure beyond the generic type provided here. | [optional] |
|**highActivity** | [**HighActivityResult**](HighActivityResult.md) | | [optional] |
|**locationSpoofing** | [**LocationSpoofingResult**](LocationSpoofingResult.md) | | [optional] |
|**suspectScore** | [**SuspectScoreResult**](SuspectScoreResult.md) | | [optional] |
|**requestId** | **String** | Unique identifier of the user's identification request. | |
|**browserDetails** | [**BrowserDetails**](BrowserDetails.md) | | |
|**ip** | **String** | | |
Expand Down
31 changes: 31 additions & 0 deletions res/fingerprint-server-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3762,6 +3762,8 @@ paths:
result: false
locationSpoofing:
result: true
suspectScore:
result: 0
responses:
default:
description: The server doesn't validate the answer.
Expand Down Expand Up @@ -4148,6 +4150,8 @@ components:
$ref: '#/components/schemas/HighActivityResult'
locationSpoofing:
$ref: '#/components/schemas/LocationSpoofingResult'
suspectScore:
$ref: '#/components/schemas/SuspectScoreResult'
requestId:
description: Unique identifier of the user's identification request.
type: string
Expand Down Expand Up @@ -4927,6 +4931,15 @@ components:
$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
Expand Down Expand Up @@ -5155,6 +5168,24 @@ components:
Flag indicating whether the request came from a device with location
spoofing enabled.
example: false
required:
- result
SuspectScoreResult:
type: object
additionalProperties: false
properties:
result:
type: integer
description: >
Suspect Score is an easy way to integrate Smart Signals into your
fraud protection work flow. It is a weighted representation of all
Smart Signals present in the payload that helps identify suspicious
activity. The value range is [0; S] where S is sum of all Smart
Signals weights. See more details here:
https://dev.fingerprint.com/docs/suspect-score
example: 0
required:
- result
RawDeviceAttributesResult:
type: object
description: >
Expand Down
35 changes: 34 additions & 1 deletion src/main/java/com/fingerprint/model/ProductsResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import com.fingerprint.model.SignalResponseProxy;
import com.fingerprint.model.SignalResponseRawDeviceAttributes;
import com.fingerprint.model.SignalResponseRootApps;
import com.fingerprint.model.SignalResponseSuspectScore;
import com.fingerprint.model.SignalResponseTampering;
import com.fingerprint.model.SignalResponseTor;
import com.fingerprint.model.SignalResponseVirtualMachine;
Expand Down Expand Up @@ -72,6 +73,7 @@
ProductsResponse.JSON_PROPERTY_TAMPERING,
ProductsResponse.JSON_PROPERTY_HIGH_ACTIVITY,
ProductsResponse.JSON_PROPERTY_LOCATION_SPOOFING,
ProductsResponse.JSON_PROPERTY_SUSPECT_SCORE,
ProductsResponse.JSON_PROPERTY_RAW_DEVICE_ATTRIBUTES
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
Expand Down Expand Up @@ -133,6 +135,9 @@ public class ProductsResponse {
public static final String JSON_PROPERTY_LOCATION_SPOOFING = "locationSpoofing";
private SignalResponseLocationSpoofing locationSpoofing;

public static final String JSON_PROPERTY_SUSPECT_SCORE = "suspectScore";
private SignalResponseSuspectScore suspectScore;

public static final String JSON_PROPERTY_RAW_DEVICE_ATTRIBUTES = "rawDeviceAttributes";
private SignalResponseRawDeviceAttributes rawDeviceAttributes;

Expand Down Expand Up @@ -633,6 +638,32 @@ public void setLocationSpoofing(SignalResponseLocationSpoofing locationSpoofing)
}


public ProductsResponse suspectScore(SignalResponseSuspectScore suspectScore) {
this.suspectScore = suspectScore;
return this;
}

/**
* Get suspectScore
* @return suspectScore
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_SUSPECT_SCORE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public SignalResponseSuspectScore getSuspectScore() {
return suspectScore;
}


@JsonProperty(JSON_PROPERTY_SUSPECT_SCORE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSuspectScore(SignalResponseSuspectScore suspectScore) {
this.suspectScore = suspectScore;
}


public ProductsResponse rawDeviceAttributes(SignalResponseRawDeviceAttributes rawDeviceAttributes) {
this.rawDeviceAttributes = rawDeviceAttributes;
return this;
Expand Down Expand Up @@ -690,12 +721,13 @@ public boolean equals(Object o) {
Objects.equals(this.tampering, productsResponse.tampering) &&
Objects.equals(this.highActivity, productsResponse.highActivity) &&
Objects.equals(this.locationSpoofing, productsResponse.locationSpoofing) &&
Objects.equals(this.suspectScore, productsResponse.suspectScore) &&
Objects.equals(this.rawDeviceAttributes, productsResponse.rawDeviceAttributes);
}

@Override
public int hashCode() {
return Objects.hash(identification, botd, ipInfo, incognito, rootApps, emulator, clonedApp, factoryReset, jailbroken, frida, ipBlocklist, tor, privacySettings, virtualMachine, vpn, proxy, tampering, highActivity, locationSpoofing, rawDeviceAttributes);
return Objects.hash(identification, botd, ipInfo, incognito, rootApps, emulator, clonedApp, factoryReset, jailbroken, frida, ipBlocklist, tor, privacySettings, virtualMachine, vpn, proxy, tampering, highActivity, locationSpoofing, suspectScore, rawDeviceAttributes);
}

@Override
Expand All @@ -721,6 +753,7 @@ public String toString() {
sb.append(" tampering: ").append(toIndentedString(tampering)).append("\n");
sb.append(" highActivity: ").append(toIndentedString(highActivity)).append("\n");
sb.append(" locationSpoofing: ").append(toIndentedString(locationSpoofing)).append("\n");
sb.append(" suspectScore: ").append(toIndentedString(suspectScore)).append("\n");
sb.append(" rawDeviceAttributes: ").append(toIndentedString(rawDeviceAttributes)).append("\n");
sb.append("}");
return sb.toString();
Expand Down
146 changes: 146 additions & 0 deletions src/main/java/com/fingerprint/model/SignalResponseSuspectScore.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
/*
* Fingerprint Pro Server API
* Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device.
*
* The version of the OpenAPI document: 3
* Contact: support@fingerprint.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


package com.fingerprint.model;

import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fingerprint.model.ProductError;
import com.fingerprint.model.SuspectScoreResult;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fingerprint.sdk.JSON;


/**
* SignalResponseSuspectScore
*/
@JsonPropertyOrder({
SignalResponseSuspectScore.JSON_PROPERTY_DATA,
SignalResponseSuspectScore.JSON_PROPERTY_ERROR
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class SignalResponseSuspectScore {
public static final String JSON_PROPERTY_DATA = "data";
private SuspectScoreResult data;

public static final String JSON_PROPERTY_ERROR = "error";
private ProductError error;

public SignalResponseSuspectScore() {
}

public SignalResponseSuspectScore data(SuspectScoreResult data) {
this.data = data;
return this;
}

/**
* Get data
* @return data
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_DATA)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public SuspectScoreResult getData() {
return data;
}


@JsonProperty(JSON_PROPERTY_DATA)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setData(SuspectScoreResult data) {
this.data = data;
}


public SignalResponseSuspectScore error(ProductError error) {
this.error = error;
return this;
}

/**
* Get error
* @return error
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_ERROR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public ProductError getError() {
return error;
}


@JsonProperty(JSON_PROPERTY_ERROR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setError(ProductError error) {
this.error = error;
}


/**
* Return true if this SignalResponseSuspectScore object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SignalResponseSuspectScore signalResponseSuspectScore = (SignalResponseSuspectScore) o;
return Objects.equals(this.data, signalResponseSuspectScore.data) &&
Objects.equals(this.error, signalResponseSuspectScore.error);
}

@Override
public int hashCode() {
return Objects.hash(data, error);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SignalResponseSuspectScore {\n");
sb.append(" data: ").append(toIndentedString(data)).append("\n");
sb.append(" error: ").append(toIndentedString(error)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}

}

Loading

0 comments on commit c66373e

Please sign in to comment.