Skip to content

Comment on Developer posts secret key on GitHub, loses $40K in 2 minutesparent

Comments

Usually the simplest way is leveraging environment variables. You can set the API key as one on the remote server, then you can get it with `API_KEY = os.environ.get("API_KEY")`. That's a Python-specific example - but hopefully you get the idea.

There are other services that manage securely saving/storing these keys rather than just hosting it on the server itself (e.g. AWS Secrets Manager)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.