feat: introduce client access hierarchy management#1
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a client access hierarchy management system that enables runtime-managed organization of clients, projects, and teams. The implementation stores this hierarchy in site configurations and provides REST API endpoints for managing these entities along with their relationships to workspaces.
Key changes:
- Added data structures and SDK methods for client accounts, projects, and project teams
- Implemented REST API handlers for CRUD operations on the client access hierarchy
- Added workspace team assignment functionality to bind workspaces to teams with automatic ACL management
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| codersdk/clientaccess.go | Client SDK methods for interacting with the new client access API endpoints |
| coderd/coderd.go | REST route definitions for clients, projects, teams, and workspace team bindings |
| coderd/clientaccess_state.go | State management logic for persisting and retrieving the client access hierarchy from runtime config |
| coderd/clientaccess_handlers.go | HTTP handlers implementing CRUD operations and workspace team assignment with ACL management |
Comments suppressed due to low confidence (1)
coderd/clientaccess_handlers.go:1
- Lines 246-248 check for 404 separately before checking for non-200 status codes on line 249. Since both conditions return the same error via ReadBodyAsError, the explicit 404 check is redundant. The 404 check can be removed and line 249 will handle all non-200 status codes uniformly.
package coderd
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| project.LeaderID = *req.LeaderID | ||
| } | ||
| if req.Name != nil { | ||
| for idx, existing := range client.Projects { |
There was a problem hiding this comment.
Undefined variable client. The variable returned from findProject is stored in an unused parameter position. You need to access it through the state: for idx, existing := range state.Clients[cIdx].Projects {
| for idx, existing := range client.Projects { | |
| for idx, existing := range state.Clients[cIdx].Projects { |
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68f8f76bd4888327bf6acf6f4cca1aa9