saucelabs/credentials

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status Requirements Status PyPI

Installing

p install credentials

Usage

Default

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)

Setting up your own loader
ly load credentias from environement
 credentials import Credentials, EnvBackend
s = Credentials([EnvBackend()])

Implementing your own backend

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

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.