|
@@ -37,11 +37,6 @@ public class MqttDefaultAuth extends JetLinksAuthenticator {
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
return deviceOperation
|
|
return deviceOperation
|
|
|
- .getProduct()
|
|
|
|
|
- .flatMap(deviceProductOperator -> deviceProductOperator.getProtocol()
|
|
|
|
|
- .flatMap(protocolSupport -> protocolSupport.authenticate(request,deviceOperation)))
|
|
|
|
|
- .switchIfEmpty(Mono.error(()->new DeviceOperationException(UNSUPPORTED_MESSAGE)))
|
|
|
|
|
- .flatMap(ignore->deviceOperation
|
|
|
|
|
.getConfigs("secureId", "secureKey")
|
|
.getConfigs("secureId", "secureKey")
|
|
|
.map(conf -> {
|
|
.map(conf -> {
|
|
|
String secureId = conf.getValue("secureId").map(Value::asString).orElse(null);
|
|
String secureId = conf.getValue("secureId").map(Value::asString).orElse(null);
|
|
@@ -57,7 +52,7 @@ public class MqttDefaultAuth extends JetLinksAuthenticator {
|
|
|
} else {
|
|
} else {
|
|
|
return AuthenticationResponse.error(401, "密钥错误");
|
|
return AuthenticationResponse.error(401, "密钥错误");
|
|
|
}
|
|
}
|
|
|
- }));
|
|
|
|
|
|
|
+ });
|
|
|
} catch (NumberFormatException e) {
|
|
} catch (NumberFormatException e) {
|
|
|
return Mono.just(AuthenticationResponse.error(401, "用户名格式错误"));
|
|
return Mono.just(AuthenticationResponse.error(401, "用户名格式错误"));
|
|
|
}
|
|
}
|