Skip to content

Commit 9e4bde6

Browse files
committed
Merge branch 'main' into chore/INTER-2061-bump-openapi-generator
# Conflicts: # gradle/libs.versions.toml
2 parents fda1130 + 82726af commit 9e4bde6

37 files changed

Lines changed: 713 additions & 412 deletions

.changeset/active-call.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'java-sdk': minor
3+
---
4+
5+
**events**: Add `active_call` smart signal to `Event`

.changeset/keyboard-layout-hash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'java-sdk': minor
3+
---
4+
5+
**events**: Add `keyboard_layout_hash` to `RawDeviceAttributes`

.changeset/plenty-bumps-glow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'java-sdk': patch
3+
---
4+
5+
**dependencies**: Bump Jersey, Jackson, and jakarta-annotation-api to their latest compatible versions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'java-sdk': minor
3+
---
4+
5+
**events**: Add `battery_charging` field to `RawDeviceAttributes`

.github/workflows/e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
outputs:
1212
version: ${{ steps.version.outputs.version }}
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v7
1515
- name: Read version from config.json
1616
id: version
1717
run: echo version=$(node -p "require('./package.json').version") >> $GITHUB_OUTPUT

.github/workflows/functional.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
java: [ '11', '17', '21', '25' ]
2424

2525
steps:
26-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v7
2727
with:
2828
ref: ${{ github.event.pull_request.head.sha }}
2929
# Gradle will detect the JVM installation from the ubuntu-latest image and use it

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
name: Check source code formatting
1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@v7
1414
- run: ./gradlew :sdk:checkFormat :examples:checkFormat --continue
1515

1616
test:
@@ -21,7 +21,7 @@ jobs:
2121
java: ['11', '17', '21', '25']
2222

2323
steps:
24-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@v7
2525
# Gradle will detect the JVM installation from the ubuntu-latest image and use it
2626
# includes execution of unit tests
2727
- run: ./gradlew build -PjavaVersion=${{ matrix.java }} --stacktrace
@@ -30,7 +30,7 @@ jobs:
3030
runs-on: ubuntu-latest
3131
name: Jitpack build smoke test
3232
steps:
33-
- uses: actions/checkout@v4
33+
- uses: actions/checkout@v7
3434
- run: ./gradlew clean build -PjavaVersion=11 --stacktrace
3535
env:
3636
JITPACK: true

.schema-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v3.4.2
1+
v3.5.1

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# Fingerprint Server API Java SDK
2020

21-
[Fingerprint](https://fingerprint.com/) is a device intelligence platform offering industry-leading accuracy. The Fingerprint Server Java SDK is an easy way to interact with the Fingerprint [Server API](https://dev.fingerprint.com/reference/pro-server-api) from your Java application. You can search, update, and delete identification events.
21+
[Fingerprint](https://fingerprint.com/) is a device intelligence platform offering industry-leading accuracy. The Fingerprint Server Java SDK is an easy way to interact with the Fingerprint [Server API](https://docs.fingerprint.com/reference/server-api) from your Java application. You can search, update, and delete identification events.
2222

2323

2424
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
@@ -37,6 +37,11 @@ The following versions of Java are supported
3737
- Java 21
3838
- Java 25
3939

40+
We aim to support all Java LTS versions that are still maintained upstream.
41+
42+
> [!NOTE]
43+
> This package assumes you have a Fingerprint subscription or trial, it is not compatible with the [open-source FingerprintJS](https://github.com/fingerprintjs/fingerprintjs). See our documentation to learn more about the [differences between Fingerprint and the open-source FingerprintJS](https://fingerprint.com/github/).
44+
4045
## Installation
4146

4247
### Maven users
@@ -202,7 +207,7 @@ public class FingerprintApiExample {
202207

203208
## Sealed results
204209

205-
This SDK provides utility methods for decoding [sealed results](https://dev.fingerprint.com/docs/sealed-client-results).
210+
This SDK provides utility methods for decoding [sealed results](https://docs.fingerprint.com/docs/sealed-client-results).
206211
```java
207212
package com.fingerprint.example;
208213

@@ -236,7 +241,21 @@ public class SealedResults {
236241
```
237242
To learn more, see the [Sealed results example](/examples/src/main/java/com/fingerprint/example/SealedResults.java).
238243

239-
## Webhook signature validation
244+
## Webhooks
245+
246+
### Webhook types
247+
248+
A [webhook](https://dev.fingerprint.com/reference/posteventwebhook) sent by Fingerprint has the same shape as an `Event`. You can deserialize the payload directly into that type using the SDK's own JSON mapper:
249+
250+
```java
251+
import com.fingerprint.v4.model.Event;
252+
import com.fingerprint.v4.sdk.JSON;
253+
254+
Event event = JSON.getDefault().getMapper().readValue(webhook, Event.class);
255+
System.out.println(event.getIdentification().getVisitorId());
256+
```
257+
258+
### Webhook signature validation
240259
This SDK provides utility method for verifying the HMAC signature of the incoming webhook request.
241260

242261
Here is an example implementation using Spring Boot:

contributing.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ Most files in the project are autogenerated by [openapi-generator](https://opena
88
- [docs](./docs) - generated documentation for models and [API Client](./docs/FingerprintApi.md).
99
- [sdk](./sdk) - automatically generated API client code.
1010

11+
## Commit messages
12+
13+
This project follows the [Conventional Commits](https://www.conventionalcommits.org/) standard. Each commit message should be structured as:
14+
15+
```
16+
<type>: <description>
17+
18+
[optional body]
19+
```
20+
1121
## Code generation and building the SDK
1222

1323
Use the Gradle build to invoke `openapi-generator` and generate the code and documentation:
@@ -18,6 +28,14 @@ Use the Gradle build to invoke `openapi-generator` and generate the code and doc
1828

1929
To download the latest OpenAPI schema from [fingerprintjs/fingerprint-pro-server-api-openapi](https://github.com/fingerprintjs/fingerprint-pro-server-api-openapi), run `./scripts/sync.sh`
2030

31+
### Updating the codegen engine and templates
32+
33+
The generator version is pinned as the `openapi` entry in [gradle/libs.versions.toml](./gradle/libs.versions.toml). To update it:
34+
35+
1. Bump the `openapi` version in that file.
36+
2. Compare each file in [template](./template) against the matching upstream `java` or `jersey3` generator template at the new version, and merge in any upstream changes the same way you would resolve a merge conflict.
37+
3. Update the engine and the templates in the same change. Using the new engine with old templates, or the other way around, can break code generation without a clear error.
38+
2139
## Testing the local source code of the SDK
2240

2341
Use the [./src/examples/java/com/fingerprint/example/FunctionalTests.java](./src/examples/java/com/fingerprint/example/FunctionalTests.java) file to make API requests using the local version of the SDK.

0 commit comments

Comments
 (0)