Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Snarr
Copy link
Member

@Snarr Snarr commented Feb 20, 2025

Checks RunWfRequest wf_run_id against the LHUtil.isValidLHName() method in both the API layer and the process layer.

Resolves #1315

@Snarr Snarr changed the title fix(server): Reject invalid wf_spec_name in RunWfRequest fix(server): Reject invalid wf_run_id in RunWfRequest Feb 21, 2025
Copy link
Member

@coltmcnealy-lh coltmcnealy-lh left a 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

throw new LHApiException(Status.INVALID_ARGUMENT, "Missing required parameter 'wf_spec_name'");
}

if (!req.getId().equals("") && !LHUtil.isValidLHName(req.getId())) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't check for req.getId().equals(""). Instead, use the protobuf optional capability which checks for presence of the string. The way to do that is: req.hasId().

I would also suggest adding this:

if (req.hasId() && req.getId().equals("")) throw new LHApiException(...);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reject RunWf requests with underscores in the WfRunId
2 participants