Skip to content

Commit

Permalink
Bearer handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ieaves committed Nov 3, 2023
1 parent 95ec232 commit 57c3cca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
2 changes: 0 additions & 2 deletions grai-server/app/auth/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ 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,
Expand Down
9 changes: 0 additions & 9 deletions grai-server/app/scripts/test.py

This file was deleted.

14 changes: 12 additions & 2 deletions grai-server/app/workspaces/permissions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
from rest_framework_api_key.permissions import BaseHasAPIKey

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"


class BearerApiKey(BaseHasAPIKey):
model = APIKey
key_parser = BearerKeyParser()


class HasWorkspaceAPIKey(BaseHasAPIKey):
model = WorkspaceAPIKey

0 comments on commit 57c3cca

Please sign in to comment.