From 77aea32dd94bc24efb63127839c28e73a80431d6 Mon Sep 17 00:00:00 2001 From: Ernst Widerberg Date: Mon, 7 Feb 2022 10:35:17 +0100 Subject: Remove outdated jwt_mock.go --- jwt_mock.go | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 jwt_mock.go diff --git a/jwt_mock.go b/jwt_mock.go deleted file mode 100644 index e4a46f5..0000000 --- a/jwt_mock.go +++ /dev/null @@ -1,30 +0,0 @@ -package main - -import ( - "fmt" - "log" - "net/http" -) - -func main() { - http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Access-Control-Allow-Origin", "*") - w.Header().Set("Access-Control-Allow-Methods", "GET, OPTIONS, POST, PUT") - w.Header().Set("Access-Control-Allow-Headers", "Authorization") - - if r.Method == "OPTIONS" { - w.WriteHeader(http.StatusNoContent) - return - } - - auth := r.Header.Get("Authorization") - if auth != "Basic dXNyOnB3ZA==" { // btoa("usr:pwd") - w.WriteHeader(http.StatusUnauthorized) - return - } - - fmt.Fprint(w, "{\"access_token\": \"JWT_TOKEN_PLACEHOLDER\"}") - }) - - log.Fatal(http.ListenAndServe(":8080", nil)) -} -- cgit v1.1