Added Login and Device Registration#8
Conversation
|
I haven't had time to properly review but my thoughts so far; A first run where the user is prompted for their username/password would be far more preferable to every saving those credentials to disk. In general this looks like a complete rewrite, disregarding existing style. You may be better off just starting another client. |
… of original package
…tibility with existing settings files
Improve the way settings are saved to disk (no value stored at all for username & password; pretty print used)
|
I've tried to keep to the patterns you established in the original project; however, on review I realise that I have used semicolons where you have not, and this may be contributing to the perception that it's a complete rewrite. In fact, I have only added two new functions to your main class - one to do a "login" (gets the user Secret from Pushover based on the email address and password), and the other to register the device. The pushover-desktop-client script has by necessity changed a lot, so that the login function and register function can be used - however, I have updated this again to try and better match your style, and make it clearer which are changes to your design, and where it (mostly) stays the same. Finally, in this revision, I have reverted back to "secret" rather than "userSecret", so existing settings files will work without requiring the user to login again |
|
I installed the version by @Rocketeer007 just now, on macOS 12 (Monterey), and it throws some errors during install:
So it looks like it needs some overhaul and updating. Or am I missing something? |
|
Update – installed from my own fork with updated dependencies here – https://github.com/JayBrown/pushover-desktop-client –, and the above warnings/errors are gone. However, the |
|
I seem to have solved it… the |
I've added functionality to handle the proper Login and Device Registration procedures documented in the Pushover Open Client API: https://pushover.net/api/client
Initially, the user should save the userEmail and userPassword in either the settings json or in environment variables. Using these details, the library will now fetch the userSecret needed, and register a new deviceId; both of these values are then saved back to the settings json.
The user's password is never saved to disk - only the userSecret and deviceId are saved, and once these are available the rest of the package continues to work exactly as per your original design.