socialwifi / RouterOS-api

Python API to RouterBoard devices produced by MikroTik.
MIT License
251 stars 100 forks source link

Fix: encode username and password if necessary for plaintext login method. #50

Closed Behoston closed 4 years ago

Behoston commented 4 years ago

The problem was in plain text login method: username and password was not encoded to bytes when plaintext_login=True. I'm leaving check if string type is provided due to some people may already using bytes to fix the problem on his own.

Proper solution of: https://github.com/socialwifi/RouterOS-api/pull/48 , https://github.com/socialwifi/RouterOS-api/pull/46

Resolves: https://github.com/socialwifi/RouterOS-api/issues/47

riklaunim commented 4 years ago

:+1:

davidc commented 4 years ago

Unlike the patch I sent, this fix still leaves the API with the constraint where the parameters to call_async() are required to be of inconsistent types: the key MUST be a string (not bytes) and the value MUST be bytes (not string).