Full-stack Amazon AI Transcreation Platform with: - FastAPI backend (async, PostgreSQL, Redis, Celery) with 11 DB tables - JWT auth (SSO-ready abstract provider pattern) - 6-agent pipeline orchestrator with deterministic modules - Next.js 14 frontend with Amazon branding (Ember fonts, orange/dark theme) - Job wizard, monitoring HUD, output review, admin screens - 154 TM/reference files imported, 12 locales configured - Docker Compose for all services Agents 2-5 (TM retrieval, ranker, transcreator, compliance) are stubs pending Phase 3 LLM integration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
from abc import ABC, abstractmethod
|
|
from typing import Any
|
|
|
|
|
|
class AbstractAuthProvider(ABC):
|
|
"""Abstract base for authentication providers."""
|
|
|
|
@abstractmethod
|
|
async def authenticate(self, email: str, password: str) -> dict[str, Any] | None:
|
|
"""Authenticate a user. Returns user dict or None if invalid."""
|
|
...
|
|
|
|
@abstractmethod
|
|
def create_access_token(self, data: dict[str, Any]) -> str:
|
|
"""Create an access token for the given data."""
|
|
...
|
|
|
|
@abstractmethod
|
|
def create_refresh_token(self, data: dict[str, Any]) -> str:
|
|
"""Create a refresh token for the given data."""
|
|
...
|
|
|
|
@abstractmethod
|
|
def validate_token(self, token: str) -> dict[str, Any] | None:
|
|
"""Validate a token and return the claims, or None if invalid."""
|
|
...
|
|
|
|
@abstractmethod
|
|
def hash_password(self, password: str) -> str:
|
|
"""Hash a plaintext password."""
|
|
...
|
|
|
|
@abstractmethod
|
|
def verify_password(self, plain_password: str, hashed_password: str) -> bool:
|
|
"""Verify a plaintext password against a hash."""
|
|
...
|