Skip to content

Commit

Permalink
Merge pull request #183 from getyoti/hotfix-2.7.1
Browse files Browse the repository at this point in the history
Release 2.7.1
  • Loading branch information
MrBurtyyy authored Apr 7, 2020
2 parents 533750f + a8bd03c commit b0687fa
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 30 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ If you are using Maven, you need to add the following dependency:
<dependency>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-impl</artifactId>
<version>2.7.0</version>
<version>2.7.1</version>
</dependency>
```

If you are using Gradle, here is the dependency to add:

`compile group: 'com.yoti', name: 'yoti-sdk-impl', version: '2.7.0'`
`compile group: 'com.yoti', name: 'yoti-sdk-impl', version: '2.7.1'`

You will find all classes packaged under `com.yoti.api`

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 @@
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk</artifactId>
<packaging>pom</packaging>
<version>2.7.0</version>
<version>2.7.1</version>
<name>Yoti SDK</name>
<description>Java SDK for simple integration with the Yoti platform</description>
<url>https://github.com/getyoti/yoti-java-sdk</url>
Expand Down
2 changes: 1 addition & 1 deletion yoti-sdk-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-parent</artifactId>
<version>2.7.0</version>
<version>2.7.1</version>
<relativePath>../yoti-sdk-parent</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public ThirdPartyAttributeContent(Date expiryDate, List<AttributeDefinition> def
@JsonProperty("expiry_date")
public String getExpiryDate() {
SimpleDateFormat rfcDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
rfcDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
return rfcDateFormat.format(expiryDate.getTime());
}

Expand Down
2 changes: 1 addition & 1 deletion yoti-sdk-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-parent</artifactId>
<version>2.7.0</version>
<version>2.7.1</version>
<relativePath>../yoti-sdk-parent</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private YotiConstants() {}
public static final String CONTENT_TYPE_JPEG = "image/jpeg";

public static final String JAVA = "Java";
public static final String SDK_VERSION = JAVA + "-2.7.0";
public static final String SDK_VERSION = JAVA + "-2.7.1";
public static final String SIGNATURE_ALGORITHM = "SHA256withRSA";
public static final String ASYMMETRIC_CIPHER = "RSA/NONE/PKCS1Padding";
public static final String SYMMETRIC_CIPHER = "AES/CBC/PKCS7Padding";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
package com.yoti.api.client.shareurl.extension;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.yoti.api.client.AttributeDefinition;
import com.yoti.api.client.spi.remote.call.YotiConstants;
import org.junit.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import com.yoti.api.client.AttributeDefinition;
import com.yoti.api.client.spi.remote.call.YotiConstants;

import org.junit.Test;

public class SimpleThirdPartyAttributeExtensionBuilderTest {

Expand Down Expand Up @@ -68,9 +68,7 @@ public void shouldBuildThirdPartyAttributeExtensionWithGivenValues() {
.withDefinition(SOME_DEFINITION)
.build();

SimpleDateFormat sdf = new SimpleDateFormat(YotiConstants.RFC3339_PATTERN_MILLIS);
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
String formattedTestDate = sdf.format(SOME_DATE);
String formattedTestDate = formatDateToString(SOME_DATE);

assertEquals(ExtensionConstants.THIRD_PARTY_ATTRIBUTE, extension.getType());
assertEquals(formattedTestDate, extension.getContent().getExpiryDate());
Expand All @@ -80,6 +78,35 @@ public void shouldBuildThirdPartyAttributeExtensionWithGivenValues() {
assertThat(definitions.get(0).getName(), is(SOME_DEFINITION));
}

@Test
public void shouldBuildThirdPartyAttributeExtensionWithCorrectlyFormattedDateString() {
TimeZone.setDefault(TimeZone.getTimeZone("America/New_York"));
Date date = new Date();

Extension<ThirdPartyAttributeContent> extension = new SimpleThirdPartyAttributeExtensionBuilder()
.withExpiryDate(date)
.withDefinition(SOME_DEFINITION)
.build();

String formattedTestDate = formatDateToString(date);

assertEquals(formattedTestDate, extension.getContent().getExpiryDate());
}

@Test
public void shouldWorkCorrectlyWithDateCreatedFromTimestamp() {
Date date = new Date(1586252260);

Extension<ThirdPartyAttributeContent> extension = new SimpleThirdPartyAttributeExtensionBuilder()
.withExpiryDate(date)
.withDefinition(SOME_DEFINITION)
.build();

String formattedTestDate = formatDateToString(date);

assertEquals(formattedTestDate, extension.getContent().getExpiryDate());
}

@Test
public void shouldBuildThirdPartyAttributeExtensionWithMultipleDefinitions() {
List<String> theDefinitions = new ArrayList<>();
Expand Down Expand Up @@ -119,4 +146,10 @@ public void shouldOverwriteSingularlyAddedDefinition() {
assertThat(definitions.get(1).getName(), is("secondDefinition"));
}

private String formatDateToString(Date date) {
SimpleDateFormat sdf = new SimpleDateFormat(YotiConstants.RFC3339_PATTERN_MILLIS);
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
return sdf.format(date);
}

}
2 changes: 1 addition & 1 deletion yoti-sdk-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-parent</artifactId>
<packaging>pom</packaging>
<version>2.7.0</version>
<version>2.7.1</version>
<name>Yoti SDK Parent Pom</name>
<description>Parent pom for the Java SDK projects</description>
<url>https://github.com/getyoti/yoti-java-sdk</url>
Expand Down
2 changes: 1 addition & 1 deletion yoti-sdk-sandbox/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-parent</artifactId>
<version>2.7.0</version>
<version>2.7.1</version>
<relativePath>../yoti-sdk-parent</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions yoti-sdk-spring-boot-auto-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ If you are using Maven, you need to add the following dependencies:
<dependency>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-spring-boot-auto-config</artifactId>
<version>2.7.0</version>
<version>2.7.1</version>
</dependency>
```


If you are using Gradle, here is the dependency to add:

```
compile group: 'com.yoti', name: 'yoti-sdk-spring-boot-auto-config', version: '2.7.0'
compile group: 'com.yoti', name: 'yoti-sdk-spring-boot-auto-config', version: '2.7.1'
```


Expand Down
2 changes: 1 addition & 1 deletion yoti-sdk-spring-boot-auto-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-parent</artifactId>
<version>2.7.0</version>
<version>2.7.1</version>
<relativePath>../yoti-sdk-parent</relativePath>
</parent>

Expand Down
6 changes: 3 additions & 3 deletions yoti-sdk-spring-boot-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Before you start, you'll need to create an Application in [Yoti Hub](https://hub
<dependency>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-impl</artifactId>
<version>2.7.0</version>
<version>2.7.1</version>
</dependency>
```

Expand All @@ -29,8 +29,8 @@ Before you start, you'll need to create an Application in [Yoti Hub](https://hub
1. Run `mvn clean package` to build the project.

## Running
* You can run your server-app by executing `java -jar target/yoti-sdk-spring-boot-example-2.7.0.jar`
* If you are using Java 9, you can run the server-app as follows `java -jar target/yoti-sdk-spring-boot-example-2.7.0.jar --add-exports java.base/jdk.internal.ref=ALL-UNNAMED`
* You can run your server-app by executing `java -jar target/yoti-sdk-spring-boot-example-2.7.1.jar`
* If you are using Java 9, you can run the server-app as follows `java -jar target/yoti-sdk-spring-boot-example-2.7.1.jar --add-exports java.base/jdk.internal.ref=ALL-UNNAMED`
* Navigate to `https://localhost:8443`
* You can then initiate a login using Yoti. The Spring demo is listening for the response on `https://localhost:8443/login`.

Expand Down
2 changes: 1 addition & 1 deletion yoti-sdk-spring-boot-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-spring-boot-example</artifactId>

<version>2.7.0</version>
<version>2.7.1</version>

<name>Yoti Spring Boot Example</name>
<parent>
Expand Down
4 changes: 2 additions & 2 deletions yoti-sdk-spring-security/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ If you are using Maven, you need to add the following dependencies:
<dependency>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-spring-security</artifactId>
<version>2.7.0</version>
<version>2.7.1</version>
</dependency>
```

If you are using Gradle, here is the dependency to add:

```
compile group: 'com.yoti', name: 'yoti-sdk-spring-security', version: '2.7.0'
compile group: 'com.yoti', name: 'yoti-sdk-spring-security', version: '2.7.1'
```

### Provide a `YotiClient` instance
Expand Down
2 changes: 1 addition & 1 deletion yoti-sdk-spring-security/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-parent</artifactId>
<version>2.7.0</version>
<version>2.7.1</version>
<relativePath>../yoti-sdk-parent</relativePath>
</parent>

Expand Down

0 comments on commit b0687fa

Please sign in to comment.