Skip to content

Commit a1180a5

Browse files
committed
Hotfix 2.7.1: Fix date not being formatted to UTC correctly in thirdparty extension content
1 parent 533750f commit a1180a5

File tree

15 files changed

+41
-18
lines changed

15 files changed

+41
-18
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ If you are using Maven, you need to add the following dependency:
104104
<dependency>
105105
<groupId>com.yoti</groupId>
106106
<artifactId>yoti-sdk-impl</artifactId>
107-
<version>2.7.0</version>
107+
<version>2.7.1-SNAPSHOT</version>
108108
</dependency>
109109
```
110110

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

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

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

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<groupId>com.yoti</groupId>
66
<artifactId>yoti-sdk</artifactId>
77
<packaging>pom</packaging>
8-
<version>2.7.0</version>
8+
<version>2.7.1-SNAPSHOT</version>
99
<name>Yoti SDK</name>
1010
<description>Java SDK for simple integration with the Yoti platform</description>
1111
<url>https://github.com/getyoti/yoti-java-sdk</url>

yoti-sdk-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>com.yoti</groupId>
1313
<artifactId>yoti-sdk-parent</artifactId>
14-
<version>2.7.0</version>
14+
<version>2.7.1-SNAPSHOT</version>
1515
<relativePath>../yoti-sdk-parent</relativePath>
1616
</parent>
1717

yoti-sdk-api/src/main/java/com/yoti/api/client/shareurl/extension/ThirdPartyAttributeContent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public ThirdPartyAttributeContent(Date expiryDate, List<AttributeDefinition> def
2323
@JsonProperty("expiry_date")
2424
public String getExpiryDate() {
2525
SimpleDateFormat rfcDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
26+
rfcDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
2627
return rfcDateFormat.format(expiryDate.getTime());
2728
}
2829

yoti-sdk-impl/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>com.yoti</groupId>
1313
<artifactId>yoti-sdk-parent</artifactId>
14-
<version>2.7.0</version>
14+
<version>2.7.1-SNAPSHOT</version>
1515
<relativePath>../yoti-sdk-parent</relativePath>
1616
</parent>
1717

yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/YotiConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ private YotiConstants() {}
2525
public static final String CONTENT_TYPE_JPEG = "image/jpeg";
2626

2727
public static final String JAVA = "Java";
28-
public static final String SDK_VERSION = JAVA + "-2.7.0";
28+
public static final String SDK_VERSION = JAVA + "-2.7.1-SNAPSHOT";
2929
public static final String SIGNATURE_ALGORITHM = "SHA256withRSA";
3030
public static final String ASYMMETRIC_CIPHER = "RSA/NONE/PKCS1Padding";
3131
public static final String SYMMETRIC_CIPHER = "AES/CBC/PKCS7Padding";

yoti-sdk-impl/src/test/java/com/yoti/api/client/shareurl/extension/SimpleThirdPartyAttributeExtensionBuilderTest.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,28 @@ public void shouldBuildThirdPartyAttributeExtensionWithGivenValues() {
8080
assertThat(definitions.get(0).getName(), is(SOME_DEFINITION));
8181
}
8282

83+
@Test
84+
public void shouldBuildThirdPartyAttributeExtensionWithCorrectDateValue() {
85+
TimeZone.setDefault(TimeZone.getTimeZone("America/New_York"));
86+
Date date = new Date();
87+
88+
Extension<ThirdPartyAttributeContent> extension = new SimpleThirdPartyAttributeExtensionBuilder()
89+
.withExpiryDate(date)
90+
.withDefinition(SOME_DEFINITION)
91+
.build();
92+
93+
SimpleDateFormat sdf = new SimpleDateFormat(YotiConstants.RFC3339_PATTERN_MILLIS);
94+
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
95+
String formattedTestDate = sdf.format(date);
96+
97+
assertEquals(ExtensionConstants.THIRD_PARTY_ATTRIBUTE, extension.getType());
98+
assertEquals(formattedTestDate, extension.getContent().getExpiryDate());
99+
100+
List<AttributeDefinition> definitions = extension.getContent().getDefinitions();
101+
assertThat(definitions.size(), is(1));
102+
assertThat(definitions.get(0).getName(), is(SOME_DEFINITION));
103+
}
104+
83105
@Test
84106
public void shouldBuildThirdPartyAttributeExtensionWithMultipleDefinitions() {
85107
List<String> theDefinitions = new ArrayList<>();

yoti-sdk-parent/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<groupId>com.yoti</groupId>
66
<artifactId>yoti-sdk-parent</artifactId>
77
<packaging>pom</packaging>
8-
<version>2.7.0</version>
8+
<version>2.7.1-SNAPSHOT</version>
99
<name>Yoti SDK Parent Pom</name>
1010
<description>Parent pom for the Java SDK projects</description>
1111
<url>https://github.com/getyoti/yoti-java-sdk</url>

yoti-sdk-sandbox/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>com.yoti</groupId>
1313
<artifactId>yoti-sdk-parent</artifactId>
14-
<version>2.7.0</version>
14+
<version>2.7.1-SNAPSHOT</version>
1515
<relativePath>../yoti-sdk-parent</relativePath>
1616
</parent>
1717

yoti-sdk-spring-boot-auto-config/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ If you are using Maven, you need to add the following dependencies:
1818
<dependency>
1919
<groupId>com.yoti</groupId>
2020
<artifactId>yoti-sdk-spring-boot-auto-config</artifactId>
21-
<version>2.7.0</version>
21+
<version>2.7.1-SNAPSHOT</version>
2222
</dependency>
2323
```
2424

2525

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

2828
```
29-
compile group: 'com.yoti', name: 'yoti-sdk-spring-boot-auto-config', version: '2.7.0'
29+
compile group: 'com.yoti', name: 'yoti-sdk-spring-boot-auto-config', version: '2.7.1-SNAPSHOT'
3030
```
3131

3232

0 commit comments

Comments
 (0)