feat(billing): Nutzerhinweise bei leerem Budget + Mandats-Mail (402/SSE) Gateway - InsufficientBalanceException: billingModel, userAction (TOP_UP_SELF / CONTACT_MANDATE_ADMIN), DE/EN-Texte, toClientDict(), fromBalanceCheck() - HTTP 402 + JSON detail für globale API-Fehlerbehandlung - AI/Chatbot: vor Raise ggf. E-Mail an BillingSettings.notifyEmails (PREPAY_MANDATE, Throttle 1h/Mandat) via billingExhaustedNotify - Agent-Loop & Workspace-Route: SSE-ERROR mit strukturiertem Billing-Payload - datamodelBilling: notifyEmails-Doku für Pool-Alerts frontend_nyla - useWorkspace: SSE onError für INSUFFICIENT_BALANCE mit messageDe/En und Hinweis auf Billing-Pfad bei TOP_UP_SELF
42 lines
1.2 KiB
Python
42 lines
1.2 KiB
Python
# Copyright (c) 2025 Patrick Motsch
|
|
# All rights reserved.
|
|
"""OAuth scope sets for split Auth- vs Data-apps (Google / Microsoft)."""
|
|
|
|
# Google — Auth app only (no Gmail/Drive API scopes)
|
|
googleAuthScopes = [
|
|
"openid",
|
|
"https://www.googleapis.com/auth/userinfo.email",
|
|
"https://www.googleapis.com/auth/userinfo.profile",
|
|
]
|
|
|
|
# Google — Data app (Gmail + Drive + identity for token responses)
|
|
googleDataScopes = [
|
|
"openid",
|
|
"https://www.googleapis.com/auth/userinfo.email",
|
|
"https://www.googleapis.com/auth/userinfo.profile",
|
|
"https://www.googleapis.com/auth/gmail.readonly",
|
|
"https://www.googleapis.com/auth/drive.readonly",
|
|
]
|
|
|
|
# Microsoft — Auth app: Graph profile only (MSAL adds openid, profile, offline_access, …)
|
|
msftAuthScopes = [
|
|
"User.Read",
|
|
]
|
|
|
|
# Microsoft — Data app (delegated; requires admin consent for several)
|
|
msftDataScopes = [
|
|
"User.Read",
|
|
"Mail.ReadWrite",
|
|
"Mail.Send",
|
|
"Files.ReadWrite.All",
|
|
"Sites.ReadWrite.All",
|
|
"Team.ReadBasic.All",
|
|
"OnlineMeetings.Read",
|
|
"Chat.ReadWrite",
|
|
"ChatMessage.Send",
|
|
]
|
|
|
|
|
|
def msftDataScopesForRefresh() -> str:
|
|
"""Space-separated scope string identical to authorization request (Token v2 refresh)."""
|
|
return " ".join(msftDataScopes)
|