Skip to content

Commit

Permalink
rest: Prevent unlisted filterable properties from being used (fix #594)
Browse files Browse the repository at this point in the history
  • Loading branch information
arteymix committed Mar 7, 2023
1 parent 659882e commit 29876c9
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ Filters getFilters( FilteringService<O> service ) throws MalformedArgException {
String property = subClause.PROPERTY().getText();
ubic.gemma.persistence.util.Filter.Operator operator;
try {
if ( !service.getFilterableProperties().contains( property ) ) {
throw new IllegalArgumentException( String.format( "The property of %s is unknown", property ) );
}
if ( subClause.operator() != null ) {
operator = operatorToOperator( subClause.operator() );
String requiredValue = scalarToString( subClause.scalar() );
Expand Down

0 comments on commit 29876c9

Please sign in to comment.