-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(server): Reject invalid wf_run_id
in RunWfRequest
#1321
Conversation
wf_spec_name
in RunWfRequest
wf_run_id
in RunWfRequest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-emptively approving with a comment to address
server/src/main/java/io/littlehorse/server/LHServerListener.java
Outdated
Show resolved
Hide resolved
@eduwercamacaro Could you take a look at this and let me know what you think of the test? |
throw new LHApiException(Status.INVALID_ARGUMENT, "Missing required argument 'wf_spec_name'"); | ||
} | ||
|
||
if (id != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if id is an attribute you can make a method this.isIdValid()
also yo can use Strings.isNullOrEmpty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, I implemented the isIdValid
method.
I am not sure if Strings.isNullOrEmpty
would apply here, since the id
can be null but shouldn't be an empty string. Null implies that the id
wasn't set, but empty string implies that someone tried to set the id
with no value.
Checks
RunWfRequest
wf_run_id
against theLHUtil.isValidLHName()
method in both the API layer and the process layer.Resolves #1315