Перенести приложение мессенджера с сессиями в PostgreSQL
Реализован Flask-мессенджер (авторизация с Argon2-сессиями в PostgreSQL, чаты, сообщения, курсорная пагинация), миграции 001, зависимости и цели make run/migrate. Отправка сообщения пока без идемпотентности.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
"""Storage port. Concrete PostgreSQL adapter is wired in api.create_app."""
|
||||
from typing import Protocol
|
||||
|
||||
|
||||
class Repository(Protocol):
|
||||
def ready(self): ...
|
||||
def cursor_key(self): ...
|
||||
def create_user(self, username, display_name, password_hash): ...
|
||||
def credentials(self, username): ...
|
||||
def create_session(self, user_id, token_hash, ttl): ...
|
||||
def session_user(self, token_hash): ...
|
||||
def revoke_session(self, token_hash): ...
|
||||
def create_chat(self, actor, title, members): ...
|
||||
def chat(self, actor, chat_id): ...
|
||||
def chats(self, actor, limit, after): ...
|
||||
def create_message(self, actor, chat_id, text): ...
|
||||
def messages(self, actor, chat_id, limit, after): ...
|
||||
Reference in New Issue
Block a user