Skip to content

Commit 1d99028

Browse files
committed
update memory bank
1 parent 1484aa2 commit 1d99028

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

memory-bank/components/gitpod-db.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The Gitpod DB component defines numerous entities that map to database tables, i
4949
- **User**: User accounts and profiles
5050
- **Workspace**: Workspace metadata and configuration
5151
- **WorkspaceInstance**: Running workspace instances
52-
- **Team**: Team organization and membership
52+
- **Team**: Represents an "Organization" within Gitpod, storing its core details, membership, and organization-level state (e.g., `maintenanceMode`). The entity is named `DBTeam` for historical reasons.
5353
- **Project**: Project configuration and settings
5454
- **Identity**: User identity and authentication
5555
- **Token**: Authentication tokens and credentials

memory-bank/components/public-api-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ The Public API Server is configured through a JSON configuration file:
120120
## Integration Points
121121

122122
The Public API Server integrates with:
123-
1. **Gitpod Server**: For core Gitpod functionality
123+
1. **Gitpod Server**: For core Gitpod functionality. The Public API Server often acts as a gRPC gateway, proxying requests to the Gitpod Server (TypeScript component) where the business logic for many `gitpod.v1` services (like `OrganizationService`) is implemented.
124124
2. **Database**: For persistent storage
125125
3. **Redis**: For caching and session management
126126
4. **Billing Service**: For billing-related operations

memory-bank/components/server.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The primary purposes of the Server component are:
2121

2222
The Server operates as an Express.js application with several key components:
2323

24-
1. **API Server**: Provides HTTP and WebSocket endpoints for client communication
24+
1. **API Server**: Provides HTTP and WebSocket endpoints for client communication. It also directly hosts and implements `gitpod.v1` gRPC services (defined in `.proto` files within `components/public-api/`) for programmatic access.
2525
2. **Authentication System**: Handles user authentication and session management
2626
3. **Database Interface**: Interacts with the database for persistent storage
2727
4. **WebSocket Manager**: Manages real-time communication with clients
@@ -94,7 +94,7 @@ The Server supports multiple authentication methods:
9494
3. **OAuth Integration**: With GitHub, GitLab, Bitbucket, etc.
9595
4. **Personal Access Tokens**: For programmatic access
9696

97-
Authorization is handled through a combination of user roles, permissions, and access controls.
97+
Authorization is handled through a combination of user roles and permissions, leveraging SpiceDB for fine-grained access control checks within its service implementations (including for gRPC services).
9898

9999
## Integration Points
100100

memory-bank/components/spicedb.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,13 @@ The schema defines various permissions for each entity type:
108108

109109
## Configuration
110110

111-
The SpiceDB component is configured through a YAML schema file:
111+
The SpiceDB component's core configuration is its schema, defined in `components/spicedb/schema/schema.yaml`. This YAML file is central to Gitpod's authorization model and specifies:
112+
- **Object Definitions**: The types of resources being protected (e.g., `user`, `organization`, `project`, `workspace`).
113+
- **Relations**: How different objects can be related to each other (e.g., an `organization` has an `owner` which is a `user`; a `project` belongs to an `org`).
114+
- **Permissions**: What actions can be performed on objects, and how these permissions are derived from relations (e.g., `permission write_settings = owner + installation->admin` for an `organization`).
115+
- **Validation & Assertions**: Rules and tests to ensure the schema's integrity and correctness.
112116

113-
```yaml
114-
schema/schema.yaml
115-
```
116-
117-
This file defines:
118-
- Entity types (user, organization, project, workspace)
119-
- Relationships between entities
120-
- Permissions derived from these relationships
121-
- Validation rules and assertions for testing
117+
New permissions (like the `maintenance` permission for organizations) are added by modifying this schema file. Other components, such as the `server` component, then use a SpiceDB client to check these permissions at runtime to authorize operations.
122118

123119
## Integration Points
124120

memory-bank/systemPatterns.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ Workspaces are treated as immutable, with changes to configuration resulting in
112112
1. **User Code**: Managed by Content Service, synchronized between workspace and git repositories
113113
2. **Configuration**: Stored in database, applied by Workspace Manager during workspace creation
114114
3. **Build Artifacts**: Cached by Image Builder for reuse in future workspaces
115-
4. **User Data**: Stored in database, accessed through Dashboard and API
115+
4. **Core Data Entities**: Key platform data (including User data, Organization/Team settings, Project details, Workspace configurations) is stored in the database (primarily MySQL, managed by `gitpod-db` component using TypeORM).
116+
* Notably, the `DBTeam` entity serves as the representation for "Organizations," storing organization-level details and settings. This is accessed via the Dashboard and various APIs.
116117

117118
## Key Technical Decisions
118119

@@ -132,6 +133,10 @@ Workspaces are treated as immutable, with changes to configuration resulting in
132133

133134
8. **Kubernetes Deployment Configuration**: All code that defines Kubernetes objects for deployable components lives in `install/installer`. This centralized approach ensures consistent deployment patterns across all components.
134135

136+
9. **Public API Architecture**: External programmatic access is provided via `gitpod.v1` gRPC services. These services are defined using Protocol Buffers (`.proto` files) located in the `components/public-api/gitpod/v1/` directory. The `server` component (TypeScript/Express.js based) directly implements and hosts these gRPC services. The `public-api-server` component (Go based) can act as an external-facing gRPC gateway.
137+
138+
10. **Authorization with SpiceDB**: Fine-grained, relationship-based access control (ReBAC) is managed by SpiceDB. The authorization schema, defining resources, relationships, and permissions, is located in `components/spicedb/schema/schema.yaml`. Service implementations (e.g., within the `server` component) query SpiceDB to enforce these permissions.
139+
135140
## Development Workflows
136141

137142
### Product Requirements Document (PRD) Workflow

0 commit comments

Comments
 (0)