Improvements
This commit is contained in:
parent
3d8b2cbbbf
commit
81585f04c8
@ -237,7 +237,7 @@ public class DefaultTbApiUsageStateService implements TbApiUsageStateService {
|
||||
|
||||
@Override
|
||||
public void onTenantUpdate(TenantId tenantId) {
|
||||
log.info("[{}] On Tenant Update", tenantId);
|
||||
log.info("[{}] On Tenant Update.", tenantId);
|
||||
TenantProfile tenantProfile = tenantProfileCache.get(tenantId);
|
||||
updateLock.lock();
|
||||
try {
|
||||
@ -251,7 +251,6 @@ public class DefaultTbApiUsageStateService implements TbApiUsageStateService {
|
||||
}
|
||||
|
||||
private void updateTenantState(TenantApiUsageState state, TenantProfile profile) {
|
||||
log.info("[{}] On Tenant Update.", state.getTenantId());
|
||||
TenantProfileData oldProfileData = state.getTenantProfileData();
|
||||
state.setTenantProfileId(profile.getId());
|
||||
state.setTenantProfileData(profile.getProfileData());
|
||||
|
||||
@ -164,21 +164,24 @@ public class DefaultTransportApiService implements TransportApiService {
|
||||
}
|
||||
|
||||
private ListenableFuture<TransportApiResponseMsg> validateCredentials(TransportProtos.ValidateBasicMqttCredRequestMsg mqtt) {
|
||||
DeviceCredentials credentials = deviceCredentialsService.findDeviceCredentialsByCredentialsId(mqtt.getUserName());
|
||||
if (credentials != null) {
|
||||
if (credentials.getCredentialsType() == DeviceCredentialsType.ACCESS_TOKEN) {
|
||||
return getDeviceInfo(credentials.getDeviceId(), credentials);
|
||||
} else if (credentials.getCredentialsType() == DeviceCredentialsType.MQTT_BASIC) {
|
||||
if (!checkMqttCredentials(mqtt, credentials)) {
|
||||
credentials = null;
|
||||
DeviceCredentials credentials = null;
|
||||
if (mqtt.getUserName() != null) {
|
||||
credentials = deviceCredentialsService.findDeviceCredentialsByCredentialsId(mqtt.getUserName());
|
||||
if (credentials != null) {
|
||||
if (credentials.getCredentialsType() == DeviceCredentialsType.ACCESS_TOKEN) {
|
||||
return getDeviceInfo(credentials.getDeviceId(), credentials);
|
||||
} else if (credentials.getCredentialsType() == DeviceCredentialsType.MQTT_BASIC) {
|
||||
if (!checkMqttCredentials(mqtt, credentials)) {
|
||||
credentials = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (credentials == null) {
|
||||
credentials = checkMqttCredentials(mqtt, EncryptionUtil.getSha3Hash("|", mqtt.getClientId(), mqtt.getUserName()));
|
||||
}
|
||||
}
|
||||
if (credentials == null) {
|
||||
credentials = checkMqttCredentials(mqtt, EncryptionUtil.getSha3Hash("|", mqtt.getClientId(), mqtt.getUserName()));
|
||||
if (credentials == null) {
|
||||
credentials = checkMqttCredentials(mqtt, EncryptionUtil.getSha3Hash(mqtt.getClientId()));
|
||||
}
|
||||
credentials = checkMqttCredentials(mqtt, EncryptionUtil.getSha3Hash(mqtt.getClientId()));
|
||||
}
|
||||
if (credentials != null) {
|
||||
return getDeviceInfo(credentials.getDeviceId(), credentials);
|
||||
|
||||
@ -58,7 +58,7 @@ In case of any issues you can examine service logs for errors.
|
||||
For example to see ThingsBoard node logs execute the following command:
|
||||
|
||||
`
|
||||
$ docker-compose logs -f tb-core1 tb-rule-engine1
|
||||
$ docker-compose logs -f tb-core1 tb-core2 tb-rule-engine1 tb-rule-engine2 tb-mqtt-transport1 tb-mqtt-transport2
|
||||
`
|
||||
|
||||
Or use `docker-compose ps` to see the state of all the containers.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user