diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 6a00348..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/go-jwt-middleware-8c897f7.tar.gz -/go-jwt-middleware-5493cabe49f7bfa6e2ec444a09d334d90cd4e2bd.tar.gz diff --git a/0001-fix-test-so-it-builds.patch b/0001-fix-test-so-it-builds.patch deleted file mode 100644 index e488170..0000000 --- a/0001-fix-test-so-it-builds.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 961fd647949234961388345b81c590e62ed5bd97 Mon Sep 17 00:00:00 2001 -From: Brian Lockwood -Date: Tue, 25 Apr 2017 21:02:50 -0700 -Subject: [PATCH] fix test so it builds - ---- - jwtmiddleware_test.go | 27 +++++++++++++++------------ - 1 file changed, 15 insertions(+), 12 deletions(-) - -diff --git a/jwtmiddleware_test.go b/jwtmiddleware_test.go -index 53966a1..7ec3eed 100644 ---- a/jwtmiddleware_test.go -+++ b/jwtmiddleware_test.go -@@ -3,16 +3,17 @@ package jwtmiddleware - import ( - "encoding/json" - "fmt" -- "github.com/codegangsta/negroni" -- "github.com/dgrijalva/jwt-go" -- "github.com/gorilla/context" -- "github.com/gorilla/mux" -- . "github.com/smartystreets/goconvey/convey" - "io/ioutil" - "net/http" - "net/http/httptest" - "strings" - "testing" -+ -+ "github.com/codegangsta/negroni" -+ "github.com/dgrijalva/jwt-go" -+ "github.com/gorilla/context" -+ "github.com/gorilla/mux" -+ . "github.com/smartystreets/goconvey/convey" - ) - - // defaultAuthorizationHeaderName is the default header name where the Auth -@@ -51,15 +52,17 @@ func TestAuthenticatedRequest(t *testing.T) { - if e != nil { - panic(e) - } -+ claim := jwt.MapClaims{} -+ claim["foo"] = "bar" - Convey("Simple unauthenticated request", t, func() { - Convey("Authenticated GET to / path should return a 200 reponse", func() { -- w := makeAuthenticatedRequest("GET", "/", map[string]interface{}{"foo": "bar"}, nil) -+ w := makeAuthenticatedRequest("GET", "/", claim, nil) - So(w.Code, ShouldEqual, http.StatusOK) - }) - Convey("Authenticated GET to /protected path should return a 200 reponse if expected algorithm is not specified", func() { - var expectedAlgorithm jwt.SigningMethod - expectedAlgorithm = nil -- w := makeAuthenticatedRequest("GET", "/protected", map[string]interface{}{"foo": "bar"}, expectedAlgorithm) -+ w := makeAuthenticatedRequest("GET", "/protected", claim, expectedAlgorithm) - So(w.Code, ShouldEqual, http.StatusOK) - responseBytes, err := ioutil.ReadAll(w.Body) - if err != nil { -@@ -71,7 +74,7 @@ func TestAuthenticatedRequest(t *testing.T) { - }) - Convey("Authenticated GET to /protected path should return a 200 reponse if expected algorithm is correct", func() { - expectedAlgorithm := jwt.SigningMethodHS256 -- w := makeAuthenticatedRequest("GET", "/protected", map[string]interface{}{"foo": "bar"}, expectedAlgorithm) -+ w := makeAuthenticatedRequest("GET", "/protected", claim, expectedAlgorithm) - So(w.Code, ShouldEqual, http.StatusOK) - responseBytes, err := ioutil.ReadAll(w.Body) - if err != nil { -@@ -83,7 +86,7 @@ func TestAuthenticatedRequest(t *testing.T) { - }) - Convey("Authenticated GET to /protected path should return a 401 reponse if algorithm is not expected one", func() { - expectedAlgorithm := jwt.SigningMethodRS256 -- w := makeAuthenticatedRequest("GET", "/protected", map[string]interface{}{"foo": "bar"}, expectedAlgorithm) -+ w := makeAuthenticatedRequest("GET", "/protected", claim, expectedAlgorithm) - So(w.Code, ShouldEqual, http.StatusUnauthorized) - responseBytes, err := ioutil.ReadAll(w.Body) - if err != nil { -@@ -97,10 +100,10 @@ func TestAuthenticatedRequest(t *testing.T) { - } - - func makeUnauthenticatedRequest(method string, url string) *httptest.ResponseRecorder { -- return makeAuthenticatedRequest(method, url, nil, nil) -+ return makeAuthenticatedRequest(method, url, jwt.StandardClaims{}, nil) - } - --func makeAuthenticatedRequest(method string, url string, c map[string]interface{}, expectedSignatureAlgorithm jwt.SigningMethod) *httptest.ResponseRecorder { -+func makeAuthenticatedRequest(method string, url string, c jwt.Claims, expectedSignatureAlgorithm jwt.SigningMethod) *httptest.ResponseRecorder { - r, _ := http.NewRequest(method, url, nil) - if c != nil { - token := jwt.New(jwt.SigningMethodHS256) -@@ -199,7 +202,7 @@ func protectedHandler(w http.ResponseWriter, r *http.Request) { - // retrieve the token from the context (Gorilla context lib) - u := context.Get(r, userPropertyName) - user := u.(*jwt.Token) -- respondJson(user.Claims["foo"].(string), w) -+ respondJson(user.Claims.(jwt.MapClaims)["foo"].(string), w) - } - - // Response quick n' dirty Response struct to be encoded as json diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..34c03b8 --- /dev/null +++ b/dead.package @@ -0,0 +1 @@ +Renamed to golang-github-auth0-jwt-middleware diff --git a/golang-github-auth0-go-jwt-middleware.spec b/golang-github-auth0-go-jwt-middleware.spec deleted file mode 100644 index 14374ca..0000000 --- a/golang-github-auth0-go-jwt-middleware.spec +++ /dev/null @@ -1,94 +0,0 @@ -# Generated by go2rpm -# Tests are broken, dead upstream -%bcond_with check - -# https://github.com/auth0/go-jwt-middleware -%global goipath github.com/auth0/go-jwt-middleware -%global commit 5493cabe49f7bfa6e2ec444a09d334d90cd4e2bd - -%gometa - -%global common_description %{expand: -A middleware that will check that a JWT is sent on the Authorization header and -will then set the content of the JWT into the user variable of the request. - -This module lets you authenticate HTTP requests using JWT tokens in your Go -Programming Language applications. JWTs are typically used to protect API -endpoints, and are often issued using OpenID Connect.} - -%global golicenses LICENSE -%global godocs README.md - -Name: %{goname} -Version: 0 -Release: 11%{?dist} -Summary: Middleware for Go to check for jwts on http requests - -License: MIT -URL: %{gourl} -Source0: %{gosource} - -BuildRequires: golang(github.com/codegangsta/negroni) -BuildRequires: golang(github.com/dgrijalva/jwt-go) -BuildRequires: golang(github.com/go-martini/martini) -BuildRequires: golang(github.com/gorilla/mux) - -%if %{with check} -# Tests -BuildRequires: golang(github.com/gorilla/context) -BuildRequires: golang(github.com/smartystreets/goconvey/convey) -%endif - -%description -%{common_description} - -%gopkg - -%prep -%goprep - -%install -%gopkginstall - -%if %{with check} -%check -%gocheck -%endif - -%gopkgfiles - -%changelog -* Mon Apr 15 22:37:22 CEST 2019 Robert-André Mauchin - 0.1-11.20190415git5493cab -- Bump to 5493cabe49f7bfa6e2ec444a09d334d90cd4e2bd - -* Thu Jan 31 2019 Fedora Release Engineering - 0.1-10.git8c897f7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Fri Jul 13 2018 Fedora Release Engineering - 0.1-9.git8c897f7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Wed Feb 07 2018 Fedora Release Engineering - 0.1-8.git8c897f7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Wed Aug 02 2017 Fedora Release Engineering - 0.1-7.git8c897f7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Wed Jul 26 2017 Fedora Release Engineering - 0.1-6.git8c897f7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Fri Feb 10 2017 Fedora Release Engineering - 0.1-5.git8c897f7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Thu Jul 21 2016 Fedora Release Engineering - 0.1-4.git8c897f7 -- https://fedoraproject.org/wiki/Changes/golang1.7 - -* Mon Feb 22 2016 Fedora Release Engineering - 0.1-3.git8c897f7 -- https://fedoraproject.org/wiki/Changes/golang1.6 - -* Wed Feb 03 2016 Fedora Release Engineering - 0.1-2.git8c897f7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Mon Oct 12 2015 lpabon - 0.1-1.git8c897f7 -- First package for Fedora - - diff --git a/sources b/sources deleted file mode 100644 index 46622a6..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -SHA512 (go-jwt-middleware-5493cabe49f7bfa6e2ec444a09d334d90cd4e2bd.tar.gz) = 8e77c5a0a6b2679ede0ba41d9052f9bc4c7799716adf26baaece443f0a359188fb7956aded9afc9fee42797cb567bcb81c5484aee3e9dcc37f3ca06373f8570a