Skip to content
This repository was archived by the owner on May 3, 2026. It is now read-only.

Add FastAPI LXMF integration utilities and update examples#202

Merged
brothercorvo merged 1 commit intomainfrom
corvo/add-reticulum_openapi.integrations.fastapi-package
Nov 11, 2025
Merged

Add FastAPI LXMF integration utilities and update examples#202
brothercorvo merged 1 commit intomainfrom
corvo/add-reticulum_openapi.integrations.fastapi-package

Conversation

@brothercorvo
Copy link
Copy Markdown
Contributor

Summary

  • add a reusable reticulum_openapi.integrations.fastapi package with LXMF client settings, lifecycle helpers, link management, and command execution utilities
  • refactor the Emergency Management gateway and northbound API to consume the new integration layer and drop duplicated configuration logic
  • document the FastAPI integration features and expand the automated test suite with dedicated FastAPI coverage

Testing

  • pytest tests/integrations/fastapi/test_integration_layer.py tests/examples/emergency_management/test_web_gateway.py tests/examples/emergency_management/test_north_api.py

Codex Task

@brothercorvo brothercorvo merged commit d5988b6 into main Nov 11, 2025
0 of 2 checks passed
@brothercorvo brothercorvo deleted the corvo/add-reticulum_openapi.integrations.fastapi-package branch November 11, 2025 15:41
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +133 to +147
raw_json = os.getenv(env_json_var)
if raw_json:
config_data = _load_config_from_json(raw_json)
else:
path_override = os.getenv(env_path_var)
if path_override:
try:
candidate_path = Path(path_override).expanduser()
except (TypeError, ValueError):
candidate_path = None
if candidate_path is not None:
config_data = _load_config_from_path(candidate_path)
else:
config_data = {}
elif default_path is not None:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Invalid config path env var silently discards settings

When the LXMF client settings are loaded, an invalid path supplied via LXMF_CLIENT_CONFIG_PATH (for the gateway this comes from NORTH_API_CONFIG_PATH) is coerced to {} at lines 133‑147. This means a typo or malformed environment value results in a completely empty configuration instead of falling back to the default JSON file or raising an error as the previous implementation did. The gateway will then start with server_identity_hash=None, the link manager never attempts to connect, and every request must provide the identity explicitly. This regression is easy to trigger in production and is hard to diagnose because the service still boots. Consider either falling back to default_path when the override cannot be parsed, or surfacing a validation error so the operator notices the misconfiguration.

Useful? React with 👍 / 👎.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant