SDK AutoConfig & improvements & fixes (#1663)
* SDK autoconfiguration added * Option for custom error decoder and request interceptor added * Fixed authentication for targets with security token Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -19,12 +19,14 @@
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>hawkbit-sdk-test</artifactId>
|
||||
<artifactId>hawkbit-sdk-demo</artifactId>
|
||||
<name>hawkBit :: SDK :: Test / Example</name>
|
||||
<description>Test / Example of how SDK could be used to for devices and for Mgmt API access</description>
|
||||
|
||||
<properties>
|
||||
<spring-shell.version>3.1.5</spring-shell.version>
|
||||
<spring.app.class>org.eclipse.hawkbit.sdk.demo.multidevice.MultiDeviceApp</spring.app.class>
|
||||
<start-class>${spring.app.class}</start-class>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -45,4 +47,30 @@
|
||||
<version>${spring-shell.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${baseDir}</outputDirectory>
|
||||
<layout>JAR</layout>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@@ -93,8 +93,10 @@ public class SetupHelper {
|
||||
securityTargetToken = randomToken();
|
||||
mgmtTargetRestApi.updateTarget(controllerId,
|
||||
new MgmtTargetRequestBody().setSecurityToken(securityTargetToken));
|
||||
} else {
|
||||
securityTargetToken = target.getSecurityToken();
|
||||
}
|
||||
} else if (!securityTargetToken.equals(target.getSecurityToken())){
|
||||
} else if (!securityTargetToken.equals(target.getSecurityToken())) {
|
||||
// update target's with the security token (since it doesn't match)
|
||||
mgmtTargetRestApi.updateTarget(controllerId,
|
||||
new MgmtTargetRequestBody().setSecurityToken(securityTargetToken));
|
||||
|
||||
@@ -40,7 +40,6 @@ import java.util.concurrent.ScheduledExecutorService;
|
||||
*/
|
||||
@Slf4j
|
||||
@SpringBootApplication
|
||||
@Import({ HawkbitSDKConfigurtion.class})
|
||||
public class DeviceApp {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -41,7 +41,6 @@ import java.util.concurrent.ScheduledExecutorService;
|
||||
*/
|
||||
@Slf4j
|
||||
@SpringBootApplication
|
||||
@Import({ HawkbitSDKConfigurtion.class})
|
||||
public class MultiDeviceApp {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#
|
||||
|
||||
spring.main.web-application-type=none
|
||||
spring.cloud.openfeign.httpclient.hc5.enabled=true
|
||||
|
||||
logging.level.org.eclipse.hawkbit=DEBUG
|
||||
|
||||
|
||||
Reference in New Issue
Block a user