gamesheet_sdk.common.auth.firebase module

Shared Firebase Auth helpers.

Provides utilities for interpreting Firebase Authentication REST API responses. Used by both the admin browser-based login (login) and the teams HTTP-only login (login).

gamesheet_sdk.common.auth.firebase.extract_firebase_error(body, status)[source]

Extract a human-readable error string from a Firebase Auth response body.

Firebase returns {"error": {"code": N, "message": "CODE_NAME", ...}}; the message is a stable identifier like EMAIL_NOT_FOUND that we surface verbatim so callers can react programmatically.

Parameters:
  • body (dict[str, Any]) – Parsed JSON body from the Firebase response.

  • status (int) – HTTP status code, used as the fallback message.

Returns:

The Firebase error code string, or "HTTP <status>" if the body does not contain a usable error message.

Return type:

str