Skip to content

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

vinodkiran
Copy link
Contributor

Modified controller and service methods to accept workspaceId as a mandatory parameter for operations, ensuring consistent validation across the application.

- 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.
@vinodkiran vinodkiran self-assigned this Jul 30, 2025
@vinodkiran vinodkiran requested a review from Copilot July 30, 2025 10:23
Copy link
Contributor

@Copilot Copilot AI left a 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

vinodkiran and others added 4 commits August 4, 2025 20:35
- 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.
@HenryHengZJ HenryHengZJ requested a review from Copilot August 18, 2025 14:12
@HenryHengZJ HenryHengZJ marked this pull request as ready for review August 18, 2025 14:26
Copy link
Contributor

@Copilot Copilot AI left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants