147 Commits

Author SHA1 Message Date
Nandaja Varma
4bd992439c
[oidc] Fix the HEAD method call that checks reachability (#20474)
* [oidc] Fix the HEAD method call that checks reachability

* [server] Fix setup flow

---------

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
2024-12-20 03:01:05 -05:00
mustard
6c7bf1b976
[papi] fix unit tests for workspaces service (#20406) 2024-11-30 02:52:07 -05:00
mustard
83bfa202ca
[papi] add editor info to experimental.v1 (#20405)
* Update proto

* proto gen

* protocol update

* convert ide config

* proto def +1

* proto gen +1

* papi impl +1

* impl + 2

* Update components/public-api-server/pkg/apiv1/workspace.go

Co-authored-by: iQQBot <tianshi8650@gmail.com>

---------

Co-authored-by: iQQBot <tianshi8650@gmail.com>
2024-11-29 16:08:06 -05:00
Gero Posmyk-Leinemann
feb6058859
[idp] Guarantee stable email address for IDP token for organization-bound users (#20199) 2024-09-12 04:14:57 -04:00
Gero Posmyk-Leinemann
4524c19868
[OIDC] IDP: use workspace.context.normalizedContextUrl to fill the "sub" and "context" claims of the IDToken (#20111)
The motivation is to have more uniform URL shapes to match against e.g. across different IDEs.
2024-08-13 10:41:15 -04:00
Pudong
5ebe1cca85
Add PKCE support for OIDC (#20094) 2024-08-08 03:53:46 -04:00
Huiwen
c4b53f9320
Support validate claims with CEL expr for SSO (#20083)
* [papi] proto update

* [dashboard] nit TODO

* [papi] implement cel expression verify

* drop me: Add debug logs

* 1

* tidy

* export cel error message

* 💄 dashboard

* improve error

* nit doc
2024-08-07 02:33:45 -04:00
Gero Posmyk-Leinemann
6dcbc99e49
[cleanup] Remove various feature flags I (#19884)
* [dashboard] Drop newProjectIncrementalRepoSearchBBS

* [dashboard] Remove doRetryUserLoader feature flag

* [server, dashboard] Drop feature flag phoneVerificationByCall

* [public-api, dashboard] Remove personalAccessTokensEnabled feature flag

* [papi] Fix more tests
2024-06-13 17:18:09 +08:00
Huiwen
5ff4535ac5
Add scope flag to idp commands (#19727)
* Add `scope` flag to idp commands

* fix flag inherit
2024-05-15 16:27:53 +08:00
Pudong
6c7544ebca
[idp] improve idp (#19647)
* [idp] add repository claim

* [idp] add missing `use` field for key cache

* [idp] simplify logic for `idp token --decode` command

* [idp] add `gcloud-token` command

* Apply suggestions from code review

Co-authored-by: Huiwen <mhqnwt@gmail.com>

---------

Co-authored-by: Huiwen <mhqnwt@gmail.com>
2024-04-23 09:59:01 +02:00
Huiwen
394dcae20f
[papi,server] implement restricted_workspace_classes in server (#19481)
* [papi,server] implement `restricted_workspace_classes` in server

* Fix test case input

* nit
2024-02-28 22:37:09 +02:00
Huiwen
9719e619be
[IdP] add user_id claim and allow to customize OIDC subject via FF (#19455)
* [papi] add user_id field to idp token

* [idp] allow to customize claim keys

* fixup update FF

* Update splitor and add more unit tests
2024-02-22 19:03:03 +02:00
Alex Tugarev
0907ff51e1
[server] remove obsolete and unused getSuggestedContextURLs (#19074)
* [server] remove obsolete and unused `getSuggestedContextURLs`

* fixup papi
2023-11-16 13:17:54 +02:00
Anton Kosyakov
cf7d0e9500
remove supervisor_live_git_status (#18921)
and deprecated instance.status.repo
2023-10-16 17:20:24 +03:00
Huiwen
eaef991c83
[papi] add ListTeamMembers and GetTeamInvitation APIs (#18919)
* [papi] add ListTeamMembers and GetTeamInvitation APIs

* fix server build
2023-10-13 18:01:21 +03:00
Brad Harris
0f926eb721
adding missing fields to CreateAndStartWorkspace (#18874)
* adding some missing fields to CreateAndStartWorkspace

* updated mocks
2023-10-06 02:27:14 +03:00
Alex Tugarev
b2260d021e
Migrate Prebuild settings – EXP-672 (#18842)
* [protocol] Add PrebuildSettings to ProjectSettings

* add migration function

* add migration function and test

* update protocol helper functions

* update prebuild manager

* use new prebuild setting in frontend

* update papi

* fix papi test

* rename var

* fix papi mapping

* deprecation note

* update migration function

* fix prebuild-manager

* fixup server

* fix Enable Prebuilds on Project Settings

* Use Project.getPrebuildSettings
and

* fix countUnabortedPrebuildsSince

* improve usage of default settings

* fix Build Branches select

* fix papi conversion 🤯

* don't save empty pattern strings

* fix papi-server conversion and align naming of prebuild settings

* fix getPrebuildSettings

* [prebuilds] changed prebuild semantics

- no more incremental prebuilds
- always incremental workspace
- never wait for running prebuilds

---------

Co-authored-by: svenefftinge <sven@gitpod.io>
2023-10-05 17:37:13 +03:00
Alex Tugarev
df155ad0e9
Match branch names by pattern – EXP-575 (#18734)
* turn text input into select input

* mimic old behavior for pre-existing projects

* explicit settings under the project should have precedence

* add PrebuildBranchPattern to project settings

* add branch name pattern to project settings page

* fixup c&p error

* match branch names by glob pattern

* fix pattern matching

* fix project settings form

* fix initial value for prebuildBranchPattern

* adding more tests

* add globstar tes

* fixup rebase error

* Apply suggestions from code review

Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>

* fine tune debounce wait

---------

Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>
2023-09-22 13:57:01 +02:00
Alex Tugarev
252992223d
Add prebuildDefaultBranchOnly setting – EXP-574 (#18716)
* add `prebuildDefaultBranchOnly` to `Project.settings`

* evaluate prebuildDefaultBranchOnly in PrebuildManager

* add "Prebuild the default branch only" checkbox

* fix missin PAPI mapping 🤯

* fix PrebuildDefaultBranchOnly in gitpod-service.go

* turn text input into select input

* update styles on project settings page

* mimic old behavior for pre-existing projects

* use getPrebuildBranchStrategy in PrebuildManager

* add tests for PrebuildManager.prebuildPrecondition

* fix getPrebuildEvents

* explicit settings under the project should have precedence

* render changes to project settings immediately
2023-09-22 11:59:01 +02:00
Huiwen
62c573a453
Add default image get to PAPI and improve Dashboard (#18767)
* [server] update getDefaultWorkspaceImage api

* [dashboard] api usage update

* [protocol] add go definition

* [papi] add getDefaultWorkspaceImage method

* fixup

* [dashboard] add org image warning to start workspace page

* fix error wrap

* Update supervisor to use publicApi

* [dashboard] always show default image and remove tag width limit

* fixup

* move new warning to StartPage

* Update components/dashboard/src/teams/TeamSettings.tsx

Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>

* Address feedback

---------

Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>
2023-09-22 11:58:01 +02:00
Alex Tugarev
cb3a7f00c6
Add "Enable Prebuilds" to Project Settings – EXP-573 (#18698)
* cleanup: remove obsolete remainings of /prebuild prefix

* Add Project.settings.enablePrebuilds

* PrebuildManager.shouldPrebuild to consider Project.settings.enablePrebuilds

* Don't install webhooks on project creation

* foreseeable change: don't prefetch project details

* fix: unused imports

* redirect to project settings on project created

* don't trigger prebuilds on project created

* fix: get rid of many ListProjects requests on Settings page

* Project Settings: add checkbox for "enable prebuilds"

* handle "enable prebuilds" in server

* updating PAPI

* fixup

* fixup

* make PrebuildManager require a Project to work on

* also SCM webhook handlers
* move project usage registration to PrebuildManager

* address feedback on useListProjectsQuery and  useCurrentProject

* remove empty class name attributes

* make use of <InputField> as wrapper for <SelectWorkspaceClassComponent>

* fixup <SelectWorkspaceClassComponent> width

* update hint on "Enable Prebuilds" action

Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>

* fix "enablePrebuild" handling

* add [Enable Prebuilds] button to "Project Created" page

* show detailed prebuild setting only if prebuilds are enabled

* drive-by: fix max width on "Remove Project"

* fix: re-add `loading` state to `useCurrentProject` hook

this caused an issue with loading components as `useListProjectsQuery.isLoading` is false initially.

* add "Enable Prebuilds" to project card

* fixup project-context.tsx

state should only be updated if `useListProjectsQuery` is loaded.

* fixup button type

* add hint to create a .gitpod.yml

* Apply suggestions from code review

Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>

* remove unnecessary !

* extract Project.isPrebuildsEnabled

* fixup: add missing await

* render "Learn more" if not enabled, too.

* fix getCloneUrl for BBS

* fix getCloneUrl for GitLab

---------

Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>
2023-09-15 09:07:54 +02:00
Sven Efftinge
71912f721b
Allow renaming project (#18630)
remove project#slug
2023-09-04 09:42:01 +02:00
Filip Troníček
694f8eaeaf
[papi] List workspace classes (#18546)
* [papi] List workspace classes

Adds the `ListWorkspaceClasses` method on `WorkspacesService`.

* Add test for class listing

* `Title` -> `DisplayName`

* fix rename in tests

* Update generated
2023-08-24 10:53:50 +02:00
Brad Harris
adf4e66cf6
Add CreateAndStartWorkspace to public-api (#18515)
* setting up CreateAndStartWorkspace handler

* adjust args

* adding createWorkspace scope for desktop app

* add getToken scope to desktop app oauth client

* remove for now

* adding region

* adding getToken while in here
2023-08-23 16:06:49 +02:00
Filip Troníček
112eefcc56
[papi] List editor options (#18530)
* options.init

* Respond with options

* Move to editor service

* Unused imports

* Mount ot the correct service

* Sort by orderkey

* Simplify enum name

* Add tests

* Options -> `result` for consistency

* fix result field
2023-08-18 11:19:44 +02:00
Filip Troníček
614007dde5
[papi]: Add GetSuggestedRepoURLs (#18514)
* [papi]: Add `GetSuggestedRepos`

* Rename method

* req to be consistent

* Move to SCMService

* Remove usr impl

* Add tests

* Revert billing test change

* Revert user changes

* --
2023-08-15 13:55:41 +02:00
Anton Kosyakov
b3ae12f956
git real time (#18323) 2023-08-03 20:51:28 +08:00
Filip Troníček
c5059f2dc3
Filter by organizationId in ListWorkspaces (#18402)
Remove `IncludeWithoutProject`
2023-08-02 05:20:27 +08:00
Filip Troníček
d9f8a099ed
Add Repository to WS info in Public API (#18330)
* Add more Git details to Public API

* Only add `Repository`

* Remove remaining branch references

* Update workspace tests

* Remove additional unneeded metadata

* Swap arg order to match proto
2023-07-26 16:20:42 +08:00
Alex Tugarev
5fcd4e418b
Hide Invite Members button from non-owners – WEB-611 (#18320)
* [Orgs] Hide Invite Members button from non-owners

* [server] Invites to Org should be limited to owners.

* [papi] ignore permission denide for GetGenericInvite for non-owners

The `inviteId` is nil/undefined then.
2023-07-25 20:32:41 +08:00
Huiwen
d32e231773
[public-api] align context url with server (#18292)
* [public-api] align context url with server

* 💄

* update test case

* Update test case
2023-07-20 20:53:36 +08:00
Milan Pavlik
9f51b6134b
[public-api] Remove db debug from OIDC tests (#18252)
* [public-api] Remove db debug from OIDC tests

* fix
2023-07-12 16:02:28 +08:00
Jean Pierre
d57a39dbad
[public-api] Update getWorkspace api response implementation (#17821)
* Update getWorkspace api response implementation

* Only implement recent_folders

* Add additional tests
2023-07-06 01:24:22 +08:00
Sven Efftinge
caf26b812d
[server] remove getUserProjects (#18093) 2023-06-29 16:30:47 +08:00
Pudong
f74ba1cbc3
Add organization id in claims (#17954)
* add OrganizationId in claims.

* Update components/gitpod-protocol/go/gitpod-service.go

* fix
2023-06-26 16:37:50 +08:00
Milan Pavlik
fcb8c5f79d
[papi] Extract JWT cookie when extracting creds (#17875)
* [papi] Extract JWT cookie when extracting creds

* fix

* fix

* fix

* Fix

* fix

* Update components/public-api-server/pkg/auth/middleware.go

Co-authored-by: Gero Posmyk-Leinemann <32448529+geropl@users.noreply.github.com>

---------

Co-authored-by: Gero Posmyk-Leinemann <32448529+geropl@users.noreply.github.com>
2023-06-14 15:37:04 +08:00
Pudong
4aede056ab
[IDP] set email_verified to false if user is not org-owned user (#17896)
* set email_verified to false if user is not org-owned user

* update test
2023-06-12 18:46:03 +08:00
Jean Pierre
6652c98a1a
Add WorkspaceUpdates method (#17728)
* Add WorkspaceUpdates method

* Replace InstanceUpdates
2023-05-30 23:56:04 +08:00
Milan Pavlik
321da4322e
[gitpod-db] Rename Go definitions from Teams to Organizations (#17763)
* [gitpod-db] Rename Go definitions from Teams to Organizations

* fix

* fix

* Fix

* fix

* Fix
2023-05-30 19:09:04 +08:00
Jean Pierre
2c8852e197
[public-api] Add startWorkspace api (#17682)
* Add startWorkspace api

* Add new scopes to vscode client

* Fix

* Fix

* 💄

Co-authored-by: Milan Pavlik <milan@gitpod.io>

---------

Co-authored-by: Milan Pavlik <milan@gitpod.io>
2023-05-25 03:43:58 +08:00
Alex Tugarev
d52ba759ae
Implement deactivation of OIDC client configs – WEB-333 (#17659)
* [papi] implement deactivation of OIDC client configs

* fix: add test for record not found

* simplify db.SetClientConfigActiviation
2023-05-22 19:55:56 +08:00
Christian Weichel
36905ac004
[idp] Add email to ID token (#17678)
* [idp] Add email to ID token

* [idp] Claim that the email is verified

which is a valid claim because it's verified by the original IDP,
and this is not the user-editable value.

* Incorporate review feedback
2023-05-19 22:07:53 +08:00
Pudong
176393a0c8
Add support to forward https protocol port (#17644)
* add support to forward https protocol port

* Update components/ws-proxy/pkg/proxy/routes.go

Co-authored-by: Kyle Brennan <kyle@gitpod.io>

---------

Co-authored-by: Kyle Brennan <kyle@gitpod.io>
2023-05-19 15:22:53 +08:00
Alex Tugarev
7952153237
Add verify param to OIDC start request – WEB-333 (#17576)
* [papi] Add `verified` flag to config and `ActivateClientConfig` to OIDC service

* [papi] implement `ActivateClientConfig`

* [gitpod-db/go] add `setClientConfigVerifiedFlag`

* [gitpod-db/migration] add `d_b_oidc_client_config.verified` field

* [papi] Don't deactive on UpdateClientConfig

* [gitpod-db/go] add missing `Verified` field

* On "activate" request also mark as verified.

* [gitpod-db/go] fix mapping of `Verified` field

* [papi] ensure only verified OIDC client configs can be activated

* [papi] Skip the sign-in on verify-only requests.

* [papi] fix skipped tests

* [papi] fix mapping of OIDC configs

* rename RPC method

* fix tests after adding validation of claims

* fix: activation of record should deactivate others

* fix: update should unverify the entry

* remove Debug()

* [db-migration] fix: mark active entries as verified
2023-05-16 21:09:02 +08:00
Milan Pavlik
89e9ad0075
[sso] Validate Issuer URL + fix trailing slash WEB-345 (#17623)
* [sso] Fix trailing slash in issuer

* fix

* fix

* fix
2023-05-16 16:08:01 +08:00
Sven Efftinge
b7d01a7e25
Disallow deletion of teams (#17538) 2023-05-10 22:25:55 +08:00
Sven Efftinge
606e74f6c7
[dashboard] invite link for SSO orgs (#17478) 2023-05-05 17:59:43 +08:00
Milan Pavlik
c1a5e53134
[oidc] Restrict actions to team owners (#17470) 2023-05-03 14:20:41 +08:00
Milan Pavlik
4e983b7998
[public-api] Implement UpdateOIDCClientConfig WEB-278 (#17464)
* [public-api] Implement UpdateOIDCClientConfig

* fix

* fix

* fix

* fix

* fix

* fix
2023-05-02 23:48:40 +08:00
Alex Tugarev
76c61533a6
[OIDC] Enable mark client config as "active" (#17365)
* [gitpod-db] Add `d_b_oidc_client_config.active` field

* [papi] Add OIDCClientConfig.active to proto def

* [gitpod-db] Add OIDCClientConfig.active

* [papi] Add `activate` param to `/oidc/start` endpoint handler

If provided it should mark the OIDC client config as `active` in the DB.

* Fix propagation of state params and add tests.

* fix import of deprecated ioutil

* refactor GetStartParams

* consider `activate` from create request
2023-04-27 21:35:36 +08:00