fix: return 403 Forbidden for unauthorized extension request updates#230
Conversation
Summary by CodeRabbit
WalkthroughThis pull request updates the error handling for the Changes
Sequence Diagram(s)sequenceDiagram
participant C as Client
participant S as API Server
C->>S: PATCH /extension-requests/:id
S->>S: Verify user permissions
alt Insufficient permissions
S-->>C: 403 Forbidden (JSON with details)
else Sufficient permissions
S-->>C: Proceed with update (not shown)
end
Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
|
||
| - **Error Response:** | ||
| - **Code** 403 | ||
| - **Content** `{ 'statusCode': 403, 'error': 'Forbidden', 'message': 'You don't have permission to update the extension request' }` |
There was a problem hiding this comment.
again, I think the error messsage should be changed
There was a problem hiding this comment.
Thanks for the suggestion! I believe the original message is more appropriate here since it's about permissions, not missing content.
Date: 3 April 2025
Developer Name: @AnujChhikara
Issue Ticket Number
Description
This PR updates the PATCH /extension-requests/:id API contract by adding a 403 Forbidden response
Documentation Updated?
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Screenshots
Screenshot 1
Test Coverage
Screenshot 1
Additional Notes