Skip to content

Commit

Permalink
Merge pull request #40 from DhafinFK/rollback-branch
Browse files Browse the repository at this point in the history
fix: removed admin feature for prod release
  • Loading branch information
DhafinFK authored Aug 3, 2024
2 parents 356792f + bcf2fbf commit 5b1644e
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 181 deletions.
2 changes: 0 additions & 2 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from app.views.auth import router_auth
from app.views.main import router_main
from app.views.review import router_review
from app.views.admin import router_admin
from app.cron import cron
from uploader.views import router_uploader

Expand Down Expand Up @@ -87,7 +86,6 @@
app.register_blueprint(router_main, url_prefix=app.config["BASE_PATH"])
app.register_blueprint(router_uploader, url_prefix=app.config["BASE_PATH"])
app.register_blueprint(router_review, url_prefix=app.config["BASE_PATH"])
app.register_blueprint(router_admin, url_prefix=app.config["BASE_PATH"])
app.register_blueprint(cron)

CORS(app)
Expand Down
12 changes: 0 additions & 12 deletions app/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,4 @@ def decorated_func(*args, **kwargs):
'message': 'There is no token/token is not valid'
}), 401)
return func(*args, **kwargs)
return decorated_func


def require_admin_jwt(func):
@functools.wraps(func)
def decorated_func(*args, **kwargs):
data = extract_header_data(request.headers)
if(data['credentials'] == os.environ.get("ADMIN_CREDENTIAL_VERIFICATION")):
return func(*args, **kwargs)
return (jsonify({
'message': 'Unauthorized access'
}), 403)
return decorated_func
9 changes: 1 addition & 8 deletions app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,4 @@ def process_sso_profile(sso_profile):


def get_app_config(varname):
return app.config.get(varname)


def generate_admin_jwt():
token = encode_token({
'credentials': os.environ.get("ADMIN_CREDENTIAL_VERIFICATION")
})
return token
return app.config.get(varname)
147 changes: 0 additions & 147 deletions app/views/admin.py

This file was deleted.

12 changes: 0 additions & 12 deletions models/admin.py

This file was deleted.

0 comments on commit 5b1644e

Please sign in to comment.