You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the LittleHorse Server, we often validate request fields at the #process method level, which runs after a record has been forwarded to the CommandProcessor. However, often times a request can be rejected earlier at the API level.
The above protobuf message defines a request for RPC RunWf on the LittleHorse Server. While not specified in the protobuf contract (because required is not recommended in proto3), a RunWfRequest requires a wf_spec_name to function. We can save time and resources by validating that a RunWfRequest sent to the server has a valid wf_spec_name at the API level, and rejecting any requests that don't.
Here are some discussion questions to get the conversation started:
Do we need to perform the validation twice, once at the API level and once at the processor level? If so, why?
What other LittleHorse Server RPC services can we apply this "API Level" validation to?
Should "API Level" validations introspect on objects and resources within the LittleHorse Server? Ex: Check if the wf_spec_name exists within the server, reject unknown wf_spec_names at the API level
Is there any way to co-locate the validation logic between the API level and the processor level? As of PR fix(server): Reject invalid wf_run_id in RunWfRequest #1321, the validation logic is split between the two levels and needs to be updated in both places when changes are made.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In the LittleHorse Server, we often validate request fields at the
#process
method level, which runs after a record has been forwarded to the CommandProcessor. However, often times a request can be rejected earlier at the API level.Example
The above protobuf message defines a request for
RPC RunWf
on the LittleHorse Server. While not specified in the protobuf contract (becauserequired
is not recommended in proto3), aRunWfRequest
requires awf_spec_name
to function. We can save time and resources by validating that aRunWfRequest
sent to the server has a validwf_spec_name
at the API level, and rejecting any requests that don't.API Level Validation
Discussion
Here are some discussion questions to get the conversation started:
wf_spec_name
exists within the server, reject unknownwf_spec_name
s at the API levelwf_run_id
inRunWfRequest
#1321, the validation logic is split between the two levels and needs to be updated in both places when changes are made.Beta Was this translation helpful? Give feedback.
All reactions