Documentation ¶
Index ¶
- Constants
- func AgainstEndpoint(logger log.Logger, client *http.Client, endpoint *url.URL, token []byte, ...) ([]byte, error)
- func NewAuthorizeClientHandler(logger log.Logger, authorizer ClientAuthorizer, next http.Handler) http.Handler
- func NewHandler(logger log.Logger, client *http.Client, endpoint *url.URL, tenantKey string, ...) http.HandlerFunc
- func WithClient(ctx context.Context, client *Client) context.Context
- type Client
- type ClientAuthorizer
- type ClusterAuthorizer
- type ClusterAuthorizerFunc
- type ErrorWithCode
- type ServerRotatingRoundTripper
- type TokenResponse
Constants ¶
View Source
const (
TenantKey key
)
Variables ¶
This section is empty.
Functions ¶
func AgainstEndpoint ¶
func NewHandler ¶
func NewHandler(logger log.Logger, client *http.Client, endpoint *url.URL, tenantKey string, next http.Handler) http.HandlerFunc
NewHandler returns an http.HandlerFunc that is able to authorize requests against Tollbooth. The handler function expects a bearer token in the Authorization header consisting of a base64-encoded JSON object containing "authorization_token" and "cluster_id" fields.
Types ¶
type ClientAuthorizer ¶
type ClusterAuthorizer ¶
type ClusterAuthorizerFunc ¶
func (ClusterAuthorizerFunc) AuthorizeCluster ¶
func (f ClusterAuthorizerFunc) AuthorizeCluster(token, cluster string) (subject string, err error)
type ErrorWithCode ¶
func NewErrorWithCode ¶
func NewErrorWithCode(err error, code int) ErrorWithCode
type ServerRotatingRoundTripper ¶
type ServerRotatingRoundTripper struct {
// contains filtered or unexported fields
}
func NewServerRotatingRoundTripper ¶
func NewServerRotatingRoundTripper(initialToken string, endpoint *url.URL, rt http.RoundTripper) *ServerRotatingRoundTripper
Source Files ¶
Click to show internal directories.
Click to hide internal directories.