Remove resolver logic

This commit is contained in:
Ben Toogood 2020-04-02 18:03:21 +01:00
parent 4999f6dfd4
commit 4a4c666528

View File

@ -8,7 +8,6 @@ import (
"strings"
"github.com/micro/go-micro/v2/api/resolver"
"github.com/micro/go-micro/v2/api/resolver/path"
"github.com/micro/go-micro/v2/auth"
"github.com/micro/go-micro/v2/logger"
)
@ -16,10 +15,8 @@ import (
// CombinedAuthHandler wraps a server and authenticates requests
func CombinedAuthHandler(h http.Handler) http.Handler {
return authHandler{
handler: h,
auth: auth.DefaultAuth,
resolver: path.NewResolver(),
// namespace:
handler: h,
auth: auth.DefaultAuth,
}
}
@ -70,12 +67,6 @@ func (h authHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
w.WriteHeader(http.StatusForbidden)
}
// WIP: Determine the name of the service being requested
// endpoint, err := h.resolver.Resolve(req)
// fmt.Printf("EndpointName: %v\n", endpoint.Name)
// fmt.Printf("EndpointMethod: %v\n", endpoint.Method)
// fmt.Printf("EndpointPath: %v\n", endpoint.Path)
// Perform the verification check to see if the account has access to
// the resource they're requesting
err = h.auth.Verify(acc, &auth.Resource{