2222
2323
2424class EbayOAuthError (RuntimeError ):
25- """Erreur OAuth eBay exploitable côté UI ( code + message lisibles )."""
25+ """User-facing eBay OAuth error (stable code + human-readable message )."""
2626
2727 def __init__ (self , code : str , message : str , * , status : int | None = None ) -> None :
2828 super ().__init__ (code )
@@ -35,8 +35,9 @@ def __str__(self) -> str:
3535
3636
3737def _describe_ebay_oauth_error (status : int , body : str ) -> EbayOAuthError :
38- """Transforme un body 4xx eBay (`{"error": "...", "error_description": "..."}`)
39- en exception `RuntimeError` lisible, avec un code applicatif stable pour l'UI."""
38+ """Turn an eBay 4xx body (`{"error": "...", "error_description": "..."}`)
39+ into a readable `RuntimeError` with a stable application code for the UI.
40+ User-facing messages are kept in French (shown verbatim in the app UI)."""
4041 payload : dict [str , Any ] = {}
4142 try :
4243 parsed = json .loads (body ) if body else {}
@@ -135,15 +136,14 @@ async def exchange_authorization_code(code: str, *, app: AppSettings | None = No
135136
136137
137138async def refresh_user_access_token (refresh_token : str , * , app : AppSettings | None = None ) -> dict [str , Any ]:
138- """Rafraîchit l'access token utilisateur.
139-
140- On ne force **volontairement pas** le paramètre ``scope`` : eBay renvoie alors
141- un token portant les scopes tels qu'ils ont été consentis au moment de la
142- connexion. C'est indispensable quand ``EBAY_SCOPES`` évolue (ajout de
143- ``sell.fulfillment`` par exemple) : les utilisateurs déjà connectés avant
144- l'ajout continuent de publier (inventory + account) sans reconsentement ;
145- les fonctionnalités nécessitant le nouveau scope détecteront son absence et
146- proposeront la reconnexion.
139+ """Refresh the user access token.
140+
141+ We intentionally do **not** send the ``scope`` parameter: eBay then returns
142+ a token with the scopes as originally consented. This is required when
143+ ``EBAY_SCOPES`` evolves (e.g. when ``sell.fulfillment`` was added): users
144+ already connected before the change keep publishing (inventory + account)
145+ without re-consenting; features that need the new scope detect its absence
146+ and prompt the user to reconnect.
147147 """
148148 s = app or get_settings ()
149149 if not ebay_oauth_configured (s ):
0 commit comments