Skip to content

Commit

Permalink
feat: add raw device attributes support
Browse files Browse the repository at this point in the history
  • Loading branch information
TheUnderScorer committed Jul 24, 2023
1 parent 4a8a63f commit 9f7adba
Show file tree
Hide file tree
Showing 7 changed files with 211 additions and 1 deletion.
77 changes: 77 additions & 0 deletions resources/fingerprint-server-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,25 @@ paths:
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: srgb
contrast:
value: 0
cookiesEnabled:
value: true
allErrorsResponse:
summary: All failed signals
value:
Expand Down Expand Up @@ -3664,6 +3683,24 @@ paths:
result: false
virtualMachine:
result: false
rawDeviceAttributes:
architecture:
value: 127
audio:
value: 35.73832903057337
canvas:
value:
Winding: true
Geometry: 4dce9d6017c3e0c052a77252f29f2b1c
Text: dd2474a56ff78c1de3e7a07070ba3b7d
colorDepth:
value: 30
colorGamut:
value: srgb
contrast:
value: 0
cookiesEnabled:
value: true
responses:
default:
description: The server doesn't validate the answer.
Expand Down Expand Up @@ -3998,6 +4035,8 @@ components:
example: false
tampering:
$ref: '#/components/schemas/TamperingResult'
rawDeviceAttributes:
$ref: '#/components/schemas/RawDeviceAttributesResult'
requestId:
description: Unique identifier of the user's identification request.
type: string
Expand Down Expand Up @@ -4586,6 +4625,12 @@ components:
$ref: '#/components/schemas/TamperingResult'
error:
$ref: '#/components/schemas/ProductError'
rawDeviceAttributes:
title: SignalResponseRawDeviceAttributes
type: object
properties:
data:
$ref: '#/components/schemas/RawDeviceAttributesResult'
EventResponse:
description: >-
Contains results from all activated products - Fingerprint Pro, Bot
Expand Down Expand Up @@ -4764,6 +4809,38 @@ components:
example: 0
minimum: 0
maximum: 1
RawDeviceAttributesResult:
type: object
description: >
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.
additionalProperties:
type: object
properties:
error:
properties:
name:
title: error.name
type: string
message:
title: error.message
type: string
required:
- name
- message
title: error
type: object
value:
title: value
ProductError:
type: object
properties:
Expand Down
22 changes: 22 additions & 0 deletions src/generatedApiTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ export interface components {
result?: boolean;
};
tampering?: components['schemas']['TamperingResult'];
rawDeviceAttributes?: components['schemas']['RawDeviceAttributesResult'];
/**
* @description Unique identifier of the user's identification request.
* @example 1654815516083.OX6kx8
Expand Down Expand Up @@ -663,6 +664,10 @@ export interface components {
data?: components['schemas']['TamperingResult'];
error?: components['schemas']['ProductError'];
};
/** SignalResponseRawDeviceAttributes */
rawDeviceAttributes?: {
data?: components['schemas']['RawDeviceAttributesResult'];
};
};
/** @description Contains results from all activated products - Fingerprint Pro, Bot Detection, and others. */
EventResponse: {
Expand Down Expand Up @@ -793,6 +798,23 @@ export interface components {
*/
anomalyScore?: number;
};
/**
* @description 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.
*/
RawDeviceAttributesResult: {
[key: string]: {
/** error */
error?: {
/** error.name */
name: string;
/** error.message */
message: string;
};
/** value */
value?: unknown;
};
};
ProductError: {
/**
* @description Error code:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,33 @@ Object {
"proxy": Object {
"result": false,
},
"rawDeviceAttributes": Object {
"architecture": Object {
"value": 127,
},
"audio": Object {
"value": 35.73832903057337,
},
"canvas": Object {
"value": Object {
"Geometry": "4dce9d6017c3e0c052a77252f29f2b1c",
"Text": "dd2474a56ff78c1de3e7a07070ba3b7d",
"Winding": true,
},
},
"colorDepth": Object {
"value": 30,
},
"colorGamut": Object {
"value": "srgb",
},
"contrast": Object {
"value": 0,
},
"cookiesEnabled": Object {
"value": true,
},
},
"requestId": "Px6VxbRC6WBkA39yeNH3",
"rootApps": Object {
"result": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,35 @@ Object {
"result": false,
},
},
"rawDeviceAttributes": Object {
"data": Object {
"architecture": Object {
"value": 127,
},
"audio": Object {
"value": 35.73832903057337,
},
"canvas": Object {
"value": Object {
"Geometry": "4dce9d6017c3e0c052a77252f29f2b1c",
"Text": "dd2474a56ff78c1de3e7a07070ba3b7d",
"Winding": true,
},
},
"colorDepth": Object {
"value": 30,
},
"colorGamut": Object {
"value": "srgb",
},
"contrast": Object {
"value": 0,
},
"cookiesEnabled": Object {
"value": true,
},
},
},
"rootApps": Object {
"data": Object {
"result": false,
Expand Down
1 change: 0 additions & 1 deletion tests/mocked-responses-tests/getEventTests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ describe('[Mocked response] Get Event', () => {
);

const response = await client.getEvent(existingRequestId);

expect(response).toMatchSnapshot();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,35 @@
"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": "srgb"
},
"contrast": {
"value": 0
},
"cookiesEnabled": {
"value": true
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,32 @@
},
"virtualMachine": {
"result": false
},
"rawDeviceAttributes": {
"architecture": {
"value": 127
},
"audio": {
"value": 35.73832903057337
},
"canvas": {
"value": {
"Winding": true,
"Geometry": "4dce9d6017c3e0c052a77252f29f2b1c",
"Text": "dd2474a56ff78c1de3e7a07070ba3b7d"
}
},
"colorDepth": {
"value": 30
},
"colorGamut": {
"value": "srgb"
},
"contrast": {
"value": 0
},
"cookiesEnabled": {
"value": true
}
}
}

0 comments on commit 9f7adba

Please sign in to comment.