From 1c9220e04016d035c3c688c315ceabe274f45dfc Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Fri, 24 Jan 2020 22:34:09 -0600 Subject: initial sip implementation --- pkg/auth/middleware.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pkg/auth/middleware.go') diff --git a/pkg/auth/middleware.go b/pkg/auth/middleware.go index 5fe0ab7..a183c1b 100644 --- a/pkg/auth/middleware.go +++ b/pkg/auth/middleware.go @@ -11,14 +11,13 @@ import ( const anonAuth string = "anon" const sipAuth string = "sip" +/* FIXME -- get this from configuration variables */ var jwtSecret = []byte("somethingverysecret") -func getHandler(ch web.CertHandler) func(w http.ResponseWriter, r *http.Request) { - return ch.CertResponder +func Authenticator(auth string) { } -//func AuthMiddleware(auth string, ch web.CertHandler) func(w http.ResponseWriter, r *http.Request) { -func AuthMiddleware(auth string, ch web.CertHandler) http.Handler { +func RestrictedMiddleware(auth string, ch web.CertHandler) http.Handler { jwtMiddleware := jwtmiddleware.New(jwtmiddleware.Options{ ValidationKeyGetter: func(token *jwt.Token) (interface{}, error) { @@ -38,5 +37,6 @@ func AuthMiddleware(auth string, ch web.CertHandler) http.Handler { default: log.Fatal("Unknown auth module: '", auth, "'. Should be one of: ", anonAuth, ", ", sipAuth, ".") } + // should not get here return nil } -- cgit v1.2.3