INNER CODE UNIT · Python
_default_home_token
iamlukethedev/Hermes3D · plugins/hermes3d-office-bridge/__init__.py:86
def _default_home_token(key: str) -> str:
"""Read ``key`` out of the default home's ``.env``.
Profiles each get their own ``HERMES_HOME`` and their own ``.env``, so a
profile-scoped process never sees a token pinned in the default home. That
matters here because this token is not profile-level config: it identifies
the one office backend every profile on the machine publishes to. Asking
users to copy the same secret into five ``.env`` files would be worse.
"""
from pathlib import Path
try:
from hermes_constants import get_default_hermes_root
root = Path(get_default_hermes_root())
except Exception:
root = Path.home() / ".hermes"