Conversation
* fix: return correct users with overdue tasks in APPROVED status * refactor : add mock data in task fixture --------- Co-authored-by: Achintya Chatterjee <55826451+Achintya-Chatterjee@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
* added types file for impersonation Requests * all types and constants required for impersonation * fixed constants and types according to review comments * updated isImpersonationStarted field to isImpersonationFinished
* feat: Add short-circuit middleware to disable invite routes temporarily * fix: Temporarily skip tests for invite routes in Discord actions * fix: Correct wording in server unavailable message for disabled route
* feat: add Discord service verification and token generation * refactor: update test descriptions for discord service authorization * fix: handle missing x-service-name header in Discord bot verification * fix: correct discord service public key configuration * fix: update discord service private key configuration in token generation * fix: use HEADERS constant for service name in Discord bot authorization * refactor: update description for discord service authorization tests * fix: update test description for unauthorized token handling in discord service * fix: update service name in authorization test for cloudflare worker * fix: remove unused import in authorizeBot test file * fix: update verifyDiscordBot tests to remove unused response object * fix: update discord service authorization test to check for unauthorized response * fix: refactor response handling in discord service authorization tests * chore: fix assert statement * chore: fix import statement * chore: remove duplicate test name * refactor: add logic to handle discord service verification * refactor: remove nested if conditions * fix: handle verification based on header --------- Co-authored-by: Pankaj <pankajshadev@gmail.com>
* feat: Add discordServicePublicKey to botToken configuration * feat: Add discordServicePublicKey to botToken configuration * refactor: Remove DISCORD_SERVICE constant from bot configuration * refactor: Rename discordServiceToken to discordService and update publicKey structure --------- Co-authored-by: Amit Prakash <34869115+iamitprakash@users.noreply.github.com>
* added model,route, controller and service for creation * optimized create query handling * removed rate-limiter imports * fixed types in controllers and services * fixed query used for creating the request * fixed: small query updates and updated dev flag * fixed status type and 403 forbidden error --------- Co-authored-by: Achintya Chatterjee <55826451+Achintya-Chatterjee@users.noreply.github.com>
* added unit fixtures and tests for services, controller and middleware * fixed small comments and lint fixes * fixed tests according to route logic changes * removed unecessary any type from the file * fixed test descriptions * removed any type from variables * chore: fixed variable declerations in tests * fixed unit tests by adding stubs * chore: fixed req and res type in middleware tests * removed uneccessary beforeEach from services * fixed forbidden error response in tests --------- Co-authored-by: Amit Prakash <34869115+iamitprakash@users.noreply.github.com>
* added integration tests for create impersonation requests * nitpick: fixed small spacing issues and linting * fixed integration tests according to logic changes * fixed test descriptions * fixed error response in tests --------- Co-authored-by: Achintya Chatterjee <55826451+Achintya-Chatterjee@users.noreply.github.com> Co-authored-by: Amit Prakash <34869115+iamitprakash@users.noreply.github.com>
…equests feat: add API to fetch impersonation requests
* added unit tests for fetch logic * fixed types and small comments * fixed comments and variable types * added impersonation requests array * removed update model function from tests * removed page based pagination from tests * added new validator tests for new route --------- Co-authored-by: Achintya Chatterjee <55826451+Achintya-Chatterjee@users.noreply.github.com>
* added integration tests for get requests functionality * fixed test descriptions * fixed comments on tests and test descriptions * removed page based pagination tests * fixed tests according to new route * fixed test descriptions * fixed failing test --------- Co-authored-by: Amit Prakash <34869115+iamitprakash@users.noreply.github.com>
* added services, controllers and model for update impersonation requests * added route and fixed jsdoc * fixed bot comments and typos * removed validation service and fixed forbidden errors * removed validation service
* added unit tests for update impersonation requests * fixed tests and errors * removed validation service tests * fixed comments and tests * fixeed naming and stubbing issue in tests * added test for missing message field in validators * fixed spacing and test stub * fixed merge conflict
* added integration tests for update impersonation requests * fixed errors due to bad pull * added error handling * fixed integration tests imports and resolved comments * fixed bot comments --------- Co-authored-by: Amit Prakash <34869115+iamitprakash@users.noreply.github.com>
| let mockRequestBody = impersonationRequestsBodyData[0]; | ||
| let testUserId:string; | ||
| let impersonationRequests=[]; | ||
| const userData = userDataFixture(); |
There was a problem hiding this comment.
This line creates a duplicate declaration of userData which shadows the previous declaration at line 13. This can lead to confusion and potential bugs. Consider removing this redundant declaration to maintain a single source of truth for the variable.
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
* added functionality for start and stop of impersonation * added middleware and fixed code quality * fixed bot comments * removed unused types and fixed authentication middleware jsdoc * fixed bot comments * fixed controller import * fixed build errors * fixed failing test * used constants for 403 error * fixed jsdoc for middleware
* added unit tests for impersonation session route * fixed test identation and spacing * fixed unecessary imports and variable in tests * fixed comments on tests * fixed naming mistake in test * fixed failing test
* added integration tests for impersonation session feature * fixed linting and tests * fixed missing variable and identation * fixed tests * fixed request names * fixed spacing in tests --------- Co-authored-by: Yash Raj <yashraj0207@outlook.com>
|
Staging Proof for impersonation feature impersonation_feature_recording_postman.mp4 |
Date: June 30, 2025
Developer Name: @AnujChhikara @pankajjs @Suvidh-kaushik
Issue Ticket Number
PR's Going in this Sync
Description
Documentation Updated?
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Screenshots
Screenshot 1
Anuj.task.mp4
Test Coverage
Screenshot 1
Additional Notes
Description by Korbit AI
What change is being made?
Implement user impersonation feature with token-based authentication, new routes, middleware for validating and authorizing impersonation sessions, and extensive test suite integration.
Why are these changes being made?
To enable superusers to impersonate other users, allowing for better troubleshooting and user support. This involves creating, updating, and managing impersonation requests, with security handled via JWT tokens. The comprehensive test suite ensures functionality remains robust and errors are caught early.