Commit Graph

6 Commits

Author SHA1 Message Date
Alexander Hughes 14f8600e37 Add profiles to passphrase catalog
Change-Id: Id6e7cddd123e31f0df963167ddf3fa8f33e9060c
2019-09-24 16:19:36 +00:00
Alexander Hughes 1c8d92ef6b Standardize Pegleg code with YAPF
This patch addresses inconsistent code style and enforces it with a
gate for future submissions.

Separate work will be done in the future to address several of the
PEP8 ignores for docstrings, and attempt to bring the tests directory
to PEP8 compliance.

This patch:
1. Updates .style.yapf to set the knobs desired for YAPF.
2. Updates tox.ini to allow one of the knobs to work.
3. Removes unused code from several __init__.py files.
4. Updates the YAPF version in test-requirements.txt to latest (this
   is needed for several knobs to work).
5. Stylistic changes to the python codebase in Pegleg.
6. Updates to tox.ini to run YAPF during PEP8 check.

Change-Id: Ieaa0fdef2b601d01c875d64b840986e54df73abf
2019-07-25 17:28:18 +00:00
Alexander Hughes cecd24ed38 Ensure cryptostrings contain all char types
This patch aims to:
1. Validate that generated cryptographic strings (salts and passphrases)
   contain at least one uppercase letter, lowercase letter, number and
   symbol before returning it to the user.
2. Add new unit tests for the cryptostring methods.
3. Move existing unit tests for cryptostring methods to new test file.
4. Rename test_generate_cryptostring to test_passphrases as this is
   more accurate of the tests contained in the file.

Change-Id: I669831fb515209467b236cca63502f64a9263d86
2019-04-11 13:22:58 -05:00
Alexander Hughes bd4eb75f42 Update passphrase pool of characters
Certain characters when used in various applications cause them to behave
unexpectedly.  Remove these characters to be more generic and support a
wider variety of applications.

Change-Id: I021c4045e52b0637de3353ae6a3acf4709fb698b
2019-03-29 09:27:20 -05:00
tinlam cecaa73f57 Remove extraneous dependency
The rstr library relies on the normal random.SystemRandom() and does not
perform additional functionalites that would require a whole dependency
to be added to pegleg. This patch set places in the logic into pegleg's
crypto generation rather than using the whole rstr library.

Change-Id: I20c0ceae8ac7d11468f325cd6a4cc035fc176b14
Signed-off-by: Tin Lam <tin@irrational.io>
2019-03-26 23:14:23 -05:00
Alexander Hughes 671b77f6a7 Add CLI generation of salt
Salts and Passphrases are both strings used in cryptography.  This patch:
1. Adds CLI generation of salt
2. Adds unit test for CLI generation of salt
3. Updates passphrase.py code to be more generic as it is used to generate
both a passphrase and a salt
4. Update name of passphrase.py to be more generic
5. Update all references to, and tests of passphrase.py
6. Add documentation for CLI generation of salt

Co-Authored-By: chittibabu <cg329x@att.com>

Change-Id: I71858d63a2846290d22be96686ccfea3ba8aa6c0
2019-02-20 16:51:01 +00:00