Skip to content

Commit

Permalink
Added ip whitelist to local ip address
Browse files Browse the repository at this point in the history
  • Loading branch information
qtsathish committed Dec 14, 2021
1 parent 8992d61 commit 0499fe5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion InstaCook/app.py
@@ -1,4 +1,4 @@
from flask import Flask
from flask import Flask, request
from flask_restful import Api
from resources.recipe import RecipeListResource, RecipeResource, RecipePublishResource
from resources.user import (
Expand Down Expand Up @@ -52,6 +52,10 @@ def check_if_token_in_black_list(jwt_header, jwt_payload):
token = TokenBlackList.get_by_jti(jti)
return token is not None

@limiter.request_filter
def ip_whitelist():
return request.remote_addr == "127.0.0.1"

# Note: uncomment below code to understand the keys added to cache
#@app.before_request
#def before_request():
Expand Down

0 comments on commit 0499fe5

Please sign in to comment.