Open kpiwko opened 6 years ago
@michaelkleinhenz added team planner. Please correct if wrong.
I'm not sure this is a Planner issue. It might be in the Work Item Tracker but I'm not sure who owns spaces
on the backend.
Does anyone think we should attempt to catch/prevent this in the UI? I know it needs to be dealt with in the backend for security reasons.
@aslakknutsen @bartoszmajsak
Issue Overview
Endpoint
/api/search/spaces
provides parameterq
. However, this parameter is very confusing as_
is a reserved character in LIKE parameter and escape rules are needed to be provided by user.Expected Behaviour
User can provide text in human readable / expected format, e.g. a search for space named 'OpenShift_io'
Current Behaviour
User need to escape accordingly to PostgreSQL rules https://www.postgresql.org/docs/7.3/static/functions-matching.html which is an implementation detail.
Steps To Reproduce
curl -sX GET 'https://api.openshift.io/api/search/spaces?q=OpenShift_io' | json | grep -A5 -B5 Agile
finds nothingcurl -sX GET 'https://api.openshift.io/api/search/spaces?q=OpenShift\_io' | json | grep -A5 -B5 Agile
finds the right spaceAdditional Information
There is a mixed usage of LIKE and ILIKE in the code base. Looks like usage can be standardized
Gorm is preventing SQL injection if user input is provided as a parameter, that's good.
'*' as possible 'search all' option is not mentioned anywhere in the doc.