29 Commits

Author SHA1 Message Date
Filip Troníček
3af824e603
Implement ListOrganizationPrebuilds (#19326)
* Define `ListOrganizationPrebuilds`

* Fix because of name changes

* Add unimplemented `listOrganizationPrebuilds`

* Crazy stuff right here

* Address huiwen's comments

* Fix more types

* sad™

* trrr

* WIP API changes

* Add configuration id and search term filtering

* Filtering

* Offload prebuild listing to prebuild manager

* unused thingy delete

* Add filtering by status

* `listPrebuilds` -> `listOrganizationPrebuilds`

* Configuration filtering could be done with a branch

... what do you say?

* Implement branch filtering

* Update pagination rules

* Fix pagination limit validation error

* Migrate one more

* Fix org id for prebuild listing

* Update components/gitpod-db/src/typeorm/workspace-db-impl.ts

Co-authored-by: Siddhant Khare <siddhant@gitpod.io>

* Apply code suggestions

* Align pagination with config service

* Status filter validation

* Align org id usage

* Revert back to `listPrebuilds`

* Update components/gitpod-db/src/typeorm/workspace-db-impl.ts

Co-authored-by: Siddhant Khare <siddhant@gitpod.io>

* Bring in search

* Fix proj id instead of org id

* Fix search query‽‽‽

* nit 💄

---------

Co-authored-by: Siddhant Khare <siddhant@gitpod.io>
Co-authored-by: Huiwen Huang <huiwen@gitpod.io>
2024-01-24 11:59:01 +02:00
Huiwen
230c190f35
[papi] add api to allow organization owner to create a temporary token (#19324)
* [papi] add token service to gitpod.v1

* Address feedback

* Fix spice test cases

* fix db tests
2024-01-19 10:21:55 +02:00
Huiwen
7094f19ee8
Add collaborator role to organization (#19311)
* Update spicedb schema

* SpiceDB gen code

* [server] add collaborator

* Update papi

* Dashboard

* nit

* Complete TODOs

* server dataops pass teamId

* Add test cases for collaborator's PAT and cookie API fetch

* Add test case description

* remove unnecessary export

* Redirect to dashboard after join an org

* Hide settings for collaborator

* dataops join via oidc should be collaborator

* Fix test

* Goes back to /workspaces
2024-01-12 10:53:49 +02:00
Gero Posmyk-Leinemann
1113e3cd8c
[authorization] Align HTTP handlers before RequestContext rollout (#19214)
* [middleware] RequestContext: don't error on nested contexts + ctxOnAbort

* [auth] HTTP handlers: Add FGA guards and runWithSubjectId where missing

* [code-sync] Guard with FGA
2023-12-08 13:31:15 +02:00
Sven Efftinge
0e897af454
[server] fix deleteUser permissions (#18989) 2023-10-31 21:30:38 +02:00
Gero Posmyk-Leinemann
d2adcd8e87
[spicedb] Fix application of migrations with ArgoCD (#18910)
* [spicedb] Make sure we remove the migrations job after execution

* [server] Bump RelationshipUpdater.version to 5

Reason: to trigger re-applying of all potentially broken "shared" relationships

* [spicedb] Bump version of generated types according to docker image used (v.1.25.0)
2023-10-12 11:01:20 +03:00
Gero Posmyk-Leinemann
e28a75620e
[server] SpiceDB: Add request-level caching based on AsyncLocalStorage+ZedTokens (#18893)
* [server] SpiceDB: Add request-level caching based on AsyncLocalStorage+ZedTokens

* [spicedb] Generate code for decoding DecodedZedToken (internal)
2023-10-10 09:55:18 +03:00
Manuel Alejandro de Brito Fontes
8ef82ff356
Update go modules to 1.21 (#18805) 2023-09-26 17:52:05 +03:00
Gero Posmyk-Leinemann
6552fd5e86
[spicedb] Grant all org members project "editor" role (#18733) 2023-09-18 11:55:57 +02:00
Gero Posmyk-Leinemann
0c3eb9fe96
[server] FGA checks for all admin*Workspace methods (#18569)
* [server] FGA checks for all admin*Workspace methods

* rebase artifacts
2023-08-24 09:13:49 +02:00
Sven Efftinge
7e484dc032
[fga] added create_snapshot permission (#18559) 2023-08-23 14:46:49 +02:00
Sven Efftinge
246d8eda48
[fga] check some admin functions (#18562) 2023-08-21 18:22:47 +02:00
Gero Posmyk-Leinemann
5daf36e83f
[fga] WorkspaceService.controlAdmission (#18549)
* [server] Move controlAdmission into WorkspaceService + tests

* [server] Implement Workspace sharing in FGA

* rebase adjustments
2023-08-21 08:42:47 +02:00
Sven Efftinge
820ca180ff
[fga] project visibility and prebuild perms (#18540) 2023-08-18 14:41:44 +02:00
Jean Pierre
b95a4687bf
[fga] Introduce EnvVarService (#18503) 2023-08-16 22:12:42 +02:00
Jean Pierre
6cf3aa2e26
[fga] Introduce GitpodTokenService (#18502) 2023-08-16 16:00:42 +02:00
Sven Efftinge
735bf0ec1f
[fga] more FGA checks and service use (#18517) 2023-08-15 16:50:41 +02:00
Anton Kosyakov
93ec6ab1f2
[fga] extract WorkspaceService.start (#18467)
* [server] WorkspaceService.startWorkspace

* [server] Start redis if not running

* [server] Move regionCode handling into WorkspaceService.startWorkspace

* [server] move "not-deleted" check into WorkspaceService.startWorkspace

* fix sshkey tests

---------

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
2023-08-15 12:02:44 +02:00
Manuel Alejandro de Brito Fontes
513ca768f6
Update buildkit to v0.12.1 (#18505)
* Update buildkit to v0.12.1

* Update DisplaySolveStatus signature

* Switch to github.com/containerd/typeurl/v2
2023-08-15 09:17:40 +02:00
Jean Pierre
ec7f6d614e
[fga] Introduce sshkeyservice (#18479)
* Introduce sshkeyservice

* Add read_ssh and write_ssh permissions

* add requestorId to sshkeyservice

---------

Co-authored-by: svenefftinge <sven@gitpod.io>
2023-08-11 09:48:36 +02:00
Sven Efftinge
9b06d2e1ee
[fga] migrated user service methods (#18461) 2023-08-09 09:38:35 +02:00
Gero Posmyk-Leinemann
0d36c68390
[fga] Workspace: create, get, stop and delete (#18403)
* [server] Cleanup to make tests pass

* [server] Introduce WorkspaceService with:
 - createWorkspace
 - getWorkspace
- stopWorkspace
- deleteWorkspace
- hardDeleteWorkspace

* add log info

* fix after rebase

* review comments

* address review comment: system user
2023-08-04 21:48:29 +08:00
Gero Posmyk-Leinemann
850cc04ff6
[spicedb] Small schema adjustments (#18380)
* [spicedb] Validate schema on build

* [spicedb] Small schema adjustments
2023-07-28 22:15:29 +08:00
Sven Efftinge
8b4fbb4ff5
[server] relationship updates (#18369) 2023-07-28 20:35:30 +08:00
Sven Efftinge
cae2dcc723
[server] make user a resource (#18312) 2023-07-26 16:25:43 +08:00
Sven Efftinge
e667765a18
[spicedb] generate ts definitions (#18308) 2023-07-20 15:30:36 +08:00
Sven Efftinge
8dd7c7e7ab
[server] use org service in iam-session-app (#18280) 2023-07-19 14:08:35 +08:00
Sven Efftinge
e5bba0ffef
[server] extract tested usage-service (#18260)
* [server] extract tested usage-service

* Fix runner removal script

---------

Co-authored-by: Alejandro de Brito Fontes <aledbf@gmail.com>
2023-07-14 00:49:31 +08:00
Milan Pavlik
f59c860a32
[spicedb] Add dedicated component (#18266)
* [server] Use relative path for spicedb schema

* Add spicedb component with schema

* fix

* fix

* Fix spicedb schema location

* fix

* Fix

* fix

---------

Co-authored-by: Alejandro de Brito Fontes <aledbf@gmail.com>
2023-07-12 22:38:29 +08:00