I am using digital ocean’s python api. I generated a token and successfully created a couple of droplets using snapshots. In order to make the use of the token safer, is there a way to restrict the use of the token from specific ip addresses? In other words,is it possible to add the ip addresses of the machines allowed to use the token? Thanks in advance
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hello,
I don’t think that this is currently possible. You could share your idea here:
https://ideas.digitalocean.com/ideas/
What I could suggest in the meantime, is keeping your API key in a separate file, for example, use
config.py
and then add thatconfig.py
file to your gitignore so that the file only gets uploaded to your server.Regards, Bobby