aws / aws/aws-encryption-sdk-cli

commitment_policy not set correctly in stream_kwargs_from_args

Open
#388 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
82
Forks
42
PR merge metrics
No merged PRs in 30d

Description

## General:
commitment_policy not set correctly in `stream_kwargs_from_args`.

## Problem:
These [if statements](https://github.com/aws/aws-encryption-sdk-cli/blob/773919c75eec4d3a0565b24a1f877c0e5caf3fd5/src/aws_encryption_sdk_cli/__init__.py#L251-L255) does not take effect.

LHS of Line 251 has type ``, while RHS is a `str`. On my machine (python ver3.7), two types won't equal no matter what.
```python
print(type(args.commitment_policy))
#

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

## Solution
The above-mentioned [if statements](https://github.com/aws/aws-encryption-sdk-cli/blob/773919c75eec4d3a0565b24a1f877c0e5caf3fd5/src/aws_encryption_sdk_cli/__init__.py#L249-L256) 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](https://github.com/aws/aws-encryption-sdk-cli/blob/773919c75eec4d3a0565b24a1f877c0e5caf3fd5/src/aws_encryption_sdk_cli/__init__.py#L169-L178)

## My Platform
```shell
$ 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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.