From 5b04bfd81136dd96701bc301cea766f57da53e23 Mon Sep 17 00:00:00 2001
From: zachmann <gabriel.zachmann@kit.edu>
Date: Fri, 8 Oct 2021 10:19:44 +0200
Subject: [PATCH] adapt to api

---
 go.mod                     | 2 +-
 go.sum                     | 2 ++
 internal/server/ssh/ssh.go | 6 +++---
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/go.mod b/go.mod
index 02fb5065..80f0191e 100644
--- a/go.mod
+++ b/go.mod
@@ -18,7 +18,7 @@ require (
 	github.com/jinzhu/copier v0.3.2
 	github.com/jmoiron/sqlx v1.3.4
 	github.com/lestrrat-go/jwx v1.2.6
-	github.com/oidc-mytoken/api v0.3.1-0.20211007142508-81cf671ea83c
+	github.com/oidc-mytoken/api v0.3.1-0.20211008081732-8cd92617a430
 	github.com/oidc-mytoken/lib v0.2.1-0.20210730094903-f59c9a8f84e0
 	github.com/pkg/errors v0.9.1
 	github.com/satori/go.uuid v1.2.0
diff --git a/go.sum b/go.sum
index 4f50a913..896169a7 100644
--- a/go.sum
+++ b/go.sum
@@ -423,6 +423,8 @@ github.com/oidc-mytoken/api v0.3.1-0.20210921092134-2599cdd1db99 h1:0b66hU44d5ww
 github.com/oidc-mytoken/api v0.3.1-0.20210921092134-2599cdd1db99/go.mod h1:S8t1XA42EFAgc3vUfis0g1LPGA4TXH0nfDynvgo6cwk=
 github.com/oidc-mytoken/api v0.3.1-0.20211007142508-81cf671ea83c h1:Yc2mlxi8f2TbUmdbNA+6GrGLy3f2cUENhJKUO5xkqNU=
 github.com/oidc-mytoken/api v0.3.1-0.20211007142508-81cf671ea83c/go.mod h1:S8t1XA42EFAgc3vUfis0g1LPGA4TXH0nfDynvgo6cwk=
+github.com/oidc-mytoken/api v0.3.1-0.20211008081732-8cd92617a430 h1:70o9TDnNsh7A2RsqR3uuiJMKjbRd4ohk2DgESi5ZzmQ=
+github.com/oidc-mytoken/api v0.3.1-0.20211008081732-8cd92617a430/go.mod h1:S8t1XA42EFAgc3vUfis0g1LPGA4TXH0nfDynvgo6cwk=
 github.com/oidc-mytoken/lib v0.2.1-0.20210730094903-f59c9a8f84e0 h1:eo1lEHaU6vkQZnAQyy7dA7JIoXpUOS/G4csV1LPIi80=
 github.com/oidc-mytoken/lib v0.2.1-0.20210730094903-f59c9a8f84e0/go.mod h1:2ITx3/ZTRyrR6GGIG3BfNdscxERXsD0Up8G3yZZDJng=
 github.com/oidc-mytoken/server v0.2.0/go.mod h1:6uFm+Za9NMK3gq4OOIeX3gs3T6leluVIWsGiM1zlQbA=
diff --git a/internal/server/ssh/ssh.go b/internal/server/ssh/ssh.go
index 5fade504..47b24db2 100644
--- a/internal/server/ssh/ssh.go
+++ b/internal/server/ssh/ssh.go
@@ -15,9 +15,9 @@ func decodeData(data, dataType string) ([]byte, error) {
 		return nil, nil
 	}
 	switch strings.ToLower(dataType) {
-	case api.MIMETYPE_JSON:
+	case api.SSHMimetypeJson:
 		return []byte(data), nil
-	case api.MIMETYPE_JSON_BASE64:
+	case api.SSHMimetypeJsonBase64:
 		d, err := base64.StdEncoding.DecodeString(data)
 		return d, errors.WithStack(err)
 	default:
@@ -50,7 +50,7 @@ func _handleSSHSession(s ssh.Session) (err error) {
 	}
 
 	switch reqType {
-	case api.SSH_REQUEST_MYTOKEN:
+	case api.SSHRequestMytoken:
 		return handleSSHMytoken(req, s.Context())
 	default:
 		return errors.New("unknown request")
-- 
GitLab