How to restrict token use withint applications of specific IP address?

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

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.


I don’t think that this is currently possible. You could share your idea here:

What I could suggest in the meantime, is keeping your API key in a separate file, for example, use and then add that file to your gitignore so that the file only gets uploaded to your server.

Regards, Bobby