MCPcopy
hub / github.com/golang-jwt/jwt / TestNoneVerify

Function TestNoneVerify

none_test.go:45–58  ·  none_test.go::TestNoneVerify
(t *testing.T)

Source from the content-addressed store, hash-verified

43}
44
45func TestNoneVerify(t *testing.T) {
46 for _, data := range noneTestData {
47 parts := strings.Split(data.tokenString, ".")
48
49 method := jwt.GetSigningMethod(data.alg)
50 err := method.Verify(strings.Join(parts[0:2], "."), decodeSegment(t, parts[2]), data.key)
51 if data.valid && err != nil {
52 t.Errorf("[%v] Error while verifying key: %v", data.name, err)
53 }
54 if !data.valid && err == nil {
55 t.Errorf("[%v] Invalid key passed validation", data.name)
56 }
57 }
58}
59
60func TestNoneSign(t *testing.T) {
61 for _, data := range noneTestData {

Callers

nothing calls this directly

Calls 2

decodeSegmentFunction · 0.85
VerifyMethod · 0.65

Tested by

no test coverage detected