block new connections toggle#34
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a configurable “new connections” toggle that can block new app login/onboarding flows and first-time MQTT vacuum onboarding while preserving existing auth/session functionality.
Changes:
- Adds
admin.new_connections_enabledconfig defaults and generated config entries. - Exposes the toggle in the standalone admin UI/API and auth status payload.
- Blocks selected HTTP onboarding/login/sync routes and unknown-device MQTT onboarding candidates when disabled.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
config.example.toml |
Documents the new admin config setting. |
src/roborock_local_server/config.py |
Loads new_connections_enabled into admin config. |
src/roborock_local_server/configure.py |
Emits the new setting in generated config. |
src/roborock_local_server/ha_addon.py |
Emits the new setting for Home Assistant add-on config. |
src/roborock_local_server/server.py |
Adds toggle accessors, admin mutation, HTTP blocking, and MQTT proxy wiring. |
src/roborock_local_server/standalone_admin.py |
Replaces protocol-auth UI toggle with new-connections UI/API handling. |
src/roborock_local_server/bundled_backend/mqtt_tls_proxy_server/server.py |
Rejects onboarding MQTT candidates when the toggle is disabled. |
tests/conftest.py |
Adds test config support for the new setting. |
tests/test_admin_api.py |
Covers admin toggle API/UI text and onboarding blocking. |
tests/test_config.py |
Covers config default loading. |
tests/test_configure.py |
Covers generated config output. |
tests/test_ha_addon.py |
Covers HA add-on generated config output. |
tests/test_mqtt_tls_proxy.py |
Covers MQTT onboarding rejection when disabled. |
tests/test_protocol_auth.py |
Covers login/onboarding route blocking. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @classmethod | ||
| def _new_connection_flow_for_path(cls, clean_path: str) -> str | None: | ||
| normalized = cls._normalized_path(clean_path) | ||
| if normalized in {"/region", "/nc/prepare", "/user/devices/newadd"}: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.