-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50532b8
commit 7cf9966
Showing
11 changed files
with
39 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
components/ide/jetbrains/toolbox/src/main/kotlin/SampleGatewayExtension.kt
This file was deleted.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
components/ide/jetbrains/toolbox/src/main/kotlin/SampleRemoteEnvironment.kt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package toolbox.gateway.sample.io.gitpod.toolbox | ||
package io.gitpod.toolbox.data | ||
|
||
import com.connectrpc.Interceptor | ||
import com.connectrpc.ProtocolClientConfig | ||
|
@@ -12,7 +12,7 @@ import com.connectrpc.protocols.NetworkProtocol | |
import io.gitpod.publicapi.v1.WorkspaceServiceClient | ||
|
||
class GitpodPublicApiManager { | ||
private val sharedClient = createClient("gitpod.io", "aaaa") | ||
private val sharedClient = createClient("gitpod.io", "TODO: input your pat token here WITHOUT push to repo") | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mustard-mh
Author
Contributor
|
||
|
||
val workspaceApi = WorkspaceServiceClient(sharedClient) | ||
|
||
|
@@ -38,7 +38,14 @@ class GitpodPublicApiManager { | |
|
||
class AuthorizationInterceptor(private val token: String) : Interceptor { | ||
override fun streamFunction(): StreamFunction { | ||
TODO("Not yet implemented") | ||
return StreamFunction( | ||
requestFunction = { request -> | ||
val headers = mutableMapOf<String, List<String>>() | ||
headers.putAll(request.headers) | ||
headers["Authorization"] = listOf("Bearer $token") | ||
return@StreamFunction request.clone(headers = headers) | ||
}, | ||
) | ||
} | ||
|
||
override fun unaryFunction(): UnaryFunction { | ||
|
4 changes: 2 additions & 2 deletions
4
...n/kotlin/SampleEnvironmentContentsView.kt → .../gateway/GitpodEnvironmentContentsView.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodGatewayExtension.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.gitpod.toolbox.gateway | ||
|
||
import com.jetbrains.toolbox.gateway.GatewayExtension | ||
import com.jetbrains.toolbox.gateway.RemoteEnvironmentConsumer | ||
import com.jetbrains.toolbox.gateway.RemoteProvider | ||
import com.jetbrains.toolbox.gateway.ToolboxServiceLocator | ||
import kotlinx.coroutines.CoroutineScope | ||
|
||
class GitpodGatewayExtension : GatewayExtension { | ||
override fun createRemoteProviderPluginInstance(serviceLocator: ToolboxServiceLocator): RemoteProvider { | ||
return GitpodRemoteProvider( | ||
serviceLocator.getService(RemoteEnvironmentConsumer::class.java), | ||
serviceLocator.getService(CoroutineScope::class.java), | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...olbox/src/main/resources/META-INF/services/com.jetbrains.toolbox.gateway.GatewayExtension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
toolbox.gateway.sample.SampleGatewayExtension | ||
io.gitpod.toolbox.gateway.GitpodGatewayExtension |
@mustard-mh We are going to add ouath2 right?