Chat with your database (SQL, CSV, pandas, polars, mongodb, noSQL, etc). PandasAI makes data analysis conversational using LLMs (GPT 3.5 / 4, Anthropic, VertexAI) and RAG.
This PR introduces a new endpoint for fetching users with access to a specific workspace and includes comprehensive tests for various scenarios.
New Endpoint: Adds a new endpoint at server/api/v1/workspaces/users.py that allows fetching a list of users with access to a given workspace. This utilizes the WorkspaceController to retrieve users by workspace ID.
Controller Update: Enhances the WorkspaceController in server/app/controllers/workspace.py with a new method get_users_by_workspace_id to support fetching users based on workspace access.
Repository Update: Updates the UserRepository in server/app/repositories/user.py with a new method get_users_by_workspace_id to query users by workspace ID.
Integration with API Router: Modifies server/api/v1/__init__.py to include the new workspaces router, facilitating access to the new endpoint.
Testing: Introduces a new test folder server/tests/workspace_users with tests covering successful access, unauthorized access, invalid workspace ID scenarios, and edge cases like an empty list of users. This ensures the endpoint behaves as expected under various conditions.
This PR introduces a new endpoint for fetching users with access to a specific workspace and includes comprehensive tests for various scenarios.
server/api/v1/workspaces/users.py
that allows fetching a list of users with access to a given workspace. This utilizes theWorkspaceController
to retrieve users by workspace ID.WorkspaceController
inserver/app/controllers/workspace.py
with a new methodget_users_by_workspace_id
to support fetching users based on workspace access.UserRepository
inserver/app/repositories/user.py
with a new methodget_users_by_workspace_id
to query users by workspace ID.server/api/v1/__init__.py
to include the new workspaces router, facilitating access to the new endpoint.server/tests/workspace_users
with tests covering successful access, unauthorized access, invalid workspace ID scenarios, and edge cases like an empty list of users. This ensures the endpoint behaves as expected under various conditions.For more details, open the Copilot Workspace session.