Is there a stranded place to store auth and API keys for other services

18 views
Skip to first unread message

a.p...@gmail.com

unread,
Jan 19, 2015, 6:23:56 AM1/19/15
to turbo...@googlegroups.com

Hello

In my TurboGears Webapps I sometimes use internet services which require API keys or some other authentication information (for example- Amazon S3 auth)

Currently I store that information in a few places:

1.       In lib.app_globals inside Globals

2.       I keep a table in the database, say "config_options_table", and use 2 columns - key, value

3.       In the development.ini and production.ini

I wanted to ask, what is the logical or standard place to store that information, according to TurboGears design logic?

Thanks for the help

Moritz Schlarb

unread,
Jan 19, 2015, 6:31:17 AM1/19/15
to turbo...@googlegroups.com
3. This kind of deployment-specific configuration should always belong
on the config files (*.ini) and never directly in the code.
Different instances could use different keys. And you wouldn't want
those keys to be checked in your source code management and accidentally
publicize them somewhere.

2. I'd say, using the database would make sense if those values change
often or should be changeable by end-users for some reason.
Or if you want to be able to configure it without editing a
configuration file.

1. If you wanted to store them inside the code, I think the place would
rather be in app_cfg than in app_globals, just because of the name. But
I wouldn't advise that anyhow.

Cheers,
Moritz
--
Moritz Schlarb

אלון פלגי

unread,
Jan 19, 2015, 6:41:05 AM1/19/15
to turbo...@googlegroups.com
Good advices
I'll go with the deploy config files option

Thanks,
Alon


--
Moritz Schlarb

--
You received this message because you are subscribed to a topic in the Google Groups "TurboGears" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/turbogears/lsTJqnWxZVE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to turbogears+...@googlegroups.com.
To post to this group, send email to turbo...@googlegroups.com.
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.



--
אלון
Reply all
Reply to author
Forward
0 new messages