Fix schema for Task.runtime

Add infrastructure for API calls limits handling
This commit is contained in:
allegroai
2021-05-03 18:11:46 +03:00
parent add3f011a0
commit 27d086bca2
4 changed files with 52 additions and 28 deletions

View File

@@ -14,17 +14,9 @@ from .errors import CallParsingError
log = config.logger(__file__)
def validate_all(call: APICall, endpoint: Endpoint):
def validate_data(call: APICall, endpoint: Endpoint):
""" Perform all required call/endpoint validation, update call result appropriately """
try:
validate_auth(endpoint, call)
validate_role(endpoint, call)
if validate_impersonation(endpoint, call):
# if impersonating, validate role again
validate_role(endpoint, call)
# todo: remove vaildate_required_fields once all endpoints have json schema
validate_required_fields(endpoint, call)