239 Commits

Author SHA1 Message Date
Filip Troníček
624c79f9f7
Respond to /idp/keys with JSON (#17789)
* Set JSON mimetype for `/idp/keys`

* Fix typos

* Test for header presence

* Assert JSON for ` /.well-known/openid-configuration` as well
2023-05-31 14:45:05 +08:00
Jean Pierre
6652c98a1a
Add WorkspaceUpdates method (#17728)
* Add WorkspaceUpdates method

* Replace InstanceUpdates
2023-05-30 23:56:04 +08:00
Milan Pavlik
056ba722f7
[server] Issue JWT cookie in IAM Sessions for OIDC sign-in (#17762) 2023-05-30 22:54: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
Alex Tugarev
a62aceeb1f
[oidc] Forward errors through /complete-auth endpoint (#17753) 2023-05-26 22:28:00 +08:00
Alex Tugarev
ae9d418e7c
[papi] Start request should search for single Org with active SSO (#17761) 2023-05-26 18:16:00 +08:00
Alex Tugarev
c8c4c3bda9
Root out obsolete self-hosted setup (#17729) 2023-05-25 15:44:59 +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
Milan Pavlik
12b2e2d116
[papi] Remove rogue print from PAT tests (#17663) 2023-05-19 17:17: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
Alex Tugarev
02ce06638c
[papi] validate ID token claims – WEB-337 (#17615)
* [papi] validate ID token claims

Some claims (e.g. email, name) are required. While it's defaults with most IdPs, some require manual configuration to make those claims appear in ID tokens.

* add test cases
2023-05-16 15:56:01 +08:00
Milan Pavlik
5333826686
[sso] Improve SSO dance logs & user facing error messages WEB-300 (#17570)
* [sso] Improve SSO dance logs & user facing error messages

* Fix
2023-05-15 15:18:00 +08:00
Anton Kosyakov
0ba64e3d3e
[public-api] refine mapping of json rpc error codes (#17591)
* [public-api] refine mapping of json rpc error codes

- map 4xx and 650 codes as invalid argument (client errors)
- map 401, 411 related to unauthedicated and permission denied
- mapp 429 to resource exhausted

* Update errors.go
2023-05-12 16:09:57 +08:00
Sven Efftinge
b7d01a7e25
Disallow deletion of teams (#17538) 2023-05-10 22:25:55 +08:00
Alex Tugarev
9266c7617c
[papi] select active OIDC config for start request – WEB-316 (#17518)
* [papi] select active OIDC config for start request

* rename GetActiveOIDCClientConfigByOrgSlug

* add CreateTeams helper

* [papi] Ensure activation of SSO config deactivates previous one

* applied PR review comment
2023-05-10 19:56:55 +08:00
Robo Quat
2cd57728ae
update index (#17474)
Co-authored-by: roboquat <roboquat@users.noreply.github.com>
2023-05-08 18:46:46 +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
7ef79efd91
[SSO] Use ClientConfigID & Subject as composite key for identities WEB-279 (#17463)
* [SSO] Use ClientConfigID & Subject as composite key for identities

* Add tests for CreateSession
2023-05-02 21:09:40 +08:00
Robo Quat
ae59069ecf
update index (#17443)
Co-authored-by: roboquat <roboquat@users.noreply.github.com>
2023-05-02 14:37:40 +08:00
Christian Weichel
8ed7b7d8a2
Repersist IDP public key when lost (#17422)
e.g. because Redis restarted.
2023-05-02 13:54:40 +08:00
Sven Efftinge
cbd56c2592
Frictionless login for dedicated (#17432) 2023-05-02 02:12: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
Manuel Alejandro de Brito Fontes
c407cafe2e
Add new github action to update container images digest (#17349)
* Add new github action to update container images digest

* Add latest tag to dockerfiles

* Update .github/workflows/update-image-digest.yml

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

---------

Co-authored-by: Milan Pavlik <milan@gitpod.io>
2023-04-26 21:13:34 +08:00
Milan Pavlik
0dc46c5bcc
[public-api] Measure incoming JWT Sessions - WEB-102 (#17345)
* retest

* retest

* [installer] Add cookie name to config

* Fix

* retest

* [installer] Add cookie name to config

* [public-api] Measure incoming JWT Sessions

* fix

* Fix

* Fix

* fix

* retest
2023-04-24 21:34:45 +08:00
Milan Pavlik
d9ccc1d141
[papi] OIDC service signs state with HS256, reusing signing PK - WEB-206 (#17328)
* [papi] OIDC service signs state with RSA256

* Fix

* retest

* fix

* add test
2023-04-24 17:14:45 +08:00
Milan Pavlik
d069f76edc
[public-api] Refactor JWT Sign/Verify to be reusable for OIDC - WEB-206 (#17327)
* [public-api] Refactor JWT Sign/Verify to be reusable for OIDC

* fix
2023-04-24 15:14:45 +08:00
Milan Pavlik
4f55ce16da
[public-api] JWT Signer & Verifier WEB-101 (#17308)
* [public-api] JWT Signer & Verifier

* upgrade other to v5
2023-04-21 17:32:42 +08:00
Alex Tugarev
d7480d1cd4
[papi] check for OIDC Discovery support (#17268) 2023-04-20 13:51:52 +08:00
Manuel Alejandro de Brito Fontes
891cd5417d
Update k8s dependencies to v0.26.2 (#17211)
* Update k8s dependencies to v0.26.2

* Update controller-runtime to v0.14.6

* Update cloud storage
 https://github.com/googleapis/google-cloud-go/issues/6857

* Update copy options

* Update wolfi image

* Remove controller-runtime replace directives

* Fix integration tests
2023-04-18 03:59:49 +08:00
Manuel Alejandro de Brito Fontes
27979c9395
Update go dependencies (#17101)
* Update go dependencies

Signed-off-by: Manuel de Brito Fontes <aledbf@gmail.com>

* Update runc to v1.1.5

* Update docker cli to v23.0.2+incompatible

---------

Signed-off-by: Manuel de Brito Fontes <aledbf@gmail.com>
2023-04-12 10:03:52 +02:00
Milan Pavlik
51d1f65a47
[stripe] Actually call the billing service 🤦 (#17175) 2023-04-12 09:57:51 +02:00
Milan Pavlik
fc1ca336f7
[stripe] Re-use constants for event types (#17161) 2023-04-12 09:20:52 +02:00
Milan Pavlik
e001690ad1
[public-api] Fix panic due to incorrect err ref (#17113) 2023-03-31 13:47:40 +02:00
Milan Pavlik
27083dfab1
Upgrade to connect-go 1.5.2 (#17108)
* Upgrade to connect-go 1.5.2

* fix
2023-03-31 13:09:40 +02:00
Milan Pavlik
45cf0d2319
[public-api] Explicit panic handler (#17105) 2023-03-31 10:03:40 +02:00
Alex Tugarev
7ecc196baa
Sign in with SSO (#17055)
* [experiment] Add "Sign in with SSO" to Login

Reusing existing parts:
 * `/complete-auth` page of Dashbaord to forward results of authN flows running in a modal
 * Adding preliminary UI to the Login view: Org-slug and simple button.

* [gitpod-db] get team/org by slug

* [gitpod-db] fix OIDCClientConfig.OrganizationID field's type

* [oidc] consider returnTo URL

* [oidc] consider orgSlug param from start request

* [oidc] fix oauth2 clientId propagation

* [oidc] fix a flaky test

* [onboarding] skip for organizational accounts

* Move SSO Login UI into it's own component

* adjust validation a bit, add useCallbacks

* adding GetOIDCClientConfigByOrgSlug

* add table name

* removing commented out code

---------

Co-authored-by: Brad Harris <bmharris@gmail.com>
2023-03-29 15:49:39 +02:00
Milan Pavlik
c0cd571e78
[usage] Add OnChargeDispute rpc definition (#17036)
* [usage] Add OnChargeDispute rpc definition

* [public-api] Setup handler for charge.dispute.created (#17034)

* [public-api] Setup handler for charge.dispute.created

* fix

* fix

* fix
2023-03-27 15:59:25 +02:00
Alex Tugarev
275e782341
[Orgs] Persist slug (#16923)
* [orgs] Persist `slug`

* [Orgs] Make `slug` changeable on Settings page

* update to use input/button components and mutation

* [papi] Re-add Team.slug

---------

Co-authored-by: Brad Harris <bmharris@gmail.com>
2023-03-24 10:51:16 +01:00
Milan Pavlik
b1ab625626
[public-api] Cleanup logging middleware (#16928) 2023-03-21 10:17:13 +01:00
Brad Harris
ff079b96fa
Org SSO Page updates (#16868)
* Breaking SSO page into components & react-query

* wrapper component not needed anymore

* position off of bottom instead

* add a heading/subheading for consistency

* add clientside validation

* adding oidcConfig.issuer to api response

* updating test

* minor cleanup
2023-03-16 21:59:08 +01:00
Milan Pavlik
59e58f96c1
[common-go] Composable log fields (#16860)
* [common-go] Composable log fields

* add test for compose

* use in public api

* fix

* fix
2023-03-16 20:57:08 +01:00
Milan Pavlik
59ff034d6f
[public-api] Use context logger (#16686)
* Fix

* Fix

* Fix

* Fix

* Fix

* [public-api] Use context logger

* fix

* Fix

* fix

* Fix

* fix

* fix

* fix

* fix

* fix

* Fix

* fmt

* fix

* retest
2023-03-15 13:52:07 +01:00
Milan Pavlik
6291b6ce90
[public-api] List teams concurrently (#16848)
* [public-api] List teams concurrently

* Fix
2023-03-15 09:00:07 +01:00
Milan Pavlik
7d8180aae9
[db] Setup go db tracing (#16706)
* [installer] Do not pull blobserve implementation into installer

* fix

* Fix

* [db] Setup go db tracing

* fix

* Fix

* fix

* Fix
2023-03-10 09:23:46 +01:00