From 3c1a1ac39229dfb3906df0911a6c7fe024f847d2 Mon Sep 17 00:00:00 2001 From: Ian Eaves Date: Thu, 2 Nov 2023 22:27:27 -0500 Subject: [PATCH] Revert "Bearer handling" This reverts commit 57c3cca30df499d663b9bf5e41ca19d627b1291e. --- grai-server/app/auth/validation.py | 2 ++ grai-server/app/scripts/test.py | 9 +++++++++ grai-server/app/workspaces/permissions.py | 14 ++------------ 3 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 grai-server/app/scripts/test.py diff --git a/grai-server/app/auth/validation.py b/grai-server/app/auth/validation.py index 85660df51..d708387ef 100644 --- a/grai-server/app/auth/validation.py +++ b/grai-server/app/auth/validation.py @@ -14,6 +14,8 @@ def _generate_token(user: User) -> str: def send_validation_email(user: User): token = _generate_token(user) + print(token) + c = { "base_url": config("FRONTEND_URL", "http://localhost:3000"), "token": token, diff --git a/grai-server/app/scripts/test.py b/grai-server/app/scripts/test.py new file mode 100644 index 000000000..546228b5c --- /dev/null +++ b/grai-server/app/scripts/test.py @@ -0,0 +1,9 @@ +import os + +import django + +os.environ["DJANGO_SETTINGS_MODULE"] = "the_guide.settings.dev" +django.setup() +import lineage.serializers as s + +print(repr(s.EdgeSerializer())) diff --git a/grai-server/app/workspaces/permissions.py b/grai-server/app/workspaces/permissions.py index e794bc540..baafca486 100755 --- a/grai-server/app/workspaces/permissions.py +++ b/grai-server/app/workspaces/permissions.py @@ -1,16 +1,6 @@ -from rest_framework_api_key.permissions import BaseHasAPIKey, KeyParser, APIKey -from django.http import HttpRequest -import re -from .models import WorkspaceAPIKey - - -class BearerKeyParser(KeyParser): - keyword = "Bearer" +from rest_framework_api_key.permissions import BaseHasAPIKey - -class BearerApiKey(BaseHasAPIKey): - model = APIKey - key_parser = BearerKeyParser() +from .models import WorkspaceAPIKey class HasWorkspaceAPIKey(BaseHasAPIKey):