STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_userdata Namespace Reference

Classes

class  _Req

Functions

 _isolate (tmp_path, monkeypatch)
 test_current_user_falls_back_to_local_without_header ()
 test_current_user_lowercases_the_email ()
 test_identity_cannot_escape_via_traversal ()
 test_write_read_list_delete_roundtrip ()
 test_users_are_isolated ()
 test_invalid_name_rejected ()
 test_traversal_slug_reads_nothing ()
 test_slug_user_matches_current_user_exactly ()
 test_slug_user_cannot_escape_the_root ()
 test_user_dir_create_false_does_not_conjure_a_tree (tmp_path)
 test_all_users_lists_only_people_with_data_for_this_app (tmp_path)
 test_all_users_survives_a_missing_root (tmp_path, monkeypatch)

Variables

 reason

Detailed Description

Per-user data helper (backend/userdata.py).

Identity comes from X-Auth-Email (Caddy in prod; a `local` fallback in dev), and
one user's saved configs must never be visible to another. Tests the module
directly so it needs neither the full app nor its heavy deps.

Function Documentation

◆ _isolate()

test_userdata._isolate ( tmp_path,
monkeypatch )
protected

Definition at line 26 of file test_userdata.py.

◆ test_all_users_lists_only_people_with_data_for_this_app()

test_userdata.test_all_users_lists_only_people_with_data_for_this_app ( tmp_path)

Definition at line 93 of file test_userdata.py.

◆ test_all_users_survives_a_missing_root()

test_userdata.test_all_users_survives_a_missing_root ( tmp_path,
monkeypatch )

Definition at line 106 of file test_userdata.py.

◆ test_current_user_falls_back_to_local_without_header()

test_userdata.test_current_user_falls_back_to_local_without_header ( )

Definition at line 30 of file test_userdata.py.

◆ test_current_user_lowercases_the_email()

test_userdata.test_current_user_lowercases_the_email ( )

Definition at line 34 of file test_userdata.py.

◆ test_identity_cannot_escape_via_traversal()

test_userdata.test_identity_cannot_escape_via_traversal ( )

Definition at line 38 of file test_userdata.py.

◆ test_invalid_name_rejected()

test_userdata.test_invalid_name_rejected ( )

Definition at line 58 of file test_userdata.py.

◆ test_slug_user_cannot_escape_the_root()

test_userdata.test_slug_user_cannot_escape_the_root ( )

Definition at line 77 of file test_userdata.py.

◆ test_slug_user_matches_current_user_exactly()

test_userdata.test_slug_user_matches_current_user_exactly ( )
An ?owner= param and the injected header must normalize identically, or
an ownership check hinges on two slightly different transforms.

Definition at line 70 of file test_userdata.py.

◆ test_traversal_slug_reads_nothing()

test_userdata.test_traversal_slug_reads_nothing ( )

Definition at line 63 of file test_userdata.py.

◆ test_user_dir_create_false_does_not_conjure_a_tree()

test_userdata.test_user_dir_create_false_does_not_conjure_a_tree ( tmp_path)
The cross-user browse inspects every sibling folder; if inspection
created them, one listing would invent a directory per user it looked at.

Definition at line 83 of file test_userdata.py.

◆ test_users_are_isolated()

test_userdata.test_users_are_isolated ( )

Definition at line 53 of file test_userdata.py.

◆ test_write_read_list_delete_roundtrip()

test_userdata.test_write_read_list_delete_roundtrip ( )

Definition at line 43 of file test_userdata.py.

Variable Documentation

◆ reason

test_userdata.reason

Definition at line 15 of file test_userdata.py.