aws / aws-encryption-sdk-cli

CLI wrapper around aws-encryption-sdk-python
Apache License 2.0
80 stars 39 forks source link

commitment_policy not set correctly in stream_kwargs_from_args #388

Open zanhua-aws opened 1 year ago

zanhua-aws commented 1 year ago

General:

commitment_policy not set correctly in stream_kwargs_from_args.

Problem:

These if statements does not take effect.

LHS of Line 251 has type <enum 'CommitmentPolicyArgs'>, while RHS is a str. On my machine (python ver3.7), two types won't equal no matter what.

print(type(args.commitment_policy))
# <enum 'CommitmentPolicyArgs'>

print(CommitmentPolicyArgs.REQUIRE_ENCRYPT_REQUIRE_DECRYPT == "require-encrypt-require-decrypt")
# False

Solution

The above-mentioned if statements should be deleted because

  1. currently they toke no effect
  2. stream_args will not accept "commitment_policy" as a key word.
  3. CommitmentPolicy are handled correctly in process_cli_request

My Platform

$ python
Python 3.7.16 (default, Mar 10 2023, 03:25:26)
[GCC 7.3.1 20180712 (Red Hat 7.3.1-15)] on linux
Type "help", "copyright", "credits" or "license" for more information.

$ aws-encryption-cli --version
aws-encryption-sdk-cli/4.2.0 aws-encryption-sdk/3.1.1