frigate/migrations
Josh Hawkins 152e585206
Authentication improvements (#21194)
* jwt permissions

* add old password to body req

* add model and migration

need to track the datetime that passwords were changed for the jwt

* auth api backend changes

- use os.open to create jwt secret with restrictive permissions (0o600: read/write for owner only)
- add backend validation for password strength
- add iat claim to jwt so the server can determine when a token was issued and reject any jwts issued before a user's password_changed_at timestamp, ensuring old tokens are invalidated after a password change
- set logout route to public to avoid 401 when logging out
- issue new jwt for users who change their own password so they stay logged in

* improve set password dialog

- add field to verify old password
- add password strength requirements

* frontend tweaks for password dialog

* i18n

* use verify endpoint for existing password verification

avoid /login side effects (creating a new session)

* public logout

* only check if password has changed on jwt refresh

* fix tests

Fix migration 030 by using raw sql to select usernames (avoid ORM selecting nonexistent columns)

* add multi device warning to password dialog

* remove password verification endpoint

Just send old_password + new password in one request, let the backend handle verification in a single operation
2025-12-08 09:02:28 -07:00
..
001_create_events_table.py Add isort and ruff linter (#6575) 2023-05-29 05:31:17 -05:00
002_add_clip_snapshot.py Add isort and ruff linter (#6575) 2023-05-29 05:31:17 -05:00
003_create_recordings_table.py Migrate pydantic to V2 (#10142) 2024-02-29 16:10:13 -07:00
004_add_bbox_region_area.py Add isort and ruff linter (#6575) 2023-05-29 05:31:17 -05:00
005_make_end_time_nullable.py Add isort and ruff linter (#6575) 2023-05-29 05:31:17 -05:00
006_add_motion_active_objects.py Add region count to database and use for motion activity (#10480) 2024-03-15 09:29:22 -06:00
007_add_retain_indefinitely.py Add isort and ruff linter (#6575) 2023-05-29 05:31:17 -05:00
008_add_sub_label.py Add isort and ruff linter (#6575) 2023-05-29 05:31:17 -05:00
009_add_object_filter_ratio.py Add isort and ruff linter (#6575) 2023-05-29 05:31:17 -05:00
010_add_plus_image_id.py Add isort and ruff linter (#6575) 2023-05-29 05:31:17 -05:00
011_update_indexes.py Migrate pydantic to V2 (#10142) 2024-02-29 16:10:13 -07:00
012_add_segment_size.py Add isort and ruff linter (#6575) 2023-05-29 05:31:17 -05:00
013_create_timeline_table.py Add isort and ruff linter (#6575) 2023-05-29 05:31:17 -05:00
014_event_updates_for_fp.py Add isort and ruff linter (#6575) 2023-05-29 05:31:17 -05:00
015_event_refactor.py Add isort and ruff linter (#6575) 2023-05-29 05:31:17 -05:00
016_sublabel_increase.py Add isort and ruff linter (#6575) 2023-05-29 05:31:17 -05:00
017_update_indexes.py Migrate pydantic to V2 (#10142) 2024-02-29 16:10:13 -07:00
018_add_dbfs.py Save average dBFS and retain segment with dBFS in motion mode (#7158) 2023-07-14 19:05:14 -05:00
019_create_regions_table.py Migrate pydantic to V2 (#10142) 2024-02-29 16:10:13 -07:00
020_update_index_recordings.py Migrate pydantic to V2 (#10142) 2024-02-29 16:10:13 -07:00
021_create_previews_table.py Migrate pydantic to V2 (#10142) 2024-02-29 16:10:13 -07:00
022_create_review_segment_table.py Create ReviewSegment table in DB for organizing detections to be reviewed (#9918) 2024-02-20 16:26:09 -07:00
023_add_regions.py Add region count to database and use for motion activity (#10480) 2024-03-15 09:29:22 -06:00
024_create_export_table.py Save exports to database (#11040) 2024-04-19 17:11:41 -05:00
025_create_user_table.py Auth! (#11347) 2024-05-18 10:36:13 -06:00
026_add_notification_tokens.py Implement support for notifications (#12523) 2024-08-29 20:19:50 -06:00
027_create_explore_index.py Optimize Explore summary database query (#14797) 2024-11-04 16:04:49 -07:00
028_optional_event_thumbnail.py Remove thumb from database field (#16647) 2025-02-18 07:46:29 -07:00
029_add_user_role.py UI viewer role (#16978) 2025-03-08 10:01:08 -06:00
030_create_user_review_status.py Authentication improvements (#21194) 2025-12-08 09:02:28 -07:00
031_create_trigger_table.py Semantic Search Triggers (#18969) 2025-08-16 10:20:33 -05:00
032_add_password_changed_at.py Authentication improvements (#21194) 2025-12-08 09:02:28 -07:00