-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(security): Add missing authorization checks to various services #5217
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
base: main
Are you sure you want to change the base?
fix(security): Add missing authorization checks to various services #5217
Conversation
|
I've added a commit to fix the failing tests |
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.
Pull Request Overview
This PR enhances security and access control across multiple API endpoints by adding authentication checks, permission validations, and sensitive data redaction.
Key Changes:
- Added user registration control based on workspace settings with superuser bypass
- Implemented authentication and authorization checks for memo-related operations
- Added client secret redaction for non-host users when retrieving identity providers
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| server/router/api/v1/user_service.go | Adds workspace setting check to control user registration with superuser override |
| server/router/api/v1/reaction_service.go | Adds authentication and ownership validation for deleting memo reactions |
| server/router/api/v1/memo_relation_service.go | Adds authentication and ownership validation for setting memo relations |
| server/router/api/v1/memo_attachment_service.go | Adds authentication and ownership validation for setting memo attachments |
| server/router/api/v1/idp_service.go | Adds authentication checks for update/delete operations and client secret redaction based on user role |
| server/router/api/v1/test/idp_service_test.go | Updates tests to use authenticated contexts and validates client secret redaction behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request fixes several security issues exploitable by low-privileged and unauthenticated users by adding missing authorization checks: