blakeblackshear / frigate-hass-integration

Frigate integration for Home Assistant
MIT License
728 stars 114 forks source link

When using Home Assistant signed paths the notification image will not load unless unauthorized notification proxy is set to true. #638

Closed wreper12 closed 5 months ago

wreper12 commented 7 months ago

Version of the custom_component

5.0.1

Configuration

Frigate Configuration working fine,
Frigate Integration
 WebRTC for camera's: False
 RTMP url: Undefined
 RTSP url: Undefined
 Enable the unauthenticated notification event proxy: False
 Enable the media browser: True
 Seconds for unauthenticated requests: 1

Describe the bug

Reading through issue #153 and looking at the options for the frigate integration with the option to disable the unauthenticated notification proxy it appears that there should be support for using Home Assistant Signed Paths. Using a script I am able to generate valid Signed Paths, but the URL will not work. If you enable the unauthenticated notification proxy and set the Disallow unauthenticated notification assess to 1 second then notifications and the Signed Path work for the full time that the Signed Path is valid.

Looking at /custom_components/frigate/views.py at line 291 this is the current code.

        # If proxy is disabled, immediately reject
        if not is_notification_proxy_enabled:
            return False

        # Authenticated requests are always allowed.
        if request[KEY_AUTHENTICATED]:
            return True

With the code order if the proxy is disabled even if you have a key it will be rejected. On my Home Assistant setup I modified the file using a file editor to change the code order and the issue went away and Signed Keys would work even if the proxy is disabled.

github-actions[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

wreper12 commented 6 months ago

The issue still exists within the frigate hass integration.

github-actions[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.