func NewInterceptorWithValidator(validator Validator, auths map[string][]AuthArgs, whiteList ...RequestMatcher) Interceptor {
	validateJWT := validateJWTWithValidator(validator, MakeClaimsFunc(auths))
	return func(ctx context.Context, method, uri string) (context.Context, error) {
		for _, wa := range whiteList {
			if strings.EqualFold(method, wa.Method) && wa.URI.MatchString(uri) {
				return ctx, nil
			}
		}
		return validateJWT(ctx, method, uri)
	}
}
NewInterceptor authorizes HTTP request with validator.
package http
import (
	"context"
	"crypto/tls"
	"fmt"
	"regexp"
	"strings"
	"github.com/plgd-dev/hub/pkg/security/jwt"
)
type Interceptor = func(ctx context.Context, method, uri string) (context.Context, error)
type AuthArgs struct {
	URI    *regexp.Regexp
	Scopes []*regexp.Regexp
}
type RequestMatcher struct {
	Method string
	URI    *regexp.Regexp
}