Skip to content

Commit ff499ad

Browse files
authored
Merge pull request #82 from mattsb42-aws/vectors
Cleanup test vector handlers module and prepare for release
2 parents db217dd + 4a04d4f commit ff499ad

31 files changed

+206
-13
lines changed

.travis.yml

Lines changed: 112 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,116 @@ matrix:
9494
env: TOXENV=black-check
9595
- python: 3.6
9696
env: TOXENV=isort-check
97+
########################
98+
# Test Vector Handlers #
99+
########################
100+
# CPython 2.7
101+
- python: 2.7
102+
env:
103+
TEST_VECTOR_HANDLERS=1
104+
TOXENV=py27-awses_1.3.0
105+
- python: 2.7
106+
env:
107+
TEST_VECTOR_HANDLERS=1
108+
TOXENV=py27-awses_1.3.max
109+
- python: 2.7
110+
env:
111+
TEST_VECTOR_HANDLERS=1
112+
TOXENV=py27-awses_latest
113+
# CPython 3.4
114+
- python: 3.4
115+
env:
116+
TEST_VECTOR_HANDLERS=1
117+
TOXENV=py34-awses_1.3.0
118+
- python: 3.4
119+
env:
120+
TEST_VECTOR_HANDLERS=1
121+
TOXENV=py34-awses_1.3.max
122+
- python: 3.4
123+
env:
124+
TEST_VECTOR_HANDLERS=1
125+
TOXENV=py34-awses_latest
126+
# CPython 3.5
127+
- python: 3.5
128+
env:
129+
TEST_VECTOR_HANDLERS=1
130+
TOXENV=py35-awses_1.3.0
131+
- python: 3.5
132+
env:
133+
TEST_VECTOR_HANDLERS=1
134+
TOXENV=py35-awses_1.3.max
135+
- python: 3.5
136+
env:
137+
TEST_VECTOR_HANDLERS=1
138+
TOXENV=py35-awses_latest
139+
# CPython 3.6
140+
- python: 3.6
141+
env:
142+
TEST_VECTOR_HANDLERS=1
143+
TOXENV=py36-awses_1.3.0
144+
- python: 3.6
145+
env:
146+
TEST_VECTOR_HANDLERS=1
147+
TOXENV=py36-awses_1.3.max
148+
- python: 3.6
149+
env:
150+
TEST_VECTOR_HANDLERS=1
151+
TOXENV=py36-awses_latest
152+
# CPython 3.7
153+
- python: 3.7
154+
env:
155+
TEST_VECTOR_HANDLERS=1
156+
TOXENV=py37-awses_1.3.0
157+
dist: xenial
158+
sudo: true
159+
- python: 3.7
160+
env:
161+
TEST_VECTOR_HANDLERS=1
162+
TOXENV=py37-awses_1.3.max
163+
dist: xenial
164+
sudo: true
165+
- python: 3.7
166+
env:
167+
TEST_VECTOR_HANDLERS=1
168+
TOXENV=py37-awses_latest
169+
dist: xenial
170+
sudo: true
171+
# Linters
172+
- python: 3.6
173+
env:
174+
TEST_VECTOR_HANDLERS=1
175+
TOXENV=bandit
176+
- python: 3.6
177+
env:
178+
TEST_VECTOR_HANDLERS=1
179+
TOXENV=readme
180+
# Pending buildout of docs
181+
#- python: 3.6
182+
# env:
183+
# TEST_VECTOR_HANDLERS=1
184+
# TOXENV=docs
185+
#- python: 3.6
186+
# env:
187+
# TEST_VECTOR_HANDLERS=1
188+
# TOXENV=doc8
189+
# Pending linting cleanup
190+
#- python: 3.6
191+
# env:
192+
# TEST_VECTOR_HANDLERS=1
193+
# TOXENV=flake8
194+
#- python: 3.6
195+
# env:
196+
# TEST_VECTOR_HANDLERS=1
197+
# TOXENV=pylint
198+
#- python: 3.6
199+
# env:
200+
# TEST_VECTOR_HANDLERS=1
201+
# TOXENV=flake8-tests
202+
#- python: 3.6
203+
# env:
204+
# TEST_VECTOR_HANDLERS=1
205+
# TOXENV=pylint-tests
97206
install: pip install tox
98-
script: tox
207+
script:
208+
- if [[ -n $TEST_VECTOR_HANDLERS ]]; then cd test_vector_handlers; fi
209+
- tox

test_vector_generator/README.rst

Whitespace-only changes.
File renamed without changes.

test_vector_handlers/README.rst

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#######################################
2+
aws-encryption-sdk test vector handlers
3+
#######################################
4+
5+
There modules provide handlers to be used to process existing, or generate new,
6+
test vectors based on test vector manifests.
7+
8+
***************
9+
Getting Started
10+
***************
11+
12+
Required Prerequisites
13+
======================
14+
15+
* Python 2.7 or 3.4+
16+
* aws-encryption-sdk
17+
18+
Use
19+
===
20+
21+
In addition to direct use of the library, some CLI tools are provided to simplify
22+
processing of common test manifest types.
23+
24+
Full Message Encrypt
25+
--------------------
26+
27+
Used to process an AWS Encryption SDK Full Message Encrypt manifest and produce
28+
a Full Message Decrypt manifest along with all corresponding plaintexts and ciphertexts.
29+
30+
.. code::
31+
32+
usage: awses-full-message-encrypt [-h] --output OUTPUT --input INPUT [--human]
33+
34+
Build ciphertexts and decrypt manifest from keys and encrypt manifests
35+
36+
optional arguments:
37+
-h, --help show this help message and exit
38+
--output OUTPUT Directory in which to store results
39+
--input INPUT Existing full message encrypt manifest
40+
--human Output human-readable JSON
41+
42+
43+
Full Message Decrypt
44+
--------------------
45+
46+
Used to process an AWS Encryption SDK Full Message Decrypt manifest to
47+
decrypt and verify all referenced ciphertexts.
48+
49+
.. code::
50+
51+
usage: awses-full-message-decrypt [-h] --input INPUT
52+
53+
Decrypt ciphertexts generated by awses-full-message-encrypt
54+
55+
optional arguments:
56+
-h, --help show this help message and exit
57+
--input INPUT Existing full message decrypt manifest
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
attrs >= 17.4.0
2+
aws-encryption-sdk
23
six
File renamed without changes.
File renamed without changes.

test_vector_generator/src/awses_test_vectors/__init__.py renamed to test_vector_handlers/src/awses_test_vectors/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
13-
__version__ = "0.0.0"
13+
__version__ = "1.0.0"

test_vector_generator/src/awses_test_vectors/commands/full_message_decrypt.py renamed to test_vector_handlers/src/awses_test_vectors/commands/full_message_decrypt.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ def cli(args=None):
2828
# type: (Optional[Iterable[str]]) -> None
2929
"""CLI entry point for processing AWS Encryption SDK Decrypt Message manifests."""
3030
parser = argparse.ArgumentParser(description="Decrypt ciphertexts generated by awses-full-message-encrypt")
31-
parser.add_argument("--input", type=argparse.FileType("r"), help="Existing full message decrypt manifest")
31+
parser.add_argument(
32+
"--input", required=True, type=argparse.FileType("r"), help="Existing full message decrypt manifest"
33+
)
3234

3335
parsed = parser.parse_args(args)
3436

0 commit comments

Comments
 (0)