Compare commits

...
3 Commits
4 changed files with 45 additions and 16 deletions
+13
View File
@@ -262,6 +262,19 @@ In this example:
- Admin precedence: if the `admin` mapping matches, Frigate resolves the session to `admin` to avoid accidental downgrade when a user belongs to multiple groups (for example both `admin` and `viewer` groups). - Admin precedence: if the `admin` mapping matches, Frigate resolves the session to `admin` to avoid accidental downgrade when a user belongs to multiple groups (for example both `admin` and `viewer` groups).
:::note
If a user isn't getting the role you expect, enable debug logging to see exactly what headers Frigate is receiving from your proxy:
```yaml
logger:
default: info
logs:
frigate.api.auth: debug
```
:::
#### Port Considerations #### Port Considerations
**Authenticated Port (8971)** **Authenticated Port (8971)**
-2
View File
@@ -23,7 +23,6 @@ from frigate.const import (
EXPIRE_AUDIO_ACTIVITY, EXPIRE_AUDIO_ACTIVITY,
INSERT_MANY_RECORDINGS, INSERT_MANY_RECORDINGS,
INSERT_PREVIEW, INSERT_PREVIEW,
NOTIFICATION_TEST,
REQUEST_REGION_GRID, REQUEST_REGION_GRID,
UPDATE_AUDIO_ACTIVITY, UPDATE_AUDIO_ACTIVITY,
UPDATE_AUDIO_TRANSCRIPTION_STATE, UPDATE_AUDIO_TRANSCRIPTION_STATE,
@@ -57,7 +56,6 @@ _WS_BLOCKED_TOPICS = frozenset(
UPDATE_EMBEDDINGS_REINDEX_PROGRESS, UPDATE_EMBEDDINGS_REINDEX_PROGRESS,
UPDATE_BIRDSEYE_LAYOUT, UPDATE_BIRDSEYE_LAYOUT,
UPDATE_AUDIO_TRANSCRIPTION_STATE, UPDATE_AUDIO_TRANSCRIPTION_STATE,
NOTIFICATION_TEST,
} }
) )
+14
View File
@@ -115,6 +115,13 @@ class TestCheckWsAuthorization(unittest.TestCase):
) )
) )
def test_viewer_blocked_from_notification_test(self):
self.assertFalse(
_check_ws_authorization(
"notification_test", "viewer", self.DEFAULT_SEPARATOR
)
)
# --- Admin access --- # --- Admin access ---
def test_admin_can_send_restart(self): def test_admin_can_send_restart(self):
@@ -134,6 +141,13 @@ class TestCheckWsAuthorization(unittest.TestCase):
_check_ws_authorization("front_door/ptz", "admin", self.DEFAULT_SEPARATOR) _check_ws_authorization("front_door/ptz", "admin", self.DEFAULT_SEPARATOR)
) )
def test_admin_can_send_notification_test(self):
self.assertTrue(
_check_ws_authorization(
"notification_test", "admin", self.DEFAULT_SEPARATOR
)
)
# --- Comma-separated roles --- # --- Comma-separated roles ---
def test_comma_separated_admin_viewer_grants_admin(self): def test_comma_separated_admin_viewer_grants_admin(self):
@@ -227,16 +227,18 @@ export function GenAIModelWidget(props: WidgetProps) {
aria-expanded={open} aria-expanded={open}
disabled={disabled || readonly} disabled={disabled || readonly}
className={cn( className={cn(
"justify-between font-normal", "min-w-0 justify-between font-normal",
!currentLabel && "text-muted-foreground", !currentLabel && "text-muted-foreground",
fieldClassName, fieldClassName,
)} )}
> >
{currentLabel ?? <span className="truncate">
t("configForm.genaiModel.placeholder", { {currentLabel ??
ns: "views/settings", t("configForm.genaiModel.placeholder", {
defaultValue: "Select or enter a model…", ns: "views/settings",
})} defaultValue: "Select or enter a model…",
})}
</span>
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" /> <ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
</Button> </Button>
</PopoverTrigger> </PopoverTrigger>
@@ -263,12 +265,14 @@ export function GenAIModelWidget(props: WidgetProps) {
value={trimmedSearch} value={trimmedSearch}
onSelect={() => commit(trimmedSearch)} onSelect={() => commit(trimmedSearch)}
> >
<Plus className="mr-2 h-4 w-4" /> <Plus className="mr-2 h-4 w-4 shrink-0" />
{t("configForm.genaiModel.useCustom", { <span className="truncate">
ns: "views/settings", {t("configForm.genaiModel.useCustom", {
value: trimmedSearch, ns: "views/settings",
defaultValue: 'Use "{{value}}"', value: trimmedSearch,
})} defaultValue: 'Use "{{value}}"',
})}
</span>
</CommandItem> </CommandItem>
</CommandGroup> </CommandGroup>
)} )}
@@ -287,11 +291,11 @@ export function GenAIModelWidget(props: WidgetProps) {
> >
<Check <Check
className={cn( className={cn(
"mr-2 h-4 w-4", "mr-2 h-4 w-4 shrink-0",
value === model ? "opacity-100" : "opacity-0", value === model ? "opacity-100" : "opacity-0",
)} )}
/> />
{model} <span className="truncate">{model}</span>
</CommandItem> </CommandItem>
))} ))}
</CommandGroup> </CommandGroup>