Skip to content

Commit

Permalink
Upgrade after onfido-openapi-spec change 62dc554
Browse files Browse the repository at this point in the history
  • Loading branch information
dvacca-onfido authored and github-actions[bot] committed Jun 4, 2024
1 parent dedc522 commit 5cd0b0f
Show file tree
Hide file tree
Showing 12 changed files with 665 additions and 54 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v4.0.0 4th June 2024

- Refresh library up to commit: [62dc554](https://github.com/onfido/onfido-openapi-spec/commit/62dc5541a4a51e8de313fc99fb3dec496033a23e)

## v3.2.0 22nd May 2024

- Refresh library up to commit: [40e7a67](https://github.com/onfido/onfido-openapi-spec/commit/40e7a6727ee8e1af9630d3b9b50ba77ba48fc7ce)
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.onfido</groupId>
<artifactId>onfido-api-java</artifactId>
<version>3.2.0</version>
<version>4.0.0</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -57,7 +57,7 @@ Add this dependency to your project's build file:
}
dependencies {
implementation "com.onfido:onfido-api-java:3.2.0"
implementation "com.onfido:onfido-api-java:4.0.0"
}
```

Expand All @@ -71,17 +71,20 @@ mvn clean package

Then manually install the following JARs:

- `target/onfido-api-java-3.2.0.jar`
- `target/onfido-api-java-4.0.0.jar`
- `target/lib/*.jar`

The latest version can be found at: https://search.maven.org/artifact/com.onfido/3.2.0
The latest version can be found at: https://search.maven.org/artifact/com.onfido/4.0.0

## Getting Started

Import the `DefaultApi` object, this is the main object used for interfacing with the API:

```java
import com.onfido.api.DefaultApi;
import com.onfido.ApiClient.Region;
import com.onfido.Configuration;

import com.onfido.ApiException;
import com.onfido.OnfidoInvalidSignatureError;
```
Expand Down Expand Up @@ -135,11 +138,13 @@ Webhook events payload needs to be verified before it can be accessed. Library a

```java
try {
WebhookEventVerifier verifier = new WebhookEventVerifier("_ABC123abc...3ABC123_");
WebhookEventVerifier verifier = new WebhookEventVerifier(
System.getenv("ONFIDO_WEBHOOK_SECRET_TOKEN")
);

String signature = "a0...760e";

WebhookEvent event = verifier.readPayload("{\"payload\":{\"r...3\"}}}", signature);
WebhookEvent event = verifier.readPayload("{\"payload\":{\"r...3\"}}", signature);
} catch( OnfidoInvalidSignatureError e ) {
// Invalid webhook signature
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apply plugin: 'java'
apply plugin: 'com.diffplug.spotless'

group = 'com.onfido'
version = '3.2.0'
version = '4.0.0'

buildscript {
repositories {
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
settings(
organization := "com.onfido",
name := "onfido-api-java",
version := "3.2.0",
version := "4.0.0",
scalaVersion := "2.11.4",
scalacOptions ++= Seq("-feature"),
javacOptions in compile ++= Seq("-Xlint:deprecation"),
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>onfido-api-java</artifactId>
<packaging>jar</packaging>
<name>onfido-api-java</name>
<version>3.2.0</version>
<version>4.0.0</version>
<url>https://documentation.onfido.com</url>
<description>Official Java API client library for the Onfido API</description>
<scm>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/onfido/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private void init() {
json = new JSON();

// Set default User-Agent.
setUserAgent("onfido-java/3.2.0");
setUserAgent("onfido-java/4.0.0");

authentications = new HashMap<String, Authentication>();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/onfido/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
public class Configuration {
public static final String VERSION = "3.2.0";
public static final String VERSION = "4.0.0";

private static ApiClient defaultApiClient = new ApiClient();

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/onfido/JSON.java
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityVideoBreakdownVisualAuthenticityBreakdownLivenessDetected.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityVideoBreakdownVisualAuthenticityBreakdownSpoofingDetection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.FacialSimilarityVideoReport.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.IDPhotosList.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.IdNumber.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.IdPhoto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.IdPhotoResponse.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.IdPhotosList.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.IdentityEnhancedBreakdown.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.IdentityEnhancedBreakdownAddress.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.IdentityEnhancedBreakdownAddressBreakdown.CustomTypeAdapterFactory());
Expand Down Expand Up @@ -360,6 +360,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.SdkTokenResponse.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.Task.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.TaskItem.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.TimelineFileReference.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.UsDrivingLicenceBreakdown.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.UsDrivingLicenceBreakdownAddress.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.UsDrivingLicenceBreakdownAddressBreakdown.CustomTypeAdapterFactory());
Expand Down
Loading

0 comments on commit 5cd0b0f

Please sign in to comment.