Demonstrates the full Tink integration flow for open banking: Step 1 — Client credentials auth (app token) Step 2 — Create Tink user with external_user_id Step 3 — Connect bank via Tink Link OAuth redirect Step 4 — List accounts (v2 endpoint) Step 5 — List transactions (v2 endpoint, cursor pagination) Step 6 — Webhooks (register endpoint, receive events) Built with Python / FastAPI + Jinja2 templates. Each step shows live JSON responses, cURL examples and API version badges. Includes server-side token store (prevents session cookie overflow), asyncio lock on OAuth callback, and demo mode with realistic mock data. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
26 lines
846 B
Python
26 lines
846 B
Python
"""
|
|
App configuration loaded from environment / .env file.
|
|
"""
|
|
|
|
import os
|
|
from functools import lru_cache
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
|
|
|
|
class Settings:
|
|
tink_client_id: str = os.environ["TINK_CLIENT_ID"]
|
|
tink_client_secret: str = os.environ["TINK_CLIENT_SECRET"]
|
|
tink_redirect_uri: str = os.getenv("TINK_REDIRECT_URI", "http://localhost:8000/callback")
|
|
app_base_url: str = os.getenv("APP_BASE_URL", "http://localhost:8000")
|
|
session_secret: str = os.getenv("SESSION_SECRET", "dev-only-change-in-prod")
|
|
tink_api_base: str = os.getenv("TINK_API_BASE", "https://api.tink.com")
|
|
tink_link_base: str = os.getenv("TINK_LINK_BASE", "https://link.tink.com")
|
|
demo_mode: bool = os.getenv("DEMO_MODE", "false").lower() in ("true", "1", "yes")
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|