- crates/ld-engine : formule inertielle (parité avec la maquette, garde C), coquille / changement de fond, assistant d'édition à règles, composition d'un document sous vote permanent (adoptions, aperçus, rivales). - crates/trustin-access : qui voit, qui ouvre, qui gère les accès. - crates/ld-server : API axum + SQLite, connexion Ğ1 (client OAuth2 de connect.monnaie-libre.fr), invitations, entrée en vigueur automatique, signalements de contradiction, traductions éditoriales, publication git, taille de la toile lue sur la chaîne. - seeds/acte-engagement-certification.json : 33 articles, fr + en + es ; en vigueur : préambule, E1, E2 (seed a minima). - maquette/ : frontend, backend et docker v2 déplacés tels quels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
54 lines
1.5 KiB
Python
54 lines
1.5 KiB
Python
from __future__ import annotations
|
|
|
|
from datetime import datetime
|
|
from uuid import UUID
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
# ── Request schemas ──────────────────────────────────────────────
|
|
|
|
|
|
class ChallengeRequest(BaseModel):
|
|
"""Request a challenge nonce for Ed25519 authentication."""
|
|
|
|
address: str = Field(..., min_length=1, max_length=64, description="Duniter V2 SS58 address")
|
|
|
|
|
|
class VerifyRequest(BaseModel):
|
|
"""Submit the signed challenge to obtain a session token."""
|
|
|
|
address: str = Field(..., min_length=1, max_length=64)
|
|
signature: str = Field(..., description="Ed25519 signature of the challenge (hex)")
|
|
challenge: str = Field(..., description="The challenge string that was signed")
|
|
|
|
|
|
# ── Response schemas ─────────────────────────────────────────────
|
|
|
|
|
|
class ChallengeResponse(BaseModel):
|
|
"""Returned after requesting a challenge."""
|
|
|
|
challenge: str
|
|
expires_at: datetime
|
|
|
|
|
|
class IdentityOut(BaseModel):
|
|
"""Public representation of a Duniter identity."""
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: UUID
|
|
address: str
|
|
display_name: str | None = None
|
|
wot_status: str
|
|
is_smith: bool
|
|
is_techcomm: bool
|
|
|
|
|
|
class TokenResponse(BaseModel):
|
|
"""Returned after successful challenge verification."""
|
|
|
|
token: str
|
|
identity: IdentityOut
|