Use scopes to represent whether the use has a valid subscription in the middleware

This commit is contained in:
sabaimran
2023-11-24 20:29:36 -08:00
parent c13953311a
commit 69c8f45830
5 changed files with 59 additions and 32 deletions

View File

@@ -12,7 +12,7 @@ from asgiref.sync import sync_to_async
from fastapi import APIRouter, Depends, Header, HTTPException, Request
from fastapi.requests import Request
from fastapi.responses import Response, StreamingResponse
from starlette.authentication import requires
from starlette.authentication import requires, has_required_scope
# Internal Packages
from khoj.configure import configure_server