Skip to content

Commit 882be00

Browse files
committed
[local-app] Use new OAuth endpoint for login on a range of ports
Remove testing code Use correct scope for all workspaces Clean up logging + error behaviour Use tcp4 and 127.0.0.1 to avoid IPV6 issues
1 parent f96392a commit 882be00

File tree

6 files changed

+166
-290
lines changed

6 files changed

+166
-290
lines changed

components/local-app/README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,3 @@ docker run --rm -it -v /tmp/dest:/out eu.gcr.io/gitpod-core-dev/build/local-app:
1717
cd components/local-app
1818
BROWSER= GITPOD_HOST=<URL-of-your-preview-env> go run main.go --mock-keyring run
1919
```
20-
21-
## To test the OAuth server
22-
NOTE: needs to done locally as we cannot open a browser URL within a Gitpod workspace terminal atm
23-
```
24-
cd ~/
25-
mkdir -p ~/tmp
26-
docker pull eu.gcr.io/gitpod-core-dev/dev/local-app:rl-oauth
27-
docker run --rm -it -v ~/tmp:/out eu.gcr.io/gitpod-core-dev/dev/local-app:rl-oauth
28-
# assuming you are running on OSX... (use local-app-windows.exe or local-app-linux as required)
29-
GITPOD_HOST=<URL-of-your-preview-env> ./tmp/local-app-darwin test
30-
```
31-
If successful it will output an OAuth token containing a Gitpod token e.g.:
32-
```
33-
{"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjaWQiOiJHaXRwb2QgbG9jYWwgY29udHJvbCBjbGllbnQiLCJzY29wZSI6ImZ1bmN0aW9uOmdldFdvcmtzcGFjZSIsInN1YiI6IjNjMTcwZjg3LWI2MTUtNDUwNS04MDFiLTUxZjczMjc5MzI5MSIsImV4cCI6MTYyMTMzNTc0NywibmJmIjoxNjIxMjQ5MzQ3LCJpYXQiOjE2MjEyNDkzNDcsImp0aSI6IjdmYzJjZTdjOWUwNjA0MGE0ZTBmOWI1OTI0NTFiYzhhYzMyMWRhZWEzMmMzZmZiZTZmMWI4OTFmNDBmMSJ9.gLVuo2pqQNQM7JKlfl-L9FaxbyGjNzTy5RHulOrGMZQ", "expires_in":86400, "refresh_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRfaWQiOiJncGxjdGwtMS4wIiwiYWNjZXNzX3Rva2VuX2lkIjoiN2ZjMmNlN2M5ZTA2MDQwYTRlMGY5YjU5MjQ1MWJjOGFjMzIxZGFlYTMyYzNmZmJlNmYxYjg5MWY0MGYxIiwicmVmcmVzaF90b2tlbl9pZCI6InJlZnJlc2h0b2tlbnRva2VuIiwic2NvcGUiOiJmdW5jdGlvbjpnZXRXb3Jrc3BhY2UiLCJ1c2VyX2lkIjoiM2MxNzBmODctYjYxNS00NTA1LTgwMWItNTFmNzMyNzkzMjkxIiwiZXhwaXJlX3RpbWUiOjE2MjM4NDEzNDcsImlhdCI6MTYyMTI0OTM0Nn0.ioLDJhzSwO-QmepMur_yl-WFqMCkFD_pY9pczLFqA1M", "scope":"function:getWorkspace", "token_type":"Bearer"}
34-
```

components/local-app/main.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import (
2323
"github.com/gitpod-io/local-app/pkg/bastion"
2424
"github.com/gorilla/handlers"
2525
"github.com/sirupsen/logrus"
26-
"github.com/urfave/cli/v2"
27-
"github.com/zalando/go-keyring"
26+
cli "github.com/urfave/cli/v2"
27+
keyring "github.com/zalando/go-keyring"
2828
)
2929

3030
var (
@@ -75,13 +75,6 @@ func main() {
7575
},
7676
},
7777
},
78-
{
79-
Name: "test",
80-
Action: func(c *cli.Context) error {
81-
testOAuth(c.String("gitpod-host"))
82-
return nil
83-
},
84-
},
8578
},
8679
}
8780
err := app.Run(os.Args)

components/local-app/oauth.go

Lines changed: 0 additions & 208 deletions
This file was deleted.

0 commit comments

Comments
 (0)