예제 #1
0
파일: api.py 프로젝트: chiehwen/HoneyProxy
 def auth_func(self, request, *args, **kwargs):
     token = "invalid"
     if "token" in request.args:
         token = request.args["token"] 
     elif request.requestHeaders.hasHeader("X-Request-Token"):
         token = request.requestHeaders.getRawHeaders("X-Request-Token",[None])[0]
     if token == HoneyProxy.getApiAuthToken():
         return f(self, request, *args, **kwargs)
     else:
         return ForbiddenResource(message="Invalid response Token").render(request)
예제 #2
0
 def auth_func(self, request, *args, **kwargs):
     token = "invalid"
     if "token" in request.args:
         token = request.args["token"]
     elif request.requestHeaders.hasHeader("X-Request-Token"):
         token = request.requestHeaders.getRawHeaders(
             "X-Request-Token", [None])[0]
     if token == HoneyProxy.getApiAuthToken():
         return f(self, request, *args, **kwargs)
     else:
         return ForbiddenResource(
             message="Invalid response Token").render(request)
예제 #3
0
파일: api.py 프로젝트: chiehwen/HoneyProxy
 def render_GET(self, request):
     return json.dumps({"token": HoneyProxy.getApiAuthToken()})
예제 #4
0
 def render_GET(self, request):
     return json.dumps({"token": HoneyProxy.getApiAuthToken()})