Build API: Implement validate_only calls.
Add validate-only support to all existing endpoints and
tests to enforce the setting is respected.
Add is_in validator to help transition some endpoints
to decorator-only validation.
Some cleanup and standardization in the controller tests.
BUG=chromium:987263
TEST=run_tests
Cq-Depend: chromium:1726252
Change-Id: I108dfc1a221847eae47a18f2f60e12d2575c9ea8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1726253
Reviewed-by: David Burger <dburger@chromium.org>
Commit-Queue: Alex Klein <saklein@chromium.org>
Tested-by: Alex Klein <saklein@chromium.org>
diff --git a/api/controller/__init__.py b/api/controller/__init__.py
index 6c70f00..0bfe831 100644
--- a/api/controller/__init__.py
+++ b/api/controller/__init__.py
@@ -17,3 +17,9 @@
# Notes the endpoint completed via a well handled path, but the result was not
# a successful execution of the endpoint.
RETURN_CODE_COMPLETED_UNSUCCESSFULLY = 3
+
+
+# Validate only request successfully validated.
+RETURN_CODE_VALID_INPUT = 0
+# Validate only request did not pass validation.
+RETURN_CODE_INVALID_INPUT = 1