q Query enhancements
#1670
Replies: 4 comments 13 replies
-
|
fwiw, I'd always thought full-text meant "I have no idea what tags/parameters to use, so just find me anything mentioning then again, I don't actually use this stuff. |
Beta Was this translation helpful? Give feedback.
-
|
To me, this is a validation problem, similar to preventing SQL injection attacks. We know what our operators are, and we know our users want to perform a full-text search. Therefore, we need to escape all of our operators as a part of validating the user input so that the backend doesn't misinterpret a full-text search for a filter. Instead of this: That If we simply replace every |
Beta Was this translation helpful? Give feedback.
-
2. Loosen a bit
|
Beta Was this translation helpful? Give feedback.
-
|
@jcrossley3 your input made me think that while it is true that new releases should not break previously working client, that should not stop us to gradually introduce enhancements in the long term. What would you say if we gradually move fields defined within would become: Notice that both Query parameters are outside of The only design rule would be to name the query parameters according to what operator we will apply. E.g. Just like we use in sorting
I know the easiest answer will be NO. But just sharing here in case it might help in the future. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
@jcrossley3 as promised here we go. In our internal chat I mentioned I wanted to propose 3 changes. This is one of them. I will create 2 separate discussions, or add the other points as comments in this same discussion. But be patient with me.
1. Full text search
Context:
Let's assume we have 2 Advisories (I changed the identifier of those files manually)
Current status:
qis defined asq={full_text_string}&{other_operators}CVE-1then we doq=CVE-1document_idis actually the stringdocument_id=CVE-1. In this case the query the client will create isq=document_id=CVE-1qperfectly matches the name of the second Advisory and this is a problemProblem
If
qis defined asq={full_text_string}&{other_operators}what defines{full_text_string}is actually unknown as there isn't a way to tell whether{full_text_string}was actually a string the client wanted to search by or it was a set of operations like{field}{operator}{value}I manipulated the content of the Advisory and injected a valid query in the name of the Advisory. In cases like "Labels" where users can actually write whatever they want then we might increase the risk of these errors.
This was also already reported by QE https://issues.redhat.com/browse/TC-2399 although I think we never went deep enough to uncover it.
Screencast.From.2025-05-29.17-50-24.mp4
Proposal
If q is defined as
q={full_text_string}&{other_operators}then{full_text_string}is actually breaking the whole principle of{field}{operator}{value}. We could take 2 strategies:First proposal. Make
{full_text_string}a key value pair within theqdefinition. E.g.q=full_text={full_text_string}&{other_operators}. Here is a more concrete example.q=full_text='document_id=CVE-1'&creation=yesterday. Notice that now it is clear thatfull_texthas a value that is a string and cannot be confused by an actual operator. I added single quotes for our human eyes to see the difference but the implementation might or might not contain it. Actually quotes for string is another problem I will describe further down this document.Second proposal. Extract
{full_text_string}out of theqdefinition E.g.full_text=any_Value&q=all_q_definition. A more concrete example will be:In both previous proposals the full search feature needs a key value operation.
Impact
Full text search is something mainly our UI uses for now. I have no prove but I am inclined to think that the CAMP team uses more the
qdefinition as{field}{operator}{value}rather than full text search since it is done more for discovery.Unless we find a better way of dealing with the problem I described we will need to accept that our
qneeds to change a bit to avoid those errors.Beta Was this translation helpful? Give feedback.
All reactions