cossacklabs / acra

Database security suite. Database proxy with field-level encryption, search through encrypted data, SQL injections prevention, intrusion detection, honeypots. Supports client-side and proxy-side ("transparent") encryption. SQL, NoSQL.
https://www.cossacklabs.com/acra/
Apache License 2.0
1.35k stars 128 forks source link

Add db-specific error #521

Closed G1gg1L3s closed 2 years ago

G1gg1L3s commented 2 years ago

One of the last PRs added support for type awareness. That allows defining types on values, which would be decrypted and returned from Acra, like string or int. It also added default values field in configs, which allows to specify which value to return, if some error (possibly decryption error) occurs.

This PR adds ability to chose, which action should be performed on (decryption) failure: either to return client specific error, like acra censor already can, or return default value.

Default action, if type awareness is enabled, is "error". The user can specify the "default" case together with a default value.

Checklist