Skip to content

Commit 6e4fe69

Browse files
authored
Merge pull request #189 from getyoti/release-2.8.0
Release 2.8.0
2 parents b0687fa + 27d8f5c commit 6e4fe69

File tree

110 files changed

+2940
-72
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+2940
-72
lines changed

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ The Modules above explained
3939
1) [Spring Boot Auto Configuration](#spring-boot-auto-configuration) -
4040
Description of utilising Spring Boot
4141

42-
1) [Running the Example](#running-the-example) -
43-
Running the Spring example project
42+
1) [Running the Examples](#running-the-examples) -
43+
Running the Spring example projects
4444

4545
1) [Breaking changes and enhancements made in v2.0.0](#breaking-changes-and-enhancements-made-in-v2.0.0) -
4646
Things you need to know when migrating from 1.x to 2.x
@@ -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.1</version>
107+
<version>2.8.0</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.1'`
113+
`compile group: 'com.yoti', name: 'yoti-sdk-impl', version: '2.8.0'`
114114

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

@@ -341,9 +341,12 @@ As a convenience, if your application happens to use Spring Boot, you can utilis
341341

342342
For more information and to see an example of this in use take a look at the [Spring Boot Auto Configuration module](/yoti-sdk-spring-boot-auto-config).
343343

344-
## Running the Example
344+
## Running the Examples
345345

346-
Instructions on how to run the Spring example project can be found in the [yoti-sdk-spring-boot-example](/yoti-sdk-spring-boot-example) folder.
346+
Instructions on how to run the Spring example projects can be found at the following:
347+
348+
1. [Yoti App](/yoti-sdk-spring-boot-example)
349+
1. [Doc Scan](/examples/doc-scan)
347350

348351
## Breaking changes and enhancements made in v2.0.0
349352

examples/doc-scan/.gitignore

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
2+
# Created by https://www.gitignore.io/api/java,maven,intellij,eclipse,osx,linux,vim,windows
3+
4+
### Java ###
5+
*.class
6+
7+
# Mobile Tools for Java (J2ME)
8+
.mtj.tmp/
9+
10+
# Package Files #
11+
*.jar
12+
13+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
14+
hs_err_pid*
15+
16+
17+
### Maven ###
18+
target/
19+
pom.xml.tag
20+
pom.xml.releaseBackup
21+
pom.xml.versionsBackup
22+
pom.xml.next
23+
release.properties
24+
dependency-reduced-pom.xml
25+
buildNumber.properties
26+
.mvn/timing.properties
27+
28+
29+
### Intellij ###
30+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
31+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
32+
33+
# User-specific stuff:
34+
.idea/workspace.xml
35+
.idea/tasks.xml
36+
.idea/dictionaries
37+
.idea/vcs.xml
38+
.idea/jsLibraryMappings.xml
39+
40+
# Sensitive or high-churn files:
41+
.idea/dataSources.ids
42+
.idea/dataSources.xml
43+
.idea/dataSources.local.xml
44+
.idea/sqlDataSources.xml
45+
.idea/dynamic.xml
46+
.idea/uiDesigner.xml
47+
48+
# Gradle:
49+
.idea/gradle.xml
50+
.idea/libraries
51+
52+
# Mongo Explorer plugin:
53+
.idea/mongoSettings.xml
54+
55+
## File-based project format:
56+
*.iws
57+
58+
## Plugin-specific files:
59+
60+
# IntelliJ
61+
/out/
62+
63+
# mpeltonen/sbt-idea plugin
64+
.idea_modules/
65+
66+
# JIRA plugin
67+
atlassian-ide-plugin.xml
68+
69+
# Crashlytics plugin (for Android Studio and IntelliJ)
70+
com_crashlytics_export_strings.xml
71+
crashlytics.properties
72+
crashlytics-build.properties
73+
fabric.properties
74+
75+
76+
### Eclipse ###
77+
78+
.metadata
79+
bin/
80+
tmp/
81+
*.tmp
82+
*.bak
83+
*.swp
84+
*~.nib
85+
local.properties
86+
.settings/
87+
.loadpath
88+
89+
# Eclipse Core
90+
.project
91+
92+
# External tool builders
93+
.externalToolBuilders/
94+
95+
# Locally stored "Eclipse launch configurations"
96+
*.launch
97+
98+
# PyDev specific (Python IDE for Eclipse)
99+
*.pydevproject
100+
101+
# CDT-specific (C/C++ Development Tooling)
102+
.cproject
103+
104+
# JDT-specific (Eclipse Java Development Tools)
105+
.classpath
106+
107+
# Java annotation processor (APT)
108+
.factorypath
109+
110+
# PDT-specific (PHP Development Tools)
111+
.buildpath
112+
113+
# sbteclipse plugin
114+
.target
115+
116+
# Tern plugin
117+
.tern-project
118+
119+
# TeXlipse plugin
120+
.texlipse
121+
122+
# STS (Spring Tool Suite)
123+
.springBeans
124+
125+
# Code Recommenders
126+
.recommenders/
127+
128+
129+
### OSX ###
130+
.DS_Store
131+
.AppleDouble
132+
.LSOverride
133+
134+
# Icon must end with two \r
135+
Icon
136+
137+
138+
# Thumbnails
139+
._*
140+
141+
# Files that might appear in the root of a volume
142+
.DocumentRevisions-V100
143+
.fseventsd
144+
.Spotlight-V100
145+
.TemporaryItems
146+
.Trashes
147+
.VolumeIcon.icns
148+
149+
# Directories potentially created on remote AFP share
150+
.AppleDB
151+
.AppleDesktop
152+
Network Trash Folder
153+
Temporary Items
154+
.apdisk
155+
156+
157+
### Linux ###
158+
*~
159+
160+
# temporary files which can be created if a process still has a handle open of a deleted file
161+
.fuse_hidden*
162+
163+
# KDE directory preferences
164+
.directory
165+
166+
# Linux trash folder which might appear on any partition or disk
167+
.Trash-*
168+
169+
170+
### Vim ###
171+
# swap
172+
[._]*.s[a-w][a-z]
173+
[._]s[a-w][a-z]
174+
# session
175+
Session.vim
176+
# temporary
177+
.netrwhist
178+
# auto-generated tag files
179+
tags
180+
181+
182+
### Windows ###
183+
# Windows image file caches
184+
Thumbs.db
185+
ehthumbs.db
186+
187+
# Folder config file
188+
Desktop.ini
189+
190+
# Recycle Bin used on file shares
191+
$RECYCLE.BIN/
192+
193+
# Windows Installer files
194+
*.cab
195+
*.msi
196+
*.msm
197+
*.msp
198+
199+
# Windows shortcuts
200+
*.lnk
201+
202+
application.yml
203+
*.pem

examples/doc-scan/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Doc Scan Example
2+
3+
## Running the example
4+
5+
1. Move into the Doc Scan example directory i.e. `cd examples/doc-scan`
6+
1. Place the PEM file from Yoti Hub into `src/main/resources`
7+
1. Rename the [application.yml.example](src/main/resources/application.yml.example) file to `application.yml` and fill in the required values (`sdkId` and `accessSecurityKey`)
8+
1. Build the application with `mvn clean package`
9+
1. Run the application from the root folder with `java -jar target/doc-scan-demo-1.0.0.jar`
10+
1. Visit `https://localhost:8443`

examples/doc-scan/pom.xml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>org.springframework.boot</groupId>
7+
<artifactId>spring-boot-starter-parent</artifactId>
8+
<version>2.2.7.RELEASE</version>
9+
<relativePath/> <!-- lookup parent from repository -->
10+
</parent>
11+
<groupId>com.yoti.docscan.demo</groupId>
12+
<artifactId>doc-scan-demo</artifactId>
13+
<version>1.0.0</version>
14+
<name>doc-scan-demo</name>
15+
<description>Example project using Java Doc Scan SDK</description>
16+
17+
<properties>
18+
<java.version>1.8</java.version>
19+
</properties>
20+
21+
<dependencies>
22+
<dependency>
23+
<groupId>org.springframework.boot</groupId>
24+
<artifactId>spring-boot-starter-web</artifactId>
25+
</dependency>
26+
<dependency>
27+
<groupId>org.springframework.boot</groupId>
28+
<artifactId>spring-boot-starter-thymeleaf</artifactId>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.springframework.boot</groupId>
32+
<artifactId>spring-boot-configuration-processor</artifactId>
33+
</dependency>
34+
<dependency>
35+
<groupId>org.springframework.session</groupId>
36+
<artifactId>spring-session-core</artifactId>
37+
</dependency>
38+
39+
<dependency>
40+
<groupId>org.springframework.boot</groupId>
41+
<artifactId>spring-boot-starter-test</artifactId>
42+
<scope>test</scope>
43+
<exclusions>
44+
<exclusion>
45+
<groupId>org.junit.vintage</groupId>
46+
<artifactId>junit-vintage-engine</artifactId>
47+
</exclusion>
48+
</exclusions>
49+
</dependency>
50+
51+
<dependency>
52+
<groupId>com.yoti</groupId>
53+
<artifactId>yoti-sdk-impl</artifactId>
54+
<version>2.8.0</version>
55+
</dependency>
56+
<dependency>
57+
<groupId>org.apache.tika</groupId>
58+
<artifactId>tika-core</artifactId>
59+
<version>1.24.1</version>
60+
</dependency>
61+
</dependencies>
62+
63+
<build>
64+
<plugins>
65+
<plugin>
66+
<groupId>org.springframework.boot</groupId>
67+
<artifactId>spring-boot-maven-plugin</artifactId>
68+
</plugin>
69+
</plugins>
70+
</build>
71+
72+
</project>
2.19 KB
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.yoti.docscan.demo;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
6+
@SpringBootApplication
7+
public class DocScanDemoApplication {
8+
9+
public static void main(String[] args) {
10+
SpringApplication.run(DocScanDemoApplication.class, args);
11+
}
12+
13+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package com.yoti.docscan.demo.config;
2+
3+
import com.yoti.api.client.ClassPathKeySource;
4+
import com.yoti.api.client.KeyPairSource;
5+
import com.yoti.api.client.docs.DocScanClient;
6+
import com.yoti.api.client.docs.DocScanClientBuilder;
7+
8+
import org.slf4j.Logger;
9+
import org.slf4j.LoggerFactory;
10+
import org.springframework.beans.factory.annotation.Autowired;
11+
import org.springframework.beans.factory.annotation.Qualifier;
12+
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
13+
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
14+
import org.springframework.boot.context.properties.EnableConfigurationProperties;
15+
import org.springframework.context.annotation.Bean;
16+
import org.springframework.context.annotation.Configuration;
17+
import org.springframework.core.io.ResourceLoader;
18+
19+
@Configuration
20+
@ConditionalOnClass(DocScanClient.class)
21+
@EnableConfigurationProperties({ DocScanConfig.class })
22+
public class DocScanAutoConfiguration {
23+
24+
private static final Logger LOGGER = LoggerFactory.getLogger(DocScanAutoConfiguration.class);
25+
26+
private DocScanConfig properties;
27+
private ResourceLoader resourceLoader;
28+
29+
@Autowired
30+
public DocScanAutoConfiguration(DocScanConfig properties,
31+
ResourceLoader resourceLoader) {
32+
this.properties = properties;
33+
this.resourceLoader = resourceLoader;
34+
}
35+
36+
@Bean
37+
@ConditionalOnMissingBean(DocScanClient.class)
38+
public DocScanClient getDocScanClient(@Qualifier("docScanPem") final KeyPairSource keyPairSource) {
39+
LOGGER.info("Configuring Doc Scan client with {} and {}.", properties, keyPairSource);
40+
return DocScanClientBuilder.newInstance()
41+
.withClientSdkId(properties.getSdkId())
42+
.withKeyPairSource(keyPairSource)
43+
.build();
44+
}
45+
46+
@Bean(name = "docScanPem")
47+
public KeyPairSource getDocScanKeyPairSource() {
48+
return ClassPathKeySource.fromClasspath(properties.getPemFileLocation());
49+
}
50+
51+
}

0 commit comments

Comments
 (0)