[OT] Testing and credentials best practices?

Chris Angelico rosuav at gmail.com
Sun Apr 20 12:45:24 EDT 2014


On Mon, Apr 21, 2014 at 2:36 AM, Miki Tebeka <miki.tebeka at gmail.com> wrote:
> How do you deal with tests (both on dev machine and Jenkins) that need credentials (such as AWS keys)?. I know of the following methods:
>
> 1. Test user with known (stored in source control) limited credentials
> 2. ~/.secrets (or any other known location) RC file which is not in source control
> 3. Credentials service (such as ZooKeeper) accessed only from VPN
> 4. Credentials pre user encrypted (gpg) and stored in source control

I've done several of these. Another option that may work in some
contexts is to mock the test altogether; have a server that simulates
whatever you needed credentials for, and accepts a key of all zeroes
or equivalent. Obviously that key can happily go into the source code
:)

ChrisA



More information about the Python-list mailing list