func WithHTTPClient(cl *http.Client) Option {
	return func(j *jwkd) error {
		j.client = cl
		return nil
	}
}
WithHTTPClient returns a HTTPClient functional option
package jwk
import (
	"fmt"
	"net/http"
	"net/url"
	"time"
	"github.com/pkg/errors"
	urlutil "github.com/yahoojapan/athenz-authorizer/v5/internal/url"
)
var (
	defaultOptions = []Option{
		WithRefreshPeriod("24h"),
		WithRetryDelay("1m"),
		WithHTTPClient(http.DefaultClient),
	}
)
type Option func(*jwkd) error
func WithAthenzJwksURL(url string) Option {
	return func(j *jwkd) error {
		if url == "" {
			return urlutil.ErrEmptyAthenzJwksURL
		}
		u := urlutil.TrimHTTPScheme(url)
		if urlutil.HasScheme(u) {
			return urlutil.ErrUnsupportedScheme
		}
		j.athenzJwksURL = fmt.Sprintf("https://%s/oauth2/keys?rfc=true", u)
		return nil
	}
}
func WithRefreshPeriod(t string) Option {
	return func(j *jwkd) error {
		if t == "" {
			return nil
		}
		rd, err := time.ParseDuration(t)
		if err != nil {
			return errors.Wrap(err, "invalid refresh period")
		}
		j.refreshPeriod = rd
		return nil
	}
}
func WithRetryDelay(i string) Option {
	return func(j *jwkd) error {
		if i == "" {
			return nil
		}
		ri, err := time.ParseDuration(i)
		if err != nil {
			return errors.Wrap(err, "invalid retry delay")
		}
		j.retryDelay = ri
		return nil
	}
}
func WithURLs(urls []string) Option {
	return func(j *jwkd) error {
		for _, targetURL := range urls {
			u, err := url.ParseRequestURI(targetURL)
			if err != nil {
				return err
			}
			if u.Scheme != "http" && u.Scheme != "https" {
				return urlutil.ErrUnsupportedScheme
			}
		}
		j.urls = urls
		return nil
	}
}