-
-
Notifications
You must be signed in to change notification settings - Fork 22k
Require workspace ID in various controllers and services #4981
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?
Conversation
- Added validation to ensure `activeWorkspaceId` is present in user requests for all API key operations (get, create, update, import, delete). - Updated `getWorkspaceSearchOptions` and `getWorkspaceSearchOptionsFromReq` to throw an error if `workspaceId` is not provided. - Modified service methods to enforce `workspaceId` as a required parameter for database operations related to API keys.
…aces and services - Updated various interfaces to make `workspaceId` a mandatory field instead of optional. - Enhanced assistant and export-import service methods to require `workspaceId` for operations, ensuring proper validation and error handling. - Modified database entity definitions to reflect the change in `workspaceId` from optional to required. - Improved error handling in controllers to check for `activeWorkspaceId` before proceeding with requests.
- Updated controllers for credentials, datasets, document stores, evaluations, evaluators, and variables to enforce the presence of `workspaceId`. - Enhanced error handling to throw appropriate errors when `workspaceId` is not provided. - Modified service methods to accept `workspaceId` as a mandatory parameter for operations, ensuring consistent validation across the application.
… retrieval - Modified the runAdditionalEvaluators function to accept workspaceId as a parameter.
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 enforces workspace ID validation across the application by making workspaceId
a mandatory parameter in controller and service methods. The changes ensure consistent workspace isolation and proper authorization checks.
Key changes:
- Modified database entity schemas to make
workspaceId
non-nullable - Updated service methods to require
workspaceId
as a mandatory parameter - Added workspace validation in controllers with proper error handling
- Enhanced utility functions to throw errors when workspace ID is missing
Reviewed Changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
Database entities | Changed workspaceId from optional to required field |
Service layer methods | Added mandatory workspaceId parameters to all CRUD operations |
Controller methods | Added workspace validation with error handling |
Utility functions | Enhanced workspace search options to validate required workspace ID |
Interface definitions | Updated type definitions to reflect mandatory workspace requirements |
- Updated chatflow and flow-config controllers to require workspaceId for fetching chatflows. - Modified service methods to accept workspaceId as a parameter, ensuring proper context for chatflow retrieval.
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 encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Modified controller and service methods to accept
workspaceId
as a mandatory parameter for operations, ensuring consistent validation across the application.