[SERVER-41370] Handle AWS KMS errors cleanly for FLE shell Created: 29/May/19  Updated: 29/Oct/23  Resolved: 03/Jun/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.1.14

Type: Bug Priority: Major - P3
Reporter: Shreyas Kalyan Assignee: Roxane Fruytier (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Security 2019-06-03
Participants:
Linked BF Score: 0

 Description   

Currently, KMS errors return an IDL parsing error, which is not a useful message to the user.



 Comments   
Comment by Githook User [ 03/Jun/19 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-41370 Fix duplicate error codes
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/04e387e5af8efab4fab32992ed1e9529550f7286

Comment by Githook User [ 03/Jun/19 ]

Author:

{'name': 'Roxane', 'email': 'roxane.fruytier@10gen.com'}

Message: SERVER-41370 Made cleaner errors that handles AWS KMS errors for FLE shell
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/d80595970623666f380d9213fda2928ba8d52ac8

Comment by Mark Benvenuto [ 30/May/19 ]

When a JSON response is received from AWS, it may either be the expected response or an error. Errors are returned as

{
  __type : string,
  message: string,
}

We should first check if a response is an error by testing the JSON response for the existence of "__type" field and if it is an error, decode it as an error message and then raise it as a uassert.

Generated at Thu Feb 08 04:57:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.