20 lines
415 B
Go
20 lines
415 B
Go
package middleware
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
type AuthorityMiddleware struct{}
|
|
|
|
func NewAuthorityMiddleware() *AuthorityMiddleware {
|
|
return &AuthorityMiddleware{}
|
|
}
|
|
|
|
func (m *AuthorityMiddleware) Handle(next http.HandlerFunc) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
// go-zero JWT middleware puts claims into context
|
|
// Casbin enforcement will be added later
|
|
next(w, r)
|
|
}
|
|
}
|