Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
4ffaabd6e6 | |||
c647f76894 | |||
c1c5d23f92 | |||
4263647288 | |||
f1919d0602 |
12
auth/auth.go
12
auth/auth.go
@@ -84,13 +84,13 @@ func (con *AuthApi) LoggedIn(ctx *gin.Context) {
|
||||
}
|
||||
|
||||
type SignUpRequest struct {
|
||||
Token string
|
||||
Username string
|
||||
Password string
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
func (con AuthApi) signUp(ctx *gin.Context) {
|
||||
var request SignUpRequest
|
||||
rawToken := ctx.Query("token")
|
||||
|
||||
err := json.NewDecoder(ctx.Request.Body).Decode(&request)
|
||||
if err != nil {
|
||||
@@ -98,7 +98,7 @@ func (con AuthApi) signUp(ctx *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
token, err := con.tokenHandler.GetInviteToken(ctx, request.Token)
|
||||
token, err := con.tokenHandler.GetInviteToken(ctx, rawToken)
|
||||
if err != nil {
|
||||
ctx.AbortWithError(500, err)
|
||||
return
|
||||
@@ -119,8 +119,8 @@ func (con AuthApi) signUp(ctx *gin.Context) {
|
||||
}
|
||||
|
||||
type SignInRequest struct {
|
||||
Username string
|
||||
Password string
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
func (con AuthApi) signIn(ctx *gin.Context) {
|
||||
|
@@ -3,6 +3,7 @@ package kubernetes
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -250,22 +251,24 @@ func (i *InstanceManager) InteractiveTerminal(ctx context.Context, serverId stri
|
||||
req := i.coreV1Cli.CoreV1().RESTClient().
|
||||
Post().
|
||||
Resource("pods").
|
||||
Namespace(i.Config.Namespace).
|
||||
Name(serverId).
|
||||
Namespace(i.Config.Namespace).
|
||||
SubResource("attach").
|
||||
VersionedParams(&corev1.PodAttachOptions{
|
||||
Container: "server",
|
||||
Stdin: true,
|
||||
Stdout: true,
|
||||
Stderr: true,
|
||||
TTY: true,
|
||||
Stdin: true,
|
||||
Stdout: true,
|
||||
Stderr: true,
|
||||
TTY: true,
|
||||
}, clientgoscheme.ParameterCodec)
|
||||
|
||||
executor, err := remotecommand.NewSPDYExecutor(i.restCfg, "POST", req.URL())
|
||||
go func() {
|
||||
defer stdoutWriter.Close()
|
||||
defer stdinReader.Close()
|
||||
_ = executor.StreamWithContext(ctx, remotecommand.StreamOptions{Stdin: stdinReader, Stdout: stdoutWriter, Stderr: stdoutWriter, Tty: true, TerminalSizeQueue: queue})
|
||||
err := executor.StreamWithContext(ctx, remotecommand.StreamOptions{Stdin: stdinReader, Stdout: stdoutWriter, Stderr: stdoutWriter, Tty: true, TerminalSizeQueue: queue})
|
||||
if err != nil {
|
||||
log.Printf("Failed to attach %e", err)
|
||||
}
|
||||
}()
|
||||
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user