quivr/backend/modules/api_key/repository/api_key_interface.py
Zineb El Bachiri f48dab4a7d
refactor: to modules (#1754)
# 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):
2023-11-30 22:29:28 +01:00

28 lines
639 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):
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