Skip to content

Commit

Permalink
add abstract method in header processor
Browse files Browse the repository at this point in the history
  • Loading branch information
yang-ruoxi committed Aug 9, 2024
1 parent 2603516 commit 5a472b1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/maggma/api/resource/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from pydantic import BaseModel
from starlette.responses import RedirectResponse

from maggma.api.query_operator import QueryOperator
from maggma.api.utils import STORE_PARAMS, api_sanitize
from maggma.utils import dynamic_import

Expand Down Expand Up @@ -106,3 +107,9 @@ def process_header(self, response: Response, request: Request):
It can use data in the upstream request to generate the header.
(https://fastapi.tiangolo.com/advanced/response-headers/#use-a-response-parameter).
"""

@abstractmethod
def configure_query_on_request(self, request: Request, query_operator: QueryOperator) -> STORE_PARAMS:
"""
This method takes in a FastAPI Request object and returns a query to be used in the store.
"""

0 comments on commit 5a472b1

Please sign in to comment.