-
Notifications
You must be signed in to change notification settings - Fork 0
Implement user role management with RBAC and fix Docker Cloud Build workflow #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
… endpoints, JWT auth, and tests Co-authored-by: Neiland85 <164719485+Neiland85@users.noreply.github.com>
…e workflow configuration Co-authored-by: Neiland85 <164719485+Neiland85@users.noreply.github.com>
Co-authored-by: Neiland85 <164719485+Neiland85@users.noreply.github.com>
Neiland85
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! all new config it's done!
|
Closing this PR. The changes no longer align with the updated architecture and dependency model introduced in the December 2025 refactor. This contribution is now obsolete and would add noise rather than value to the current codebase. |
Adds role-based access control (RBAC) infrastructure with JWT authentication and fixes the failing Docker Cloud Build & Push workflow by specifying the correct Dockerfile path and skipping registry push on pull requests.
Database & Models
app/database.pyAPI Endpoints
REST API at
/api/roles:GET /roles- list roles (paginated)POST /roles- create role (validates unique name)GET /roles/{id}- get role by UUIDPUT /roles/{id}- update roleDELETE /roles/{id}- delete roleAll endpoints require API key authentication.
Authentication & Authorization
Enhanced
app/auth/dependencies.py:create_access_token()- generates JWT with 30min expirationget_current_user()- validates JWT, loads user with role relationshiprequire_role(*roles)- decorator factory for flexible role checksadmin_only,customer_only,auditor_onlyExample usage:
Docker Workflow Fix
Created
docker/Dockerfile.api:/opt/venv/bin)/healthendpointUpdated
.github/workflows/production-pipeline.yml:file: ./docker/Dockerfile.apito both docker-security and docker-cloud-build jobspush: ${{ github.event_name != 'pull_request' }}to prevent registry push on PRsDependencies
sqlalchemy==2.0.36- ORM and database toolkitpsycopg2-binary==2.9.10- PostgreSQL adapterpython-jose[cryptography]==3.4.0- JWT tokens (fixes CVE-2024-33663)passlib[bcrypt]==1.7.4- password hashingemail-validator==2.2.0- email validation for PydanticTests
16 new tests covering role CRUD, JWT auth, password hashing, role validation, and access control. All 23 tests passing with 0 CodeQL alerts.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.