Name: credentials
Owner: Sauce Labs
Description: Credential Manager
Created: 2015-11-20 11:48:11.0
Updated: 2015-11-20 11:48:12.0
Pushed: 2015-11-20 11:58:34.0
Homepage: null
Size: 22
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
p install credentials
Using default setup, this will try and load credentials first from the processes environement variables and then from ~/.credentials.json
credentials import credentials
ad credentials up front
s = credentials.require(['cred1', 'cred2'])
tion_that_needs_creds(creds.cred1)
ad credentials as needed
red = credentials.load('cred_3')
tion_that_needs_creds(my_cred)
ly load credentias from environement
credentials import Credentials, EnvBackend
s = Credentials([EnvBackend()])
A backend is just an object with a load
method. Method should take a key
as an argument and return the associated credentials or None
if it could not be loaded.
Example:
s UniversalCredLoader(object):
ef load(self, key):
return 42
credentials import Credentials
s = Credentials([UniversalCredLoader()])
.load('cred1')
42