Add request schemas for project endpoints#1701
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
|
There was a problem hiding this comment.
Pull request overview
This PR adds request schemas to project endpoints to exclude the tablesDatabaseToken field from API responses for security purposes.
Key Changes:
- Added response schemas to GET endpoints that omit the
tablesDatabaseTokenfield from project objects - Restructured imports to include Type, Project, and SeekPage from shared packages
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile OverviewGreptile SummaryAdded response schemas to user project endpoints to exclude the sensitive Changes:
Note: The Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Client
participant API as Project Controller
participant Service as Project Service
participant DB as Database
Note over Client,DB: GET /:id - Fetch Single Project
Client->>API: GET /v1/users/projects/:id
API->>Service: projectService.getOneOrThrow(projectId)
Service->>DB: Query project with tablesDatabaseToken
DB-->>Service: Full Project (including token)
Service-->>API: Full Project Object
Note over API: Response Schema Applied:<br/>ProjectWithoutToken removes<br/>tablesDatabaseToken field
API-->>Client: Project (without tablesDatabaseToken)
Note over Client,DB: GET / - List Projects
Client->>API: GET /v1/users/projects/
API->>Service: projectService.getOneOrThrow(projectId)
Service->>DB: Query project with tablesDatabaseToken
DB-->>Service: Full Project (including token)
Service-->>API: Full Project Object
Note over API: Response Schema Applied:<br/>SeekPage(ProjectWithoutToken)<br/>removes tablesDatabaseToken
API-->>Client: Paginated Projects (without tokens)
|



Fixes OPS-3115.
Simply added schemas to remove the token from the response