Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[public api] Implement GetOwnerToken rpc #10068

Merged
merged 6 commits into from
May 17, 2022
Merged

Conversation

andrew-farries
Copy link
Contributor

@andrew-farries andrew-farries commented May 17, 2022

Description

Implement the GetOwnerToken public API RPC.

Related Issue(s)

Closes #9923

How to test

  1. Obtain a stable preview environment like the one for this branch (https://af-impleme89b9aedbc7.preview.gitpod-dev.com/workspaces) (could try to use main.preview.gitpod-dev.com but it gets reset all the time).

  2. Run the public API, proxying the server JSON RPC API from the preview branch:

cd components/public-api-server
go run . --gitpod-api-url wss://af-impleme89b9aedbc7.preview.gitpod-dev.com/api/v1
  1. Start a workspace on the preview env.

  2. Run gpctl against the public API to get the owner token for the workspace we just started:

cd dev/gpctl
go run . api --address localhost:9501 --insecure --token $TOKEN workspaces ownertoken --id $WORKSPACE_ID

where $TOKEN is obtained by running:

await window._gp.gitpodService.server.generateNewGitpodToken({ type: 1, scopes: ["function:getGitpodTokenScopes",
	"function:getWorkspace",
	"function:getWorkspaces",
        "function:getOwnerToken",
	"function:listenForWorkspaceInstanceUpdates",
	"resource:default",]})

in the preview environment web console and $WORKSPACE_ID is the id of the workspace we started in step 3.

The command should return the owner token for the workspace running in the preview environment:

{"token":"O-8bE5VSR6a7G_LVNF.JMEv76iylSKOr"}

Release Notes

Implement `GetOwnerToken` rpc on the public api

Documentation

None

Andrew Farries added 6 commits May 17, 2022 14:21
Replace the stub implementation with a real one that invokes the server
JSON rpc API.
Via `go generate components/gitpod-protocol/go/gitpod-service.go`
@andrew-farries andrew-farries marked this pull request as ready for review May 17, 2022 16:05
@andrew-farries andrew-farries requested a review from a team May 17, 2022 16:05
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label May 17, 2022
@roboquat roboquat merged commit 155efaa into main May 17, 2022
@roboquat roboquat deleted the af/implement-getownertoken-rpc branch May 17, 2022 16:41
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note size/L team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement GetOwnerToken RPC on WorkspaceService
3 participants