From c34a583712f464fa382845b2a2a16bd15f2e147b Mon Sep 17 00:00:00 2001 From: tmatvienko Date: Thu, 1 Mar 2018 14:11:05 +0200 Subject: [PATCH 1/7] 3.3.5-SNAPSHOT version update --- devicehive-auth/pom.xml | 2 +- devicehive-backend/pom.xml | 2 +- devicehive-common-dao/pom.xml | 2 +- devicehive-common-service/pom.xml | 2 +- devicehive-common/pom.xml | 2 +- devicehive-frontend/pom.xml | 2 +- devicehive-plugin/pom.xml | 2 +- devicehive-proxy-api/pom.xml | 2 +- devicehive-proxy-ws-kafka-impl/pom.xml | 2 +- devicehive-rdbms-dao/pom.xml | 2 +- devicehive-shim-api/pom.xml | 2 +- devicehive-shim-kafka-impl/pom.xml | 2 +- devicehive-test-utils/pom.xml | 2 +- dockerfiles/devicehive-auth.Dockerfile | 2 +- dockerfiles/devicehive-backend.Dockerfile | 2 +- dockerfiles/devicehive-frontend.Dockerfile | 2 +- dockerfiles/devicehive-hazelcast.Dockerfile | 2 +- dockerfiles/devicehive-plugin.Dockerfile | 2 +- pom.xml | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/devicehive-auth/pom.xml b/devicehive-auth/pom.xml index b54d4ad59..911e9ac57 100644 --- a/devicehive-auth/pom.xml +++ b/devicehive-auth/pom.xml @@ -5,7 +5,7 @@ devicehive-server com.devicehive - 3.4.4 + 3.4.5-SNAPSHOT 4.0.0 jar diff --git a/devicehive-backend/pom.xml b/devicehive-backend/pom.xml index b583fd2a1..2032691bc 100644 --- a/devicehive-backend/pom.xml +++ b/devicehive-backend/pom.xml @@ -5,7 +5,7 @@ devicehive-server com.devicehive - 3.4.4 + 3.4.5-SNAPSHOT 4.0.0 diff --git a/devicehive-common-dao/pom.xml b/devicehive-common-dao/pom.xml index 24f9e4ae9..1849c6e2f 100644 --- a/devicehive-common-dao/pom.xml +++ b/devicehive-common-dao/pom.xml @@ -7,7 +7,7 @@ com.devicehive devicehive-server - 3.4.4 + 3.4.5-SNAPSHOT devicehive-common-dao jar diff --git a/devicehive-common-service/pom.xml b/devicehive-common-service/pom.xml index 5b81198f3..350be0a74 100644 --- a/devicehive-common-service/pom.xml +++ b/devicehive-common-service/pom.xml @@ -5,7 +5,7 @@ devicehive-server com.devicehive - 3.4.4 + 3.4.5-SNAPSHOT 4.0.0 jar diff --git a/devicehive-common/pom.xml b/devicehive-common/pom.xml index 4b984a5a4..18d91846c 100644 --- a/devicehive-common/pom.xml +++ b/devicehive-common/pom.xml @@ -7,7 +7,7 @@ com.devicehive devicehive-server - 3.4.4 + 3.4.5-SNAPSHOT devicehive-common jar diff --git a/devicehive-frontend/pom.xml b/devicehive-frontend/pom.xml index a46299cf4..95d578924 100644 --- a/devicehive-frontend/pom.xml +++ b/devicehive-frontend/pom.xml @@ -5,7 +5,7 @@ devicehive-server com.devicehive - 3.4.4 + 3.4.5-SNAPSHOT 4.0.0 jar diff --git a/devicehive-plugin/pom.xml b/devicehive-plugin/pom.xml index c6510316d..63dc25a9a 100644 --- a/devicehive-plugin/pom.xml +++ b/devicehive-plugin/pom.xml @@ -5,7 +5,7 @@ devicehive-server com.devicehive - 3.4.4 + 3.4.5-SNAPSHOT 4.0.0 jar diff --git a/devicehive-proxy-api/pom.xml b/devicehive-proxy-api/pom.xml index ee271c3c4..2db7a6fa6 100644 --- a/devicehive-proxy-api/pom.xml +++ b/devicehive-proxy-api/pom.xml @@ -7,7 +7,7 @@ com.devicehive devicehive-server - 3.4.4 + 3.4.5-SNAPSHOT devicehive-proxy-api jar diff --git a/devicehive-proxy-ws-kafka-impl/pom.xml b/devicehive-proxy-ws-kafka-impl/pom.xml index a32d9f204..6c83381e4 100644 --- a/devicehive-proxy-ws-kafka-impl/pom.xml +++ b/devicehive-proxy-ws-kafka-impl/pom.xml @@ -7,7 +7,7 @@ com.devicehive devicehive-server - 3.4.4 + 3.4.5-SNAPSHOT devicehive-proxy-ws-kafka-impl jar diff --git a/devicehive-rdbms-dao/pom.xml b/devicehive-rdbms-dao/pom.xml index 429ce215a..dc50570b0 100644 --- a/devicehive-rdbms-dao/pom.xml +++ b/devicehive-rdbms-dao/pom.xml @@ -7,7 +7,7 @@ com.devicehive devicehive-server - 3.4.4 + 3.4.5-SNAPSHOT devicehive-rdbms-dao jar diff --git a/devicehive-shim-api/pom.xml b/devicehive-shim-api/pom.xml index 9f2e3438b..12e6c1d6a 100644 --- a/devicehive-shim-api/pom.xml +++ b/devicehive-shim-api/pom.xml @@ -7,7 +7,7 @@ com.devicehive devicehive-server - 3.4.4 + 3.4.5-SNAPSHOT devicehive-shim-api jar diff --git a/devicehive-shim-kafka-impl/pom.xml b/devicehive-shim-kafka-impl/pom.xml index 256aa1f6f..28944d65c 100644 --- a/devicehive-shim-kafka-impl/pom.xml +++ b/devicehive-shim-kafka-impl/pom.xml @@ -5,7 +5,7 @@ devicehive-server com.devicehive - 3.4.4 + 3.4.5-SNAPSHOT 4.0.0 diff --git a/devicehive-test-utils/pom.xml b/devicehive-test-utils/pom.xml index 519310b76..e64ad18bc 100644 --- a/devicehive-test-utils/pom.xml +++ b/devicehive-test-utils/pom.xml @@ -1 +1 @@ - devicehive-server com.devicehive 3.4.4 4.0.0 devicehive-test-utils DeviceHive Test Utils ${project.parent.basedir} org.hsqldb hsqldb ${hsqldb.version} org.hibernate hibernate-core ${hibernate-version} org.springframework.boot spring-boot-starter-test org.apache.kafka kafka-clients ${kafka.version} test org.apache.kafka kafka_${scala-binaries.version} ${kafka.version} slf4j-log4j12 org.slf4j org.apache.kafka kafka_${scala-binaries.version} ${kafka.version} test slf4j-log4j12 org.slf4j \ No newline at end of file + devicehive-server com.devicehive 3.4.5-SNAPSHOT 4.0.0 devicehive-test-utils DeviceHive Test Utils ${project.parent.basedir} org.hsqldb hsqldb ${hsqldb.version} org.hibernate hibernate-core ${hibernate-version} org.springframework.boot spring-boot-starter-test org.apache.kafka kafka-clients ${kafka.version} test org.apache.kafka kafka_${scala-binaries.version} ${kafka.version} slf4j-log4j12 org.slf4j org.apache.kafka kafka_${scala-binaries.version} ${kafka.version} test slf4j-log4j12 org.slf4j \ No newline at end of file diff --git a/dockerfiles/devicehive-auth.Dockerfile b/dockerfiles/devicehive-auth.Dockerfile index b8bdacff8..008a67129 100644 --- a/dockerfiles/devicehive-auth.Dockerfile +++ b/dockerfiles/devicehive-auth.Dockerfile @@ -2,7 +2,7 @@ FROM openjdk:8u151-jre-slim MAINTAINER devicehive -ENV DH_VERSION="3.4.4" +ENV DH_VERSION="3.4.5-SNAPSHOT" LABEL org.label-schema.url="https://devicehive.com" \ org.label-schema.vendor="DeviceHive" \ diff --git a/dockerfiles/devicehive-backend.Dockerfile b/dockerfiles/devicehive-backend.Dockerfile index 079357401..849f2c79e 100644 --- a/dockerfiles/devicehive-backend.Dockerfile +++ b/dockerfiles/devicehive-backend.Dockerfile @@ -2,7 +2,7 @@ FROM openjdk:8u151-jre-slim MAINTAINER devicehive -ENV DH_VERSION="3.4.4" +ENV DH_VERSION="3.4.5-SNAPSHOT" LABEL org.label-schema.url="https://devicehive.com" \ org.label-schema.vendor="DeviceHive" \ diff --git a/dockerfiles/devicehive-frontend.Dockerfile b/dockerfiles/devicehive-frontend.Dockerfile index 9823c5805..26a0a1e1c 100644 --- a/dockerfiles/devicehive-frontend.Dockerfile +++ b/dockerfiles/devicehive-frontend.Dockerfile @@ -2,7 +2,7 @@ FROM openjdk:8u151-jre-slim MAINTAINER devicehive -ENV DH_VERSION="3.4.4" +ENV DH_VERSION="3.4.5-SNAPSHOT" LABEL org.label-schema.url="https://devicehive.com" \ org.label-schema.vendor="DeviceHive" \ diff --git a/dockerfiles/devicehive-hazelcast.Dockerfile b/dockerfiles/devicehive-hazelcast.Dockerfile index 75b8d9cd1..98716a29d 100644 --- a/dockerfiles/devicehive-hazelcast.Dockerfile +++ b/dockerfiles/devicehive-hazelcast.Dockerfile @@ -2,7 +2,7 @@ FROM hazelcast/hazelcast:3.8.8 MAINTAINER devicehive -ENV DH_VERSION="3.4.4" +ENV DH_VERSION="3.4.5-SNAPSHOT" LABEL org.label-schema.url="https://devicehive.com" \ org.label-schema.vendor="DeviceHive" \ diff --git a/dockerfiles/devicehive-plugin.Dockerfile b/dockerfiles/devicehive-plugin.Dockerfile index 640d4b9d8..9471fe5bf 100644 --- a/dockerfiles/devicehive-plugin.Dockerfile +++ b/dockerfiles/devicehive-plugin.Dockerfile @@ -2,7 +2,7 @@ FROM openjdk:8u151-jre-slim MAINTAINER devicehive -ENV DH_VERSION="3.4.4" +ENV DH_VERSION="3.4.5-SNAPSHOT" LABEL org.label-schema.url="https://devicehive.com" \ org.label-schema.vendor="DeviceHive" \ diff --git a/pom.xml b/pom.xml index b925b4753..3d5e66f1f 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ com.devicehive devicehive-server pom - 3.4.4 + 3.4.5-SNAPSHOT DeviceHive Java Server From 1e35ad3b03a8964def9ffb24b9abf47a34893156 Mon Sep 17 00:00:00 2001 From: amedvedev Date: Tue, 6 Mar 2018 13:54:23 +0200 Subject: [PATCH 2/7] Server now correctly adds CORS headers when jwt token is expired --- .../devicehive/application/security/WebSecurityConfig.java | 4 ++-- .../devicehive/application/security/WebSecurityConfig.java | 4 ++-- .../devicehive/application/security/WebSecurityConfig.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/devicehive-auth/src/main/java/com/devicehive/application/security/WebSecurityConfig.java b/devicehive-auth/src/main/java/com/devicehive/application/security/WebSecurityConfig.java index cd180f749..77973b84c 100644 --- a/devicehive-auth/src/main/java/com/devicehive/application/security/WebSecurityConfig.java +++ b/devicehive-auth/src/main/java/com/devicehive/application/security/WebSecurityConfig.java @@ -65,8 +65,8 @@ protected void configure(HttpSecurity http) throws Exception { .authenticationEntryPoint(unauthorizedEntryPoint()); http - .addFilterBefore(new HttpAuthenticationFilter(authenticationManager()), BasicAuthenticationFilter.class) - .addFilterAfter(new SimpleCORSFilter(), HttpAuthenticationFilter.class); + .addFilterBefore(new SimpleCORSFilter(), BasicAuthenticationFilter.class) + .addFilterAfter(new HttpAuthenticationFilter(authenticationManager()), SimpleCORSFilter.class); } @Override diff --git a/devicehive-frontend/src/main/java/com/devicehive/application/security/WebSecurityConfig.java b/devicehive-frontend/src/main/java/com/devicehive/application/security/WebSecurityConfig.java index cd180f749..77973b84c 100644 --- a/devicehive-frontend/src/main/java/com/devicehive/application/security/WebSecurityConfig.java +++ b/devicehive-frontend/src/main/java/com/devicehive/application/security/WebSecurityConfig.java @@ -65,8 +65,8 @@ protected void configure(HttpSecurity http) throws Exception { .authenticationEntryPoint(unauthorizedEntryPoint()); http - .addFilterBefore(new HttpAuthenticationFilter(authenticationManager()), BasicAuthenticationFilter.class) - .addFilterAfter(new SimpleCORSFilter(), HttpAuthenticationFilter.class); + .addFilterBefore(new SimpleCORSFilter(), BasicAuthenticationFilter.class) + .addFilterAfter(new HttpAuthenticationFilter(authenticationManager()), SimpleCORSFilter.class); } @Override diff --git a/devicehive-plugin/src/main/java/com/devicehive/application/security/WebSecurityConfig.java b/devicehive-plugin/src/main/java/com/devicehive/application/security/WebSecurityConfig.java index cd180f749..77973b84c 100644 --- a/devicehive-plugin/src/main/java/com/devicehive/application/security/WebSecurityConfig.java +++ b/devicehive-plugin/src/main/java/com/devicehive/application/security/WebSecurityConfig.java @@ -65,8 +65,8 @@ protected void configure(HttpSecurity http) throws Exception { .authenticationEntryPoint(unauthorizedEntryPoint()); http - .addFilterBefore(new HttpAuthenticationFilter(authenticationManager()), BasicAuthenticationFilter.class) - .addFilterAfter(new SimpleCORSFilter(), HttpAuthenticationFilter.class); + .addFilterBefore(new SimpleCORSFilter(), BasicAuthenticationFilter.class) + .addFilterAfter(new HttpAuthenticationFilter(authenticationManager()), SimpleCORSFilter.class); } @Override From 1b209c7eaffe3ad8de377fe338e03421666ec3fb Mon Sep 17 00:00:00 2001 From: Tatyana Matvienko Date: Fri, 9 Mar 2018 17:15:31 +0200 Subject: [PATCH 3/7] Jwt mapping improvements (#498) * jwt actions mapping changes (strings and numbers are acceptable) * validity check added --- .../java/com/devicehive/auth/HiveAction.java | 11 +++++++ .../security/jwt/JwtUserPayloadView.java | 33 +++++++++++-------- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/devicehive-common/src/main/java/com/devicehive/auth/HiveAction.java b/devicehive-common/src/main/java/com/devicehive/auth/HiveAction.java index ba1aa0fa0..1093db1f5 100644 --- a/devicehive-common/src/main/java/com/devicehive/auth/HiveAction.java +++ b/devicehive-common/src/main/java/com/devicehive/auth/HiveAction.java @@ -89,6 +89,17 @@ public static HiveAction fromString(String text) { return null; } + public static HiveAction fromId(Integer id) { + if (id != null) { + for (HiveAction b : HiveAction.values()) { + if (id.equals(b.id)) { + return b; + } + } + } + return null; + } + public static Set getAllHiveActions() { return KNOWN_ACTIONS; } diff --git a/devicehive-common/src/main/java/com/devicehive/security/jwt/JwtUserPayloadView.java b/devicehive-common/src/main/java/com/devicehive/security/jwt/JwtUserPayloadView.java index e5b773f3e..4449aede5 100644 --- a/devicehive-common/src/main/java/com/devicehive/security/jwt/JwtUserPayloadView.java +++ b/devicehive-common/src/main/java/com/devicehive/security/jwt/JwtUserPayloadView.java @@ -28,6 +28,7 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.NotNull; +import javax.ws.rs.BadRequestException; import java.util.Date; import java.util.Objects; import java.util.Optional; @@ -36,7 +37,7 @@ import static com.devicehive.auth.HiveAction.NONE; -public class JwtUserPayloadView implements HiveEntity { +public class JwtUserPayloadView implements HiveEntity { private static final long serialVersionUID = 9015868660504625526L; @@ -54,7 +55,7 @@ public class JwtUserPayloadView implements HiveEntity { @JsonProperty(ACTIONS) @SerializedName(ACTIONS) - private Set actions; + private Set actions; @JsonProperty(NETWORK_IDS) @SerializedName(NETWORK_IDS) @@ -72,7 +73,7 @@ public class JwtUserPayloadView implements HiveEntity { @SerializedName(TOKEN_TYPE) private TokenType tokenType; - public JwtUserPayloadView(Long userId, Set actions, Set networkIds, + public JwtUserPayloadView(Long userId, Set actions, Set networkIds, Set deviceTypeIds, Date expiration, TokenType tokenType) { this.userId = userId; this.actions = actions; @@ -90,11 +91,11 @@ public void setUserId(Long userId) { this.userId = userId; } - public Set getActions() { + public Set getActions() { return actions; } - public void setActions(Set actions) { + public void setActions(Set actions) { this.actions = actions; } @@ -134,7 +135,13 @@ public JwtUserPayload convertTo() { Set actionIds = Optional.ofNullable(actions) .map(value -> value.stream() //Here the compatibility with old behavior is provided to ignore not valid actions - .map(action -> HiveAction.fromString(action)) + .map(action -> { + if (action instanceof String) { + return HiveAction.fromString((String) action); + } else if (action instanceof Number && ((Double) action - ((Double) action).intValue() == 0)) { + return HiveAction.fromId(((Double) action).intValue()); + } else throw new BadRequestException("Actions list should contain only Strings or Integers"); + }) .filter(Objects::nonNull) .mapToInt(HiveAction::getId) .boxed() @@ -148,15 +155,15 @@ public static Builder newBuilder() { return new Builder(); } - public static class Builder { + public static class Builder { private Long userId; - private Set actions; + private Set actions; private Set networkIds; private Set deviceTypeIds; private Date expiration; private TokenType tokenType; - public Builder withPublicClaims(Long userId, Set actions, + public Builder withPublicClaims(Long userId, Set actions, Set networkIds, Set deviceTypeIds) { this.userId = userId; this.actions = actions; @@ -165,7 +172,7 @@ public Builder withPublicClaims(Long userId, Set actions, return this; } - public Builder withPayload(JwtUserPayloadView payload) { + public Builder withPayload(JwtUserPayloadView payload) { this.userId = payload.getUserId(); this.actions = payload.getActions(); this.networkIds = payload.getNetworkIds(); @@ -179,7 +186,7 @@ public Builder withUserId(Long userId) { return this; } - public Builder withActions(Set actions) { + public Builder withActions(Set actions) { this.actions = actions; return this; } @@ -204,8 +211,8 @@ public Builder withExpirationDate(Date expiration) { return this; } - public JwtUserPayloadView buildPayload() { - return new JwtUserPayloadView(userId, actions, networkIds, deviceTypeIds, expiration, tokenType); + public JwtUserPayloadView buildPayload() { + return new JwtUserPayloadView(userId, actions, networkIds, deviceTypeIds, expiration, tokenType); } } } From 23e18bff9dfe6bd9b4d2ca2ad5c3345d5d37b431 Mon Sep 17 00:00:00 2001 From: itrambovetskiy Date: Tue, 13 Mar 2018 11:30:24 +0200 Subject: [PATCH 4/7] Hazelcast comparator. Added implementation of portable interface --- .../model/DevicePortableFactory.java | 2 ++ .../model/HazelcastEntityComparator.java | 25 ++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/devicehive-common/src/main/java/com/devicehive/model/DevicePortableFactory.java b/devicehive-common/src/main/java/com/devicehive/model/DevicePortableFactory.java index cc8ab668f..190506ccc 100644 --- a/devicehive-common/src/main/java/com/devicehive/model/DevicePortableFactory.java +++ b/devicehive-common/src/main/java/com/devicehive/model/DevicePortableFactory.java @@ -40,6 +40,8 @@ public Portable create(int classId) { return new Filter(); } else if (Subscriber.CLASS_ID == classId) { return new Subscriber(); + } else if (HazelcastEntityComparator.CLASS_ID == classId) { + return new HazelcastEntityComparator(); } return null; diff --git a/devicehive-common/src/main/java/com/devicehive/model/HazelcastEntityComparator.java b/devicehive-common/src/main/java/com/devicehive/model/HazelcastEntityComparator.java index e22b35748..7b611c155 100644 --- a/devicehive-common/src/main/java/com/devicehive/model/HazelcastEntityComparator.java +++ b/devicehive-common/src/main/java/com/devicehive/model/HazelcastEntityComparator.java @@ -20,13 +20,36 @@ * #L% */ +import com.hazelcast.nio.serialization.Portable; +import com.hazelcast.nio.serialization.PortableReader; +import com.hazelcast.nio.serialization.PortableWriter; + import java.io.Serializable; import java.util.Comparator; import java.util.Date; import java.util.Map; -public class HazelcastEntityComparator implements Comparator>, Serializable { + +public class HazelcastEntityComparator implements Comparator>, Serializable, Portable { private static final long serialVersionUID = 5413354955792888308L; + public static final int FACTORY_ID = 1; + public static final int CLASS_ID = 7; + + @Override + public int getFactoryId() { + return FACTORY_ID; + } + + @Override + public int getClassId() { + return CLASS_ID; + } + + @Override + public void writePortable(PortableWriter out) {} + + @Override + public void readPortable(PortableReader in) {} @Override public int compare(Map.Entry o1, Map.Entry o2) { From 4e07969097c0749f27a0e23b763e9e7f8caac4a4 Mon Sep 17 00:00:00 2001 From: tmatvienko Date: Wed, 14 Mar 2018 12:27:17 +0200 Subject: [PATCH 5/7] plugin_name_unique constraint removed --- ...11__alter_plugin_table_name_constraint.sql | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 devicehive-rdbms-dao/src/main/resources/db/migration/V3_4_11__alter_plugin_table_name_constraint.sql diff --git a/devicehive-rdbms-dao/src/main/resources/db/migration/V3_4_11__alter_plugin_table_name_constraint.sql b/devicehive-rdbms-dao/src/main/resources/db/migration/V3_4_11__alter_plugin_table_name_constraint.sql new file mode 100644 index 000000000..1765ea711 --- /dev/null +++ b/devicehive-rdbms-dao/src/main/resources/db/migration/V3_4_11__alter_plugin_table_name_constraint.sql @@ -0,0 +1,21 @@ +--- +-- #%L +-- DeviceHive Dao RDBMS Implementation +-- %% +-- Copyright (C) 2016 DataArt +-- %% +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- #L% +--- + +ALTER TABLE plugin DROP CONSTRAINT plugin_name_unique; \ No newline at end of file From 4d4375c0ef8354d282b961bf0d830232357b5497 Mon Sep 17 00:00:00 2001 From: Tatyana Matvienko Date: Thu, 15 Mar 2018 10:37:25 +0200 Subject: [PATCH 6/7] plugin_name_unique constraint removed (service check removed) (#501) --- .../java/com/devicehive/service/PluginRegisterService.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/devicehive-plugin/src/main/java/com/devicehive/service/PluginRegisterService.java b/devicehive-plugin/src/main/java/com/devicehive/service/PluginRegisterService.java index 010f8a602..d878e6c81 100644 --- a/devicehive-plugin/src/main/java/com/devicehive/service/PluginRegisterService.java +++ b/devicehive-plugin/src/main/java/com/devicehive/service/PluginRegisterService.java @@ -109,11 +109,6 @@ public PluginRegisterService( public CompletableFuture register(Long userId, PluginReqisterQuery pluginReqisterQuery, PluginUpdate pluginUpdate, String authorization) { validateSubscription(pluginReqisterQuery); - PluginVO existingPlugin = pluginService.findByName(pluginUpdate.getName()); - if (existingPlugin != null) { - logger.error("Plugin with name {} already exists", pluginUpdate.getName()); - throw new HiveException(String.format(Messages.PLUGIN_ALREADY_EXISTS, pluginUpdate.getName()), BAD_REQUEST.getStatusCode()); - } checkAuthServiceAvailable(); From b0976befe12443395dea623518e53eba0bf9498b Mon Sep 17 00:00:00 2001 From: tmatvienko Date: Tue, 20 Mar 2018 15:25:09 +0200 Subject: [PATCH 7/7] 3.4.5 Version update --- devicehive-auth/pom.xml | 2 +- devicehive-backend/pom.xml | 2 +- devicehive-common-dao/pom.xml | 2 +- devicehive-common-service/pom.xml | 2 +- devicehive-common/pom.xml | 2 +- devicehive-frontend/pom.xml | 2 +- devicehive-plugin/pom.xml | 2 +- devicehive-plugin/src/main/resources/application.properties | 2 +- devicehive-proxy-api/pom.xml | 2 +- devicehive-proxy-ws-kafka-impl/pom.xml | 2 +- devicehive-rdbms-dao/pom.xml | 2 +- .../src/main/resources/application-persistence.properties | 3 ++- devicehive-shim-api/pom.xml | 2 +- devicehive-shim-kafka-impl/pom.xml | 2 +- devicehive-test-utils/pom.xml | 2 +- dockerfiles/devicehive-auth.Dockerfile | 2 +- dockerfiles/devicehive-backend.Dockerfile | 2 +- dockerfiles/devicehive-frontend.Dockerfile | 2 +- dockerfiles/devicehive-hazelcast.Dockerfile | 2 +- dockerfiles/devicehive-plugin.Dockerfile | 2 +- pom.xml | 2 +- 21 files changed, 22 insertions(+), 21 deletions(-) diff --git a/devicehive-auth/pom.xml b/devicehive-auth/pom.xml index 911e9ac57..3f5fc79b2 100644 --- a/devicehive-auth/pom.xml +++ b/devicehive-auth/pom.xml @@ -5,7 +5,7 @@ devicehive-server com.devicehive - 3.4.5-SNAPSHOT + 3.4.5 4.0.0 jar diff --git a/devicehive-backend/pom.xml b/devicehive-backend/pom.xml index 2032691bc..3829d8ba7 100644 --- a/devicehive-backend/pom.xml +++ b/devicehive-backend/pom.xml @@ -5,7 +5,7 @@ devicehive-server com.devicehive - 3.4.5-SNAPSHOT + 3.4.5 4.0.0 diff --git a/devicehive-common-dao/pom.xml b/devicehive-common-dao/pom.xml index 1849c6e2f..140dcb27b 100644 --- a/devicehive-common-dao/pom.xml +++ b/devicehive-common-dao/pom.xml @@ -7,7 +7,7 @@ com.devicehive devicehive-server - 3.4.5-SNAPSHOT + 3.4.5 devicehive-common-dao jar diff --git a/devicehive-common-service/pom.xml b/devicehive-common-service/pom.xml index 350be0a74..0a8151ec6 100644 --- a/devicehive-common-service/pom.xml +++ b/devicehive-common-service/pom.xml @@ -5,7 +5,7 @@ devicehive-server com.devicehive - 3.4.5-SNAPSHOT + 3.4.5 4.0.0 jar diff --git a/devicehive-common/pom.xml b/devicehive-common/pom.xml index 18d91846c..4f402a22c 100644 --- a/devicehive-common/pom.xml +++ b/devicehive-common/pom.xml @@ -7,7 +7,7 @@ com.devicehive devicehive-server - 3.4.5-SNAPSHOT + 3.4.5 devicehive-common jar diff --git a/devicehive-frontend/pom.xml b/devicehive-frontend/pom.xml index 95d578924..f6853b8b8 100644 --- a/devicehive-frontend/pom.xml +++ b/devicehive-frontend/pom.xml @@ -5,7 +5,7 @@ devicehive-server com.devicehive - 3.4.5-SNAPSHOT + 3.4.5 4.0.0 jar diff --git a/devicehive-plugin/pom.xml b/devicehive-plugin/pom.xml index 63dc25a9a..c76f1f0ae 100644 --- a/devicehive-plugin/pom.xml +++ b/devicehive-plugin/pom.xml @@ -5,7 +5,7 @@ devicehive-server com.devicehive - 3.4.5-SNAPSHOT + 3.4.5 4.0.0 jar diff --git a/devicehive-plugin/src/main/resources/application.properties b/devicehive-plugin/src/main/resources/application.properties index da15f6d24..ce919fa2c 100644 --- a/devicehive-plugin/src/main/resources/application.properties +++ b/devicehive-plugin/src/main/resources/application.properties @@ -66,4 +66,4 @@ auth.base.url=http://localhost:8090/dh/rest #proxy link proxy.connect=localhost:3000 -proxy.plugin.connect=localhost:3001 \ No newline at end of file +proxy.plugin.connect=ws://localhost:3001 \ No newline at end of file diff --git a/devicehive-proxy-api/pom.xml b/devicehive-proxy-api/pom.xml index 2db7a6fa6..611ecead5 100644 --- a/devicehive-proxy-api/pom.xml +++ b/devicehive-proxy-api/pom.xml @@ -7,7 +7,7 @@ com.devicehive devicehive-server - 3.4.5-SNAPSHOT + 3.4.5 devicehive-proxy-api jar diff --git a/devicehive-proxy-ws-kafka-impl/pom.xml b/devicehive-proxy-ws-kafka-impl/pom.xml index 6c83381e4..228f4ac2e 100644 --- a/devicehive-proxy-ws-kafka-impl/pom.xml +++ b/devicehive-proxy-ws-kafka-impl/pom.xml @@ -7,7 +7,7 @@ com.devicehive devicehive-server - 3.4.5-SNAPSHOT + 3.4.5 devicehive-proxy-ws-kafka-impl jar diff --git a/devicehive-rdbms-dao/pom.xml b/devicehive-rdbms-dao/pom.xml index dc50570b0..a332dd886 100644 --- a/devicehive-rdbms-dao/pom.xml +++ b/devicehive-rdbms-dao/pom.xml @@ -7,7 +7,7 @@ com.devicehive devicehive-server - 3.4.5-SNAPSHOT + 3.4.5 devicehive-rdbms-dao jar diff --git a/devicehive-rdbms-dao/src/main/resources/application-persistence.properties b/devicehive-rdbms-dao/src/main/resources/application-persistence.properties index a283d2bf4..0cd49439f 100644 --- a/devicehive-rdbms-dao/src/main/resources/application-persistence.properties +++ b/devicehive-rdbms-dao/src/main/resources/application-persistence.properties @@ -24,7 +24,8 @@ spring.datasource.username=postgres spring.datasource.password=12345 # JPA spring.jpa.hibernate.ddl-auto=none -spring.jpa.show-sql=false +spring.jpa.show-sql=true +hibernate.show_sq=true spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL9Dialect spring.jpa.properties.hibernate.format_sql=true spring.data.jpa.repositories.enabled=false diff --git a/devicehive-shim-api/pom.xml b/devicehive-shim-api/pom.xml index 12e6c1d6a..0692667ab 100644 --- a/devicehive-shim-api/pom.xml +++ b/devicehive-shim-api/pom.xml @@ -7,7 +7,7 @@ com.devicehive devicehive-server - 3.4.5-SNAPSHOT + 3.4.5 devicehive-shim-api jar diff --git a/devicehive-shim-kafka-impl/pom.xml b/devicehive-shim-kafka-impl/pom.xml index 28944d65c..9b2a1b5c1 100644 --- a/devicehive-shim-kafka-impl/pom.xml +++ b/devicehive-shim-kafka-impl/pom.xml @@ -5,7 +5,7 @@ devicehive-server com.devicehive - 3.4.5-SNAPSHOT + 3.4.5 4.0.0 diff --git a/devicehive-test-utils/pom.xml b/devicehive-test-utils/pom.xml index e64ad18bc..81b10f65e 100644 --- a/devicehive-test-utils/pom.xml +++ b/devicehive-test-utils/pom.xml @@ -1 +1 @@ - devicehive-server com.devicehive 3.4.5-SNAPSHOT 4.0.0 devicehive-test-utils DeviceHive Test Utils ${project.parent.basedir} org.hsqldb hsqldb ${hsqldb.version} org.hibernate hibernate-core ${hibernate-version} org.springframework.boot spring-boot-starter-test org.apache.kafka kafka-clients ${kafka.version} test org.apache.kafka kafka_${scala-binaries.version} ${kafka.version} slf4j-log4j12 org.slf4j org.apache.kafka kafka_${scala-binaries.version} ${kafka.version} test slf4j-log4j12 org.slf4j \ No newline at end of file + devicehive-server com.devicehive 3.4.5 4.0.0 devicehive-test-utils DeviceHive Test Utils ${project.parent.basedir} org.hsqldb hsqldb ${hsqldb.version} org.hibernate hibernate-core ${hibernate-version} org.springframework.boot spring-boot-starter-test org.apache.kafka kafka-clients ${kafka.version} test org.apache.kafka kafka_${scala-binaries.version} ${kafka.version} slf4j-log4j12 org.slf4j org.apache.kafka kafka_${scala-binaries.version} ${kafka.version} test slf4j-log4j12 org.slf4j \ No newline at end of file diff --git a/dockerfiles/devicehive-auth.Dockerfile b/dockerfiles/devicehive-auth.Dockerfile index 008a67129..adb788c45 100644 --- a/dockerfiles/devicehive-auth.Dockerfile +++ b/dockerfiles/devicehive-auth.Dockerfile @@ -2,7 +2,7 @@ FROM openjdk:8u151-jre-slim MAINTAINER devicehive -ENV DH_VERSION="3.4.5-SNAPSHOT" +ENV DH_VERSION="3.4.5" LABEL org.label-schema.url="https://devicehive.com" \ org.label-schema.vendor="DeviceHive" \ diff --git a/dockerfiles/devicehive-backend.Dockerfile b/dockerfiles/devicehive-backend.Dockerfile index 849f2c79e..5a2ecad1e 100644 --- a/dockerfiles/devicehive-backend.Dockerfile +++ b/dockerfiles/devicehive-backend.Dockerfile @@ -2,7 +2,7 @@ FROM openjdk:8u151-jre-slim MAINTAINER devicehive -ENV DH_VERSION="3.4.5-SNAPSHOT" +ENV DH_VERSION="3.4.5" LABEL org.label-schema.url="https://devicehive.com" \ org.label-schema.vendor="DeviceHive" \ diff --git a/dockerfiles/devicehive-frontend.Dockerfile b/dockerfiles/devicehive-frontend.Dockerfile index 26a0a1e1c..51ae729a2 100644 --- a/dockerfiles/devicehive-frontend.Dockerfile +++ b/dockerfiles/devicehive-frontend.Dockerfile @@ -2,7 +2,7 @@ FROM openjdk:8u151-jre-slim MAINTAINER devicehive -ENV DH_VERSION="3.4.5-SNAPSHOT" +ENV DH_VERSION="3.4.5" LABEL org.label-schema.url="https://devicehive.com" \ org.label-schema.vendor="DeviceHive" \ diff --git a/dockerfiles/devicehive-hazelcast.Dockerfile b/dockerfiles/devicehive-hazelcast.Dockerfile index 98716a29d..44112bed5 100644 --- a/dockerfiles/devicehive-hazelcast.Dockerfile +++ b/dockerfiles/devicehive-hazelcast.Dockerfile @@ -2,7 +2,7 @@ FROM hazelcast/hazelcast:3.8.8 MAINTAINER devicehive -ENV DH_VERSION="3.4.5-SNAPSHOT" +ENV DH_VERSION="3.4.5" LABEL org.label-schema.url="https://devicehive.com" \ org.label-schema.vendor="DeviceHive" \ diff --git a/dockerfiles/devicehive-plugin.Dockerfile b/dockerfiles/devicehive-plugin.Dockerfile index 9471fe5bf..9e0a8511c 100644 --- a/dockerfiles/devicehive-plugin.Dockerfile +++ b/dockerfiles/devicehive-plugin.Dockerfile @@ -2,7 +2,7 @@ FROM openjdk:8u151-jre-slim MAINTAINER devicehive -ENV DH_VERSION="3.4.5-SNAPSHOT" +ENV DH_VERSION="3.4.5" LABEL org.label-schema.url="https://devicehive.com" \ org.label-schema.vendor="DeviceHive" \ diff --git a/pom.xml b/pom.xml index 3d5e66f1f..641dad369 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ com.devicehive devicehive-server pom - 3.4.5-SNAPSHOT + 3.4.5 DeviceHive Java Server