summaryrefslogtreecommitdiff
path: root/pkg/auth/middleware.go
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2020-01-24 22:34:09 -0600
committerkali kaneko (leap communications) <kali@leap.se>2020-01-24 22:35:54 -0600
commit1c9220e04016d035c3c688c315ceabe274f45dfc (patch)
tree796488fe592e117fd97781a018bc4b2060a0672d /pkg/auth/middleware.go
parentd3b21e5adc27cbb472e688b7c602e3bd721dec31 (diff)
initial sip implementation
Diffstat (limited to 'pkg/auth/middleware.go')
-rw-r--r--pkg/auth/middleware.go8
1 files changed, 4 insertions, 4 deletions
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
}