Skip to content

feat/auth layer apply roles#6

Merged
diamond2016 merged 1 commit intofeat/auth-layer-apply-rolesfrom
copilot/sub-pr-5
Dec 6, 2025
Merged

feat/auth layer apply roles#6
diamond2016 merged 1 commit intofeat/auth-layer-apply-rolesfrom
copilot/sub-pr-5

Conversation

Copy link
Copy Markdown

Copilot AI commented Dec 6, 2025

Implements Phase 2 of authentication layer: role-based authorization (user vs admin), creator tracking for proposals and stream analysis, and test fixture updates.

Auth & Authorization

  • Added is_admin property to User model based on role field
  • Implemented admin_required and login_required decorators for endpoint protection
  • Admin endpoints now enforce role-based access control

Data Model Changes

  • Added created_by foreign key to proposals and stream_analysis tables
  • Established user relationships for tracking resource ownership
  • Creator assignment handled in route handlers

Test Infrastructure

  • Updated conftest.py with test_user, admin_user, and login helper fixtures
  • Adjusted tests to use flush() instead of commit() for proper nested transaction handling
  • Fixed fixture parameter passing in unit and integration tests

Code Quality

  • Applied black formatting across codebase
  • Expanded Phase 2 auth-roles specification documentation

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI mentioned this pull request Dec 6, 2025
Copilot AI changed the title [WIP] Add roles management to authentication layer feat/auth layer apply roles Dec 6, 2025
Copilot AI requested a review from diamond2016 December 6, 2025 15:59
@diamond2016 diamond2016 marked this pull request as ready for review December 6, 2025 16:03
@diamond2016 diamond2016 merged commit 7348643 into feat/auth-layer-apply-roles Dec 6, 2025
1 check passed
@diamond2016 diamond2016 deleted the copilot/sub-pr-5 branch December 6, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants