Skip to content

Commit

Permalink
Reject spaces in execution keys (#2802)
Browse files Browse the repository at this point in the history
* Dont allow spaces in execution keys

Dont allow spaces in execution keys

* Update ServiceParseTreeWalker.java
  • Loading branch information
Yasirmod17 authored Apr 24, 2024
1 parent 6208120 commit f2c2be1
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,10 @@ private SingleExecutionParameters visitSingleExecutionParameters(ServiceParserGr
SingleExecutionParameters singleExecParams = new SingleExecutionParameters();
singleExecParams.sourceInformation = walkerSourceInformation.getSourceInformation(ctx);
singleExecParams.key = PureGrammarParserUtility.fromIdentifier(ctx.identifier());
if (singleExecParams.key.contains(" "))
{
throw new EngineException("Execution param key cannot contain spaces. Invalid Key: " + singleExecParams.key, singleExecParams.sourceInformation, EngineErrorType.PARSER);
}
ServiceParserGrammar.ServiceMappingContext mappingContext = PureGrammarParserUtility.validateAndExtractRequiredField(Collections.singletonList(ctx.serviceMapping()), "mapping", singleExecParams.sourceInformation);
singleExecParams.mapping = PureGrammarParserUtility.fromQualifiedName(mappingContext.qualifiedName().packagePath() == null ? Collections.emptyList() : mappingContext.qualifiedName().packagePath().identifier(), mappingContext.qualifiedName().identifier());
singleExecParams.mappingSourceInformation = walkerSourceInformation.getSourceInformation(mappingContext.qualifiedName());
Expand Down

0 comments on commit f2c2be1

Please sign in to comment.