def processSearchRequestSession(session,
                                acsrf,
                                search_string,
                                psc_pattern,
                                clientData,
                                numRows=LIMIT_NUM_MATCHING_TRANSACTIONS):
    global P3APISALT

    PriceHistoryAuth.LogActivity.logDebugInfo(
        "processSearchRequestSession fired:" + repr(session))

    if (P3APISALT is None):
        P3APISALT = os.environ.get("P3APISALT")


# Here we need to use session and acsrf
    if (not PriceHistoryAuth.auth.is_valid_acsrf(session, acsrf)):
        PriceHistoryAuth.LogActivity.logDebugInfo("not valid:" +
                                                  repr(session) + repr(acsrf))
        dict = {0: {"status": "BadAuthentication"}}
        logger.error('Bad Authentication Request ' + repr(session))
        return dict
    search_string = convertSearchStringToLegalPattern(search_string)
    psc_pattern = convertPSCToLegalPattern(psc_pattern)

    if (numRows is None):
        numRows = LIMIT_NUM_MATCHING_TRANSACTIONS
    result = searchApiSolr(URLToSolr, PathToDataFiles, search_string,
                           psc_pattern, numRows)
    if clientData:
        result["clientdata"] = clientData
    return result
Beispiel #2
0
def processSearchRequest(user,password,search_string,
                         psc_pattern,numRows = LIMIT_NUM_MATCHING_TRANSACTIONS):
    if (not auth.does_authenticate(user,password)):
        dict = {0: {"status": "BadAuthentication"}}
        return dict;
    search_string = convertSearchStringToLegalPattern(search_string);
    psc_pattern = convertPSCToLegalPattern(psc_pattern);

    if (numRows is None):
        numRows = LIMIT_NUM_MATCHING_TRANSACTIONS;
    return searchApiSolr(URLToSolr,PathToDataFiles,search_string,psc_pattern,numRows)
Beispiel #3
0
def processSearchRequest(user, password, search_string, psc_pattern, numRows=LIMIT_NUM_MATCHING_TRANSACTIONS):
    global P3APISALT
    if P3APISALT is None:
        P3APISALT = os.environ.get("P3APISALT")
    if not P3Auth.auth.does_authenticate(user, password, P3APISALT):
        dict = {0: {"status": "BadAuthentication"}}
        logger.error("Bad Authentication Request " + repr(user))
        return dict
    search_string = convertSearchStringToLegalPattern(search_string)
    psc_pattern = convertPSCToLegalPattern(psc_pattern)

    if numRows is None:
        numRows = LIMIT_NUM_MATCHING_TRANSACTIONS
    return searchApiSolr(URLToSolr, PathToDataFiles, search_string, psc_pattern, numRows)
def processSearchRequest(user,password,search_string,
                         psc_pattern,remote_addr,numRows = LIMIT_NUM_MATCHING_TRANSACTIONS):
    global P3APISALT
    if (P3APISALT is None):
        P3APISALT=os.environ.get("P3APISALT")
    if (not P3Auth.auth.does_authenticate(user,password,P3APISALT,remote_addr)):
        dict = {0: {"status": "BadAuthentication"}}
        logger.error('Bad Authentication Request '+ repr(user))
        return dict;
    search_string = convertSearchStringToLegalPattern(search_string);
    psc_pattern = convertPSCToLegalPattern(psc_pattern);

    if (numRows is None):
        numRows = LIMIT_NUM_MATCHING_TRANSACTIONS;
    return searchApiSolr(URLToSolr,PathToDataFiles,search_string,psc_pattern,numRows)
Beispiel #5
0
def processSearchRequest(user,password,search_string,
                         psc_pattern,clientData,numRows = LIMIT_NUM_MATCHING_TRANSACTIONS):
    global P3APISALT
    if (P3APISALT is None):
        P3APISALT=os.environ.get("P3APISALT")
    if (not PriceHistoryAuth.auth.does_authenticate(user,password,P3APISALT)):
        dict = {0: {"status": "BadAuthentication"}}
        logger.error('Bad Authentication Request '+ repr(user))
        return dict;
    search_string = convertSearchStringToLegalPattern(search_string);
    psc_pattern = convertPSCToLegalPattern(psc_pattern);

    if (numRows is None):
        numRows = LIMIT_NUM_MATCHING_TRANSACTIONS;
    result = searchApiSolr(URLToSolr,PathToDataFiles,search_string,psc_pattern,numRows)
    if clientData:
        result["clientdata"] = clientData
    return result
Beispiel #6
0
def processSearchRequestSession(session, acsrf, search_string, psc_pattern, numRows=LIMIT_NUM_MATCHING_TRANSACTIONS):
    global P3APISALT

    P3Auth.LogActivity.logDebugInfo("processSearchRequestSession fired:" + repr(session))

    if P3APISALT is None:
        P3APISALT = os.environ.get("P3APISALT")
    # Here we need to use session and acsrf
    if not P3Auth.auth.is_valid_acsrf(session, acsrf):
        P3Auth.LogActivity.logDebugInfo("not valid:" + repr(session) + repr(acsrf))
        dict = {0: {"status": "BadAuthentication"}}
        logger.error("Bad Authentication Request " + repr(session))
        return dict
    search_string = convertSearchStringToLegalPattern(search_string)
    psc_pattern = convertPSCToLegalPattern(psc_pattern)

    if numRows is None:
        numRows = LIMIT_NUM_MATCHING_TRANSACTIONS
    return searchApiSolr(URLToSolr, PathToDataFiles, search_string, psc_pattern, numRows)
Beispiel #7
0
def processSearchRequestSession(session,acsrf,search_string,
                         psc_pattern,clientData,numRows = LIMIT_NUM_MATCHING_TRANSACTIONS):
    global P3APISALT

    PriceHistoryAuth.LogActivity.logDebugInfo("processSearchRequestSession fired:"+repr(session))

    if (P3APISALT is None):
        P3APISALT=os.environ.get("P3APISALT")
# Here we need to use session and acsrf
    if (not PriceHistoryAuth.auth.is_valid_acsrf(session,acsrf)):
        PriceHistoryAuth.LogActivity.logDebugInfo("not valid:"+repr(session)+repr(acsrf))
        dict = {0: {"status": "BadAuthentication"}}
        logger.error('Bad Authentication Request '+ repr(session))
        return dict;
    search_string = convertSearchStringToLegalPattern(search_string);
    psc_pattern = convertPSCToLegalPattern(psc_pattern);

    if (numRows is None):
        numRows = LIMIT_NUM_MATCHING_TRANSACTIONS;
    result = searchApiSolr(URLToSolr,PathToDataFiles,search_string,psc_pattern,numRows)
    if clientData:
        result["clientdata"] = clientData
    return result;
def processSearchRequest(user,
                         password,
                         search_string,
                         psc_pattern,
                         clientData,
                         numRows=LIMIT_NUM_MATCHING_TRANSACTIONS):
    global P3APISALT
    if (P3APISALT is None):
        P3APISALT = os.environ.get("P3APISALT")
    if (not PriceHistoryAuth.auth.does_authenticate(user, password,
                                                    P3APISALT)):
        dict = {0: {"status": "BadAuthentication"}}
        logger.error('Bad Authentication Request ' + repr(user))
        return dict
    search_string = convertSearchStringToLegalPattern(search_string)
    psc_pattern = convertPSCToLegalPattern(psc_pattern)

    if (numRows is None):
        numRows = LIMIT_NUM_MATCHING_TRANSACTIONS
    result = searchApiSolr(URLToSolr, PathToDataFiles, search_string,
                           psc_pattern, numRows)
    if clientData:
        result["clientdata"] = clientData
    return result