Skip to content

Debug switches bypass the admin gate of the debug logging services #92

Description

@tis24dev

Follow up from frenck's review on hacs/default#8674 (approved and merged, not a blocker).

set_log_level and set_mqtt_log_level are registered with async_register_admin_service, so they are admin only.

HonDebugSwitch (custom_components/addhon/switch.py:911) writes the same options, CONF_ENABLE_DEBUG and CONF_ENABLE_MQTT_DEBUG. The options update listener re-applies the log levels live, no reload. switch.turn_on has no admin gate in Home Assistant, so a non admin user can still enable integration wide debug logging from the entity.

Impact is bounded, credentials are redacted in debug_utils.py. Still, the two routes to the same capability disagree on who may use it.

To decide for a future release:

  • restrict the switches
  • remove them and keep only the Options flow and the admin services
  • accept the divergence and document it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions