diff options
author | Ernst Widerberg <ernst@sunet.se> | 2022-02-07 10:35:17 +0100 |
---|---|---|
committer | Ernst Widerberg <ernst@sunet.se> | 2022-02-07 10:35:17 +0100 |
commit | 77aea32dd94bc24efb63127839c28e73a80431d6 (patch) | |
tree | 3b4bf7f163a7d548052db019979928a319ed04d5 | |
parent | ff747e313ea73bb6c9fefbe5220fb4750f3e276f (diff) |
Remove outdated jwt_mock.go
-rw-r--r-- | jwt_mock.go | 30 |
1 files changed, 0 insertions, 30 deletions
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)) -} |