Revert "add TODO"

This reverts commit 2b9d590f5f.
pull/21891/head
ytqh 1 year ago
parent 43361f75e7
commit 5c943a04f0

@ -34,7 +34,6 @@ from services.errors.workspace import WorkSpaceNotAllowedCreateError
from services.feature_service import FeatureService from services.feature_service import FeatureService
# TODO: copy as a separate auth service api
class LoginApi(Resource): class LoginApi(Resource):
"""Resource for user login.""" """Resource for user login."""

@ -1,6 +1,5 @@
import logging import logging
from libs.login import login_required
from flask_restful import Resource, reqparse # type: ignore from flask_restful import Resource, reqparse # type: ignore
from werkzeug.exceptions import InternalServerError, NotFound from werkzeug.exceptions import InternalServerError, NotFound

@ -34,7 +34,6 @@ class FetchUserArg(BaseModel):
required: bool = False required: bool = False
# TODO: add auth jwt token check
def validate_app_token(view: Optional[Callable] = None, *, fetch_user_arg: Optional[FetchUserArg] = None): def validate_app_token(view: Optional[Callable] = None, *, fetch_user_arg: Optional[FetchUserArg] = None):
def decorator(view_func): def decorator(view_func):
@wraps(view_func) @wraps(view_func)

@ -17,11 +17,8 @@ login_manager = flask_login.LoginManager()
@login_manager.request_loader @login_manager.request_loader
def load_user_from_request(request_from_flask_login): def load_user_from_request(request_from_flask_login):
"""Load user based on the request.""" """Load user based on the request."""
# TODO: if in the service_api, then we need to check the jwt token if request.blueprint not in {"console", "inner_api"}:
if request.blueprint not in {"console", "inner_api", "service_api", "admin_api"}:
return None return None
# Check if the user_id contains a dot, indicating the old format # Check if the user_id contains a dot, indicating the old format
auth_header = request.headers.get("Authorization", "") auth_header = request.headers.get("Authorization", "")
if not auth_header: if not auth_header:

Loading…
Cancel
Save