lemeryfertitta/BoardLib

Add Support for Environment Variables for App Passwords

Closed this issue · 2 comments

Background:
Currently, the application relies on getpass for password input, which does not support pasting text (Ctrl + V). This limitation can be inconvenient for users who prefer to use password managers or need to enter complex passwords.

Suggested Enhancement:
I propose adding support for environment variables to handle passwords. This feature would allow users to set their passwords as environment variables, which the application would check before prompting for a password using getpass. If the environment variable for a specific board's password is set, the application would use this password. Otherwise, it would fall back to prompting the user.

Example Usage:
For "kilter", the user can set the password using an environment variable as follows:
Mac:
export KILTER_PASSWORD="myPassword"
Windows:
$env:KILTER_PASSWORD = "myPassword"
Then, they can run the application with:

boardlib kilter
In this scenario, the application would automatically use the password from KILTER_PASSWORD without prompting the user.

Benefits:
Enhances user convenience, especially for those using password managers or dealing with complex passwords.
Maintains current functionality for users who prefer to input their passwords manually.
Increases the accessibility of the application by providing an alternative password input method.

Just realized for the moonboards you need to make individual passwords: ie. MOON2016_PASSWORD and MOON2019_PASSWORD.

@akirosingh that's a good point. It also makes me think that the library would be more consistent if all Moonboard configurations were just under "moon" instead of having to specify each year/angle, as pointed out by #8. For Aurora-based boards, the logbook entries are for all layouts. I think there is a bit of generally inconsistency between the concepts of a login, a board, and a layout.

Seems like board/login are 1:1 (Kilter/Tension/Moon all have their own credentials) and then layout to board/login is many:1. I'll open some issues to fix these.