Google App Engine - How to Prevent Password Infection

I use GAE to run my application. My application uses a password to connect an external service. I currently store this password in the free text properties file, which is part of the sources. Because I share my sources in git-hub my passwords are exposed

Is there a way to store this kind of confidential information in the GAE configuration / environment (using the admin portal) or something like that. I think I can somehow store it in a DataStore, but I'm looking for something simpler than a heroku ENV solution

+3
source share
2 answers

, .gitignore 'd, (, "private.py" ). - (, "private.py.sample" ).

+5
class AppConfig(db.Model):
    pass = db.StringProperty()

# ...
cfg = AppConfig.get_by_key_name("MyFirstApplication")
if cfg is None:
    cfg = AppConfig(key_name="MyFirstApplication")
    # this is initial run - request pass from user
    cfg.pass = userInput
    cfg.put()
# here you can use your cfg.pass
+1

Source: https://habr.com/ru/post/1794370/


All Articles