mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-22 13:51:39 +03:00
31c1802084
# Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate):
35 lines
722 B
Python
35 lines
722 B
Python
from abc import ABC, abstractmethod
|
|
from typing import List
|
|
from uuid import UUID
|
|
|
|
from modules.api_key.entity.api_key import ApiKey
|
|
|
|
|
|
class ApiKeysInterface(ABC):
|
|
@abstractmethod
|
|
def create_api_key(
|
|
self,
|
|
new_key_id: UUID,
|
|
new_api_key: str,
|
|
user_id: UUID,
|
|
days: int,
|
|
only_chat: bool,
|
|
):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def delete_api_key(self, key_id: UUID, user_id: UUID):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_active_api_key(self, api_key: UUID):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_user_id_by_api_key(self, api_key: UUID):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_user_api_keys(self, user_id: UUID) -> List[ApiKey]:
|
|
pass
|