* feat(chalice): upgraded dependencies * feat(chalice): changed path analysis schema * feat(DB): click coordinate support * feat(chalice): changed path analysis issues schema feat(chalice): upgraded dependencies * fix(chalice): fixed pydantic issue * refactor(chalice): refresh token validator * feat(chalice): role restrictions * feat(chalice): EE path analysis changes * refactor(DB): changed creation queries refactor(DB): changed delte queries feat(DB): support new path analysis payload * feat(chalice): save path analysis card * feat(chalice): restrict access * feat(chalice): restrict access * feat(chalice): EE save new path analysis card * refactor(chalice): path analysis * feat(chalice): path analysis new query * fix(chalice): configurable CH config * fix(chalice): assist autocomplete * refactor(chalice): refactored permissions * refactor(chalice): changed log level * refactor(chalice): upgraded dependencies * refactor(chalice): changed path analysis query * refactor(chalice): changed path analysis query * refactor(chalice): upgraded dependencies refactor(alerts): upgraded dependencies refactor(crons): upgraded dependencies * feat(chalice): path analysis ignore start point * feat(chalice): path analysis in progress * refactor(chalice): path analysis changed link sort * refactor(chalice): path analysis changed link sort * refactor(chalice): path analysis changed link sort * refactor(chalice): path analysis new query refactor(chalice): authorizers * refactor(chalice): refactored authorizer * fix(chalice): fixed create card of PathAnalysis * refactor(chalice): compute link-percentage for Path Analysis * refactor(chalice): remove null starting point from Path Analysis * feat(chalice): path analysis CH query * refactor(chalice): changed Path Analysis links-value fix(chalice): fixed search notes for EE * feat(chalice): path analysis enhanced query results * feat(chalice): include timezone in search sessions response * refactor(chalice): refactored logs * refactor(chalice): refactored logs feat(chalice): get path analysis issues
29 lines
715 B
Python
29 lines
715 B
Python
import logging
|
|
|
|
import requests
|
|
from decouple import config
|
|
|
|
from chalicelib.utils import helper
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def __get_captcha_config():
|
|
return config("captcha_server"), config("captcha_key")
|
|
|
|
|
|
def is_valid(response):
|
|
if not helper.allow_captcha():
|
|
logger.info("!! Captcha is disabled")
|
|
return True
|
|
url, secret = __get_captcha_config()
|
|
r = requests.post(url=url, data={"secret": secret, "response": response})
|
|
if r.status_code != 200:
|
|
logger.warning("something went wrong")
|
|
logger.error(r)
|
|
logger.warning(r.status_code)
|
|
logger.warning(r.text)
|
|
return
|
|
r = r.json()
|
|
logger.debug(r)
|
|
return r["success"]
|