toolchain: validate inputs for GetClippyLints

This CL implements input validation for the GetClippyLint endpoint in
the toolchain Build API service. Getting a lint requires a sysroot be
provided with a path, so we require this field in the input_proto.

BUG=b:188589668
TEST=api/contrib/call_scripts

Change-Id: I67f428eeb8553d04f5e77c83a41cfd46a0b1f068
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2999428
Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org>
Reviewed-by: Sergey Frolov <sfrolov@google.com>
diff --git a/api/controller/toolchain.py b/api/controller/toolchain.py
index 514a805..00b412a 100644
--- a/api/controller/toolchain.py
+++ b/api/controller/toolchain.py
@@ -376,7 +376,9 @@
   return findings_protos
 
 
-# TODO(b/188589668): add input validation
+@validate.exists('sysroot.path')
+@validate.require('packages')
+@validate.validation_complete
 def GetClippyLints(input_proto, output_proto, _config):
   """Emerges the given packages and retrieves any findings from Cargo Clippy."""
   chroot_util.Emerge(