I was tired of having to go to github and use the UI to create a repo before I could add files to it so I researched the API options. I then realized I could curl the process but this was bulky and wasn’t user friendly.
I then built a python proof of concept script that creates a repo and works properly using requests and the post action. I have set the API key in my environment variables and that works fine when pulling them using:
I have compiled this using pyinstaller and the binary works great. So for my own use I can toss it in my /bin folder and go to town, (maybe I’ll compile on windows and mac too at some point, who knows?).
My question is how to best set the API key for external users? Would requiring them to add the key to environment variables be fine, or is there a better way?
I was thinking about making a script that asks for the API key, storing that in an encrypted file and then decrypting that file every time the app runs but that seems like it would end up being about as insecure as using an environment variable.
How do you tackle API key storage? Any code examples, web pages etc would be really helpful.
If you are interested in this project, I will not have it published live for a while as I’m currently considering how many switches I want to add based on the API reference here: