def validateGetByUserResponse(responsedata):
    if 'body' not in responsedata.keys():
        return lib_common_http.getBadRequestErrorResponse()

    if 'employees' not in responsedata['body'].keys():
        return lib_common_http.getBadRequestErrorResponse()

    return 0
def validateGetByUserRequest(requestdata):
    if 'data' not in requestdata.keys():
        return lib_common_http.getBadRequestErrorResponse()

    if 'user' not in requestdata['data'].keys():
        return lib_common_http.getBadRequestErrorResponse()

    return 0
Beispiel #3
0
def validateToken(requestdata):
    if 'data' not in requestdata.keys():
        return lib_common_http.getBadRequestErrorResponse()
        
    if 'token' not in requestdata['data'].keys():
        return lib_common_http.getBadRequestErrorResponse()
    
    if (requestdata['data']['token']!=env_token):
        return lib_common_http.getAuthErrorResponse()

    return 0
Beispiel #4
0
def validateGetPackageResponse(responsedata):
    if 'body' not in responsedata.keys():
        return lib_common_http.getBadRequestErrorResponse()

    if 'package' not in responsedata['body'].keys():
        return lib_common_http.getBadRequestErrorResponse()

    if 'id' not in responsedata['body']['package'].keys():
        return lib_common_http.getBadRequestErrorResponse()

    if 'user' not in responsedata['body']['package'].keys():
        return lib_common_http.getBadRequestErrorResponse()

    if 'package' not in responsedata['body']['package'].keys():
        return lib_common_http.getBadRequestErrorResponse()

    return 0
def validatePackageRequest(requestdata):
    if 'data' not in requestdata.keys():
        return lib_common_http.getBadRequestErrorResponse()
    if 'package' not in requestdata['data'].keys():
        return lib_common_http.getBadRequestErrorResponse()
    return 0