thunderbird_accounts.core.utils

Functions

get_absolute_url(path)

Prepend a path with the correct public facing url, if the path is already an absolute url it returns itself unmodified.

get_feature_flags()

Return a list of feature flags that the server has enabled via env or db.

parse_user_agent_info(user_agent_string)

Parse user agent string and return separate browser and OS information.

Classes

JsonSerializer([protocol])

A json-based serializer for our shared redis cache.

thunderbird_accounts.core.utils.get_feature_flags() → dict[source]

Return a list of feature flags that the server has enabled via env or db. This is for the frontend, but the frontend might have its own list of features so we prefix everything with be_ (for backend) to avoid collision.

thunderbird_accounts.core.utils.get_absolute_url(path: str) → str[source]

Prepend a path with the correct public facing url, if the path is already an absolute url it returns itself unmodified.

class thunderbird_accounts.core.utils.JsonSerializer(protocol=None)[source]

Bases: object

A json-based serializer for our shared redis cache.

__init__(protocol=None)[source]
thunderbird_accounts.core.utils.parse_user_agent_info(user_agent_string: str) → tuple[str, str][source]

Parse user agent string and return separate browser and OS information.