-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Queryable Encryption
-
None
-
Server Security
Reasoning/Need:
Now that we're adding Range, a single field could be associated with multiple encrypted indices–in particular, both Range and Equality. So, when a field is being analyzed in an FLE2 supported queries context, that field could be associated with a set of queries. And, thus, every member of that query set should be checked (i.e., confirm that it's a currently supported type).
The critical change begins in resolved_encryption_info.h by changing:
stdx::variant<FleAlgorithmEnum, Fle2AlgorithmInt> algorithm;
TO:
stdx::variant<FleAlgorithmEnum, std::set<Fle2AlgorithmInt>> algorithm;
(unless a better type has been determined).
Details:
Main files:
resolved_encryption_info.cpp & resolved_encryption_info.h (src>mongo>db>modules>enterprise>src>fle>query_analysis)
Notes:
Examples of functions that will likely need to be modified (in resolved_encryption_info.cpp):
- ResolvedEncryptionInfo constructor. E.g.,:
-
- initialize algorithm as something like std::set<Fle2AlgorithmInt> algorithm;
- would then set to default kUnindexed IF the set is empty before type checking at the end of the constructor
- instead of algorithm = Fle2AlgorithmInt::kRange, would use something like algorithm.insert(Fle2AlgorithmInt::kEquality)
- initialize algorithm as something like std::set<Fle2AlgorithmInt> algorithm;
- algorithmIs(Fle2AlgorithmInt fle2Alg)
- instead of the current get_if<FleAlgorithmEnum>
- do something like: ...get_if<std::set<Fle2AlgorithmInt>>...