Skip to content

fix(visu): enforce admin auth on visu mutation endpoints#54

Open
Micsi wants to merge 1 commit into
mainfrom
codex/propose-server-side-admin-checks
Open

fix(visu): enforce admin auth on visu mutation endpoints#54
Micsi wants to merge 1 commit into
mainfrom
codex/propose-server-side-admin-checks

Conversation

@Micsi
Copy link
Copy Markdown
Owner

@Micsi Micsi commented May 18, 2026

Motivation

  • Fix a security regression where frontend-only admin checks (based on localStorage) could be bypassed because server-side Visu mutation endpoints used get_current_user (authenticated-only) instead of an admin check.
  • Ensure that any API that creates, updates, deletes, moves/copies nodes or saves page configs requires real admin authorization on the backend.

Description

  • Replaced Depends(get_current_user) with Depends(get_admin_user) for mutating endpoints in obs/api/v1/visu.py so that the following endpoints now require admin privileges: POST /nodes/import, POST /nodes, PATCH /nodes/{node_id}, DELETE /nodes/{node_id}, POST /nodes/{node_id}/copy, PUT /nodes/{node_id}/move, and PUT /pages/{node_id}.
  • The change is localized to obs/api/v1/visu.py and does not alter read-only endpoints or page access resolution logic.
  • This is a minimal, behavior-preserving fix that hardens server-side authorization without changing client code or API shapes.

Testing

  • Compiled the modified module with python -m compileall obs/api/v1/visu.py and the compilation succeeded.
  • Basic repository grep/inspection confirmed the targeted function signatures were updated to use Depends(get_admin_user).

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant