~evanj/security

9b9bc6682997dd34024d4ffa662bc3c83087fc1d — Evan M Jones 1 year, 9 months ago 33f2ce3
Feat(go.mod): Move from git.evanjon.es to git.sr.ht/~evanj
4 files changed, 6 insertions(+), 14 deletions(-)

M go.mod
M go.sum
M security.go
M security_test.go
M go.mod => go.mod +2 -4
@@ 1,12 1,10 @@
module git.evanjon.es/minieggs/security
module git.sr.ht/~evanj/security

go 1.13

require (
	git.evanjon.es/minieggs/errors v0.8.2
	github.com/Pallinder/go-randomdata v1.2.0
	github.com/dgrijalva/jwt-go v3.2.0+incompatible
	github.com/pkg/errors v0.8.1 // indirect
	golang.org/x/crypto v0.0.0-20191128160524-b544559bb6d1
	golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d
	gopkg.in/go-playground/assert.v1 v1.2.1
)

M go.sum => go.sum +2 -7
@@ 1,18 1,13 @@
git.evanjon.es/minieggs/errors v0.8.2 h1:/KHLJ4K/7u1rZmDrAmkR7Bvt7j0FOCF40DuumLhU7Yo=
git.evanjon.es/minieggs/errors v0.8.2/go.mod h1:NLOrIMAaoHXDgFHi7SLaAffGpPclDZp0O/FamQW1aDk=
github.com/Pallinder/go-randomdata v1.2.0 h1:DZ41wBchNRb/0GfsePLiSwb0PHZmT67XY00lCDlaYPg=
github.com/Pallinder/go-randomdata v1.2.0/go.mod h1:yHmJgulpD2Nfrm0cR9tI/+oAgRqCQQixsA8HyRZfV9Y=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191128160524-b544559bb6d1 h1:anGSYQpPhQwXlwsu5wmfq0nWkCNaMEMUwAv13Y92hd8=
golang.org/x/crypto v0.0.0-20191128160524-b544559bb6d1/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d h1:1ZiEyfaQIg3Qh0EoqpwAakHVhecoE5wlSg5GjnafJGw=
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=

M security.go => security.go +1 -2
@@ 3,7 3,6 @@ package security
import (
	"fmt"

	"git.evanjon.es/minieggs/errors"
	"github.com/dgrijalva/jwt-go"
	"golang.org/x/crypto/bcrypt"
)


@@ 103,7 102,7 @@ func (sec Security) TokenFrom(tokenString string) (_ret TokenMap, recoverErr err
	defer func() {
		if recover() != nil {
			// That's right, jwt will pnic on bad input. Don't do this.
			recoverErr = errors.New("hash has no value")
			recoverErr = fmt.Errorf("hash has no value")
		}
	}()
	token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) {

M security_test.go => security_test.go +1 -1
@@ 3,7 3,7 @@ package security_test
import (
	"testing"

	"git.evanjon.es/minieggs/security"
	"git.sr.ht/~evanj/security"
	"github.com/Pallinder/go-randomdata"
	"gopkg.in/go-playground/assert.v1"
)