gamesheet_sdk.common.auth.credentials module

Credential resolution for login flows.

Provides helpers that resolve an email address and password from explicit arguments, environment variables (via Config), or interactive prompts. Both login (admin) and login (teams) delegate to these functions so the fallback logic lives in one place.

The two resolvers are intentionally kept as separate functions — bundling email and password into a shared return value trips CodeQL’s data-flow analyzer into flagging downstream email log calls as clear-text password logging.

gamesheet_sdk.common.auth.credentials.resolve_email(cfg, email)[source]

Resolve the login email from explicit argument or config.

Falls through: explicit email argument → GAMESHEET_USERNAME env var → Config.username.

Parameters:
  • cfg (Config) – Configuration object containing username from env/defaults.

  • email (str | None) – Explicit email address, or None to fall back to config.

Returns:

The resolved email address.

Return type:

str

Raises:

AuthenticationError – If no email is available from any source.

gamesheet_sdk.common.auth.credentials.resolve_password(cfg, password)[source]

Resolve the login password from explicit argument or config.

Falls through: explicit password argument → GAMESHEET_PASSWORD env var → Config.password.

Parameters:
  • cfg (Config) – Configuration object containing password from env/defaults.

  • password (str | None) – Explicit password, or None to fall back to config.

Returns:

The resolved password string.

Return type:

str

Raises:

AuthenticationError – If no password is available from any source.