utils.domains package¶
Submodules¶
utils.domains.application_domain_index module¶
- utils.domains.application_domain_index.build_domain_index(applications: dict[str, Any], include_aliases: bool = True) dict[str, str]¶
Build a case-insensitive domain -> application_id index. If the same domain appears in multiple apps (case-insensitive), raises an error.
Cached keyed on (applications fingerprint, include_aliases); the result is returned as-is, so callers MUST treat it as read-only.
utils.domains.default_primary module¶
The CI/dev primary domain, read from default.env (the SPOT).
- utils.domains.default_primary.default_domain_primary() str¶
The
INFINITO_DOMAINfallback declared indefault.env.Consumers that take an explicit domain or read one from the environment fall back here rather than repeating the literal, so changing the CI/dev default is a one-line edit in
default.envinstead of a hunt through the tree.
utils.domains.list module¶
- utils.domains.list.add_www_variants(domains: list[str]) list[str]¶
- utils.domains.list.build_applications_from_roles(roles_dir: Path, domain_primary: str) dict[str, dict[str, Any]]¶
- utils.domains.list.list_application_domains(domain_primary: str, *, include_aliases: bool = False, include_www: bool = False) list[str]¶
- utils.domains.list.list_derived_domains(domain_primary: str) list[str]¶
utils.domains.primary_domain module¶
- utils.domains.primary_domain.get_domain(domains, application_id)¶
- utils.domains.primary_domain.get_primary_domain(domains, application_id)¶
- Return the primary domain for application_id from the domains mapping:
If value is a string, return it.
If value is a dict, return its first value.
If value is a list, return its first element.
Otherwise, raise an error.
utils.domains.unserved module¶
- utils.domains.unserved.served_domains(domains: Any, services: Any) list[str]¶
Return the domains of one application that it serves itself.
- Parameters:
domains – the application’s entry of the resolved domains map, a list, or a mapping of canonical key to domain where onion mirrors sit under
<key>_onion.services – the application’s
servicesmapping.
- Returns:
The domain values without those of the keys
unserved_canonical_keysnames and without their onion mirrors.
- utils.domains.unserved.unserved_canonical_keys(services: Any) set[str]¶
Return the canonical domain keys an application does not serve.
- Parameters:
services – the application’s
servicesmapping. An entity that listsdomainsclaims those canonical keys.- Returns:
The keys of every claiming entity that is disabled, or enabled but shared, because its provider serves that surface instead.
Module contents¶
Shared domain helpers for Infinito.Nexus.