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.33k stars 128 forks source link

Fix search with aliased table #602

Closed Zhaars closed 1 year ago

Zhaars commented 1 year ago

Bug fixing related to mapping aliased table with config during searchable encryption table filtering.

In the queries like select ... from some_table as alias where searchable_col = value if the some_table is in encryptor config and searchable_col is not aliased column, Acra panic as default table remains nil and uninitialized. So that the main filtering logic was rewritten and is now based on findColumnInfo method that find table name depending on aliased or non-aliased tables in FROM statement and data from encryptor config.

Checklist

Zhaars commented 1 year ago

is it faster or slower than existing solution?

Conceptually, it is the same solution, moreover deleted redundant stuff.