contracts/jwt_auth.go

15 lines
312 B
Go
Raw Normal View History

2023-04-13 10:24:21 +08:00
package contracts
import (
"net/http"
"github.com/lestrrat-go/jwx/jwt"
"github.com/samber/do"
)
type JWTAuth interface {
2024-01-29 17:25:48 +08:00
HttpMiddleware(container *do.Injector) func(next http.Handler) http.Handler
2023-04-13 10:24:21 +08:00
Encode(claims map[string]interface{}) (token string, err error)
Decode(token string) (jwt.Token, error)
}