Open hrszpuk opened 10 months ago
I don't mind working on this, but I would prefer if you give the go ahead (+ anything you want to add/change) so I know this isn't something you don't want and my work goes to waste 😅.
Alright since I got a response on Discord I'll start implementing it.
Problem
Extract from README.md:
Proposed Solution: Encrypted Token File
Instead of storing the OPM_TOKEN as an environmental variable, why not use a config file? Storing the token in a file would simplify the token code significantly as file I/O is cross-platform using core:os. In addition, the token file could be encrypted to add additional security for the users of opm_cli.
Config locations
Here are examples of config locations that would be platform dependent. All these paths include an "opm_cli" folder for any files/data the package manager may need to store in the future.
%APPDATA%\\opm_cli\\.OPM_TOKEN
~/Library/Preferences/opm_cli/.OPM_TOKEN
~/.config/opm_cli/.OPM_TOKEN
Additional features
Since an environmental variable allows users to see their token when typed into a terminal, I'm also going to suggest we expand the
opm token
subcommand to the following subcommands: