bouncer
Simple email whitelist checker backed by the AWS Secrets Manager
setup
regular
Either add cgp-bouncer to your project requirements or
pip install cgp-bouncer
in a Python 3 virtualenv.
for development
Instead of the steps above clone the repo, cd into the repo, and run
pip install -e .
and
pip install -r requirements-dev.txt
To test, run
tox
how to use
setting up the whitelist
- Go to the AWS Console and find the Secrets Manager service.
- Select Store a new secret.
- For secret type select Other type of secrets.
- Under the Secret key/value tab enter
emailas the key and a comma separated (no spaces) list of whitelisted emails as the value. Select Next. - Name your secret something descriptive, such as
commons/dev/whitelistand give it a description. Select Next. - Make sure Disable automatic rotation is selected. Then select Next.
- Review your configuration and select Store.
adding someone to the whitelist
- Go to the AWS Console and find the Secrets Manager service.
- Find the secret to which you want to add. For example, one might
search for
commons/dev/whitelist. - Under Secret value, select Retrieve secret value. Then select Edit.
- Add your email with NO WHITESPACE to the comma separated list
under the key
emailand select Save.
using bouncer to check the whitelist
Using is simple!
Here's an example
>>> from bouncer import Bouncer
>>> b = Bouncer('commons/dev/whitelist')
>>> b.is_authorized('valid.email@example.com')
True
>>> b.is_authorized('evil.gnomes@example.com')
False
This checks the AWS Secret Keeper called commons/dev/whitelist to see
if the users valid.email@example.com and evil.gnomes@example.com
are in the whitelist.
Metadata
Release files for cgp-bouncer 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cgp-bouncer-0.1.0.tar.gz | 3.4 kB | Without provenance | Details for cgp-bouncer-0.1.0.tar.gz |
Release files / cgp-bouncer-0.1.0.tar.gz
| Download URL | cgp-bouncer-0.1.0.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6a6add36f173f9f70bad98114a5baf2feb0be0553d980f2ccb2b4313a4a91f6
|
|
BLAKE2b-256 checksum How to use checksums |
38cd9af40560aca4b177830aeb9cc6252dcb05585a766ff90bceae4c1159ee98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.14
|
Security for cgp-bouncer 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.