-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPE if reading record without a amzn-ddb-map-desc #123
Comments
It should not throw an error and should read the document correctly.
This causes the document to be saved without NOW evolution happens and developer need to save an extra attribute
Now new document will be saved with BUT Now we will not be able to read the previously saved document. |
Hi @bhuvangu, Thank you for providing an additional use case where this NPE shows up. I have confirmed this behavior on my end, and I agree it should be considered a bug. According to our documentation, adding a new field in this way should work (this is equivalent to first configuring the data with @DoNotTouch on every field, then adding a new field). We need to further investigate what the best way to fix this is, however I think it will involve updating the logic here to also recognize if |
Hi @lavaleri
It will still not help in the case mentioned above, as I think in order to keep it backward compatible and fix this bug, we can add a param in DynamoDBMapperConfig as
How does it look , will raise pull request if the idea looks convincing. |
Hi @bhuvangu, Thanks for your suggestion. It looks like that approach would work, however I would prefer to fix the underlying issue without adding new modes of operation to our API. To clarify what I meant for the fix: On entering decryptRecord we have |
hi @lavaleri , |
As of #152 we have fixed one bug where an NPE pops up due to a missing signature/matdesc field in the case of upgrading from a "DoNotTouch" schema. The specific NPE thrown at https://github.com/aws/aws-dynamodb-encryption-java/blob/master/sdk1/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/encryption/providers/DirectKmsMaterialProvider.java#L126 is still an issue in that we should instead throw an In order to not introduce breaking changes for customers who are not using KMS providers, I think the solution for this will be to check specifically for a null value in the KMS provider and throw the appropriate error. |
This line throws a null pointer exception if you attempt to decrypt a record where the amzn-ddb-map-desc attribute has been manually removed: https://github.com/aws/aws-dynamodb-encryption-java/blob/master/sdk1/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/encryption/providers/DirectKmsMaterialProvider.java#L126
We should check this earlier and throw a more useful exception.
The text was updated successfully, but these errors were encountered: