collegevine / collegevine/confcrypt

Unable to store empty strings as values

Open
#37 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
3
Forks
3
PR merge metrics
No merged PRs in 30d

Description

This happens because AWS refuses to encrypt empty payloads:

```
λ confcrypt aws add -n FOO -v "" -t String -p -k .econf

confcrypt: ServiceError (ServiceError' {
_serviceAbbrev = Abbrev "KMS",
_serviceStatus = Status {statusCode = 400, statusMessage = "Bad Request"},
_serviceHeaders = [("x-amzn-RequestId","e68c2e4a-791c-4920-97e2-f4778afa963a"),("Cache-Control","no-cache, no-store, must-revalidate, private"),("Expires","0"),("Pragma","no-cache"),("Date","Tue, 19 Jan 2021 17:11:04 GMT"),("Content-Type","application/x-amz-json-1.1"),("Content-Length","175")],
_serviceCode = ErrorCode "Validation",
_serviceMessage = Just (ErrorMessage "1 validation error detected: Value at 'plaintext' failed to satisfy constraint: Member must have length greater than or equal to 1"),
_serviceRequestId = Just (RequestId "e68c2e4a-791c-4920-97e2-f4778afa963a")
})
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start from the `confcrypt aws add` entry point and trace how the `-v ""` value is passed to AWS KMS. Reproduce the command shown in the issue, then verify that an empty String value can be stored successfully without the KMS validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, haskell
Domain
cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.