fix(06-12): reject typed-nil guards and fractional JWT subjects
This commit is contained in:
@@ -233,3 +233,15 @@ func TestJWTGuardRegistryMatchesMiddleware(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestRegisterRejectsTypedNilGuard(t *testing.T) {
|
||||
var reg Registry
|
||||
var g *credPtrGuard
|
||||
if err := reg.Register("p", "n", g); err == nil {
|
||||
t.Fatal("typed-nil guard accepted")
|
||||
}
|
||||
}
|
||||
|
||||
type credPtrGuard struct{}
|
||||
|
||||
func (*credPtrGuard) Authenticate(*http.Request) (*Principal, error) { return nil, nil }
|
||||
|
||||
Reference in New Issue
Block a user