Skip to content

Commit

Permalink
Add organization id in claims (#17954)
Browse files Browse the repository at this point in the history
* add OrganizationId in claims.

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

* fix
  • Loading branch information
iQQBot authored Jun 26, 2023
1 parent dfebcc0 commit f74ba1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions components/gitpod-protocol/go/gitpod-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1682,10 +1682,11 @@ type Workspace struct {
// The source where to get the workspace base image from. This source is resolved
// during workspace creation. Once a base image has been built the information in here
// is superseded by baseImageNameResolved.
ImageSource interface{} `json:"imageSource,omitempty"`
OwnerID string `json:"ownerId,omitempty"`
Pinned bool `json:"pinned,omitempty"`
Shareable bool `json:"shareable,omitempty"`
ImageSource interface{} `json:"imageSource,omitempty"`
OrganizationId string `json:"organizationId,omitempty"`
OwnerID string `json:"ownerId,omitempty"`
Pinned bool `json:"pinned,omitempty"`
Shareable bool `json:"shareable,omitempty"`

// Mark as deleted (user-facing). The actual deletion of the workspace content is executed
// with a (configurable) delay
Expand Down
2 changes: 2 additions & 0 deletions components/public-api-server/pkg/apiv1/identityprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ func (srv *IdentityProviderService) GetIDToken(ctx context.Context, req *connect
userInfo := oidc.NewUserInfo()
userInfo.SetName(user.Name)
userInfo.SetSubject(subject)
userInfo.AppendClaims("org_id", workspace.Workspace.OrganizationId)

if email != "" {
userInfo.SetEmail(email, user.OrganizationId != "")
}
Expand Down

0 comments on commit f74ba1c

Please sign in to comment.