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)
|
|
|
|
}
|