Add imwww interface from Jarvis to monitor
|Status:||Closed||Start date:||28 Jan 2018|
|Target version:||Iron Man - 002 - MVP|
|Severity:||01 - Critical|
This is the interface that makes REST API connections to send messages and retrieve responses.
Input to this class comes in Message objects.
Output from this class is delivered in Message objects.
The Message class may be extended to support JSON parsing of string data.
RM #605: Added AES crypto support.
Fixed PUT/GET issues when using HttpURLConnection.setDoOutput().
Added support for retrieving monitor description.
#3 Updated by Hammel about 1 month ago
- Status changed from New to In Progress
- % Done changed from 0 to 30
Implemented and partially tested. Still needs to be tested against imwww REST API, however. Also does not actually accept any specific commands from JarvisCmd, so that needs to be added there too before I can verify the command makes it all the way to the monitor.
#4 Updated by Hammel about 1 month ago
Implementing SSL has become problematic, probably because I can't quite grasp all the nuances of getting it right (not to mention the problems of dealing with self-signed certs). But it also now seems like overkill. What I really want is the same process the sensors are using with the monitor:
- Exchange UUID key at registration: each monitor has a unique UUID and each Jarvis node has unique UUID.
- Encrypt a message with aes(UUID+IV+message).
- Send IV plus encrypted message in the clear (http, not https)
- Decrypt using UUID+IV
The UUID is never sent except in the registration so it's a low-probability of getting intercepted - the user has to enable registration. So while the message and IV are sent in the open, the message itself is encrypted. You can know who is talking but not what is being said. At least not easily.
This will simplify message passing considerably. It's probably hackable, but not easily. And even the hacking could be reduced by using a sneaker-net input of remote end point keys.
I need to implement this on both end points: monitor (imrest) and Jarvis.
- % Done changed from 30 to 50
This has been implemented in Jarvis for decoding messages that were encrypted on on the NodeJS side. It's been shown to work by having Jarvis ask for /monitor, which returns the monitor descriptor using AES encryption inside a JSON packet that contains an IV and a message.
Since AES 128 is being used the encryption key (Jarvis' UUID) is shorted to 16 bytes on both ends.
This code is committed and pushed.
Now I need to reverse the process by encrypting in Jarvis and decrypting on the NodeJS side. This will be tested using the /device API from Jarvis to monitor.
- Status changed from In Progress to Closed
- % Done changed from 50 to 100
Code implemented, tested and pushed. I verified it worked by having Jarvis encode a device state change request and sent it to the monitor, which printed out the decoded request string.