Commit b0e7bc0e31263e16f54696ec1b8e4d02b4b22273

Authored by Andrew Shvayka
1 parent 920ebc79

Build fix

... ... @@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
24 24 import org.springframework.beans.factory.annotation.Value;
25 25 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
26 26 import org.springframework.stereotype.Service;
  27 +import org.springframework.util.StringUtils;
27 28 import org.thingsboard.server.common.data.Device;
28 29 import org.thingsboard.server.common.data.id.DeviceId;
29 30 import org.thingsboard.server.common.data.id.TenantId;
... ... @@ -142,8 +143,13 @@ public class LocalTransportApiService implements TransportApiService {
142 143 return getEmptyTransportApiResponse();
143 144 }
144 145 try {
  146 + ValidateDeviceCredentialsResponseMsg.Builder builder = ValidateDeviceCredentialsResponseMsg.newBuilder();
  147 + builder.setDeviceInfo(getDeviceInfoProto(device));
  148 + if(!StringUtils.isEmpty(credentials.getCredentialsValue())){
  149 + builder.setCredentialsBody(credentials.getCredentialsValue());
  150 + }
145 151 return TransportApiResponseMsg.newBuilder()
146   - .setValidateTokenResponseMsg(ValidateDeviceCredentialsResponseMsg.newBuilder().setDeviceInfo(getDeviceInfoProto(device)).setCredentialsBody(credentials.getCredentialsValue()).build()).build();
  152 + .setValidateTokenResponseMsg(builder.build()).build();
147 153 } catch (JsonProcessingException e) {
148 154 log.warn("[{}] Failed to lookup device by id", deviceId, e);
149 155 return getEmptyTransportApiResponse();
... ...
... ... @@ -40,7 +40,7 @@ public abstract class AbstractTransportService implements TransportService {
40 40 private boolean rateLimitEnabled;
41 41 @Value("${transport.rate_limits.tenant}")
42 42 private String perTenantLimitsConf;
43   - @Value("${transport.rate_limits.tenant}")
  43 + @Value("${transport.rate_limits.device}")
44 44 private String perDevicesLimitsConf;
45 45 @Value("${transport.sessions.inactivity_timeout}")
46 46 private long sessionInactivityTimeout;
... ...