Documentation ¶
Index ¶
- Constants
- Variables
- func BuildSignatureAndMetadata(crypto secure.Crypto, signatureContents *SignatureContents) (string, string, error)
- type Metadata
- type RequestReceivedFromRouteService
- type RequestToSendToRouteService
- type RouteServiceConfig
- func (rs *RouteServiceConfig) CreateRequest(rsUrl, forwardedUrl string) (RequestToSendToRouteService, error)
- func (rs *RouteServiceConfig) RouteServiceEnabled() bool
- func (rs *RouteServiceConfig) RouteServiceHairpinning() bool
- func (rs *RouteServiceConfig) RouteServiceHairpinningAllowlist() []string
- func (rs *RouteServiceConfig) RouteServiceRecommendHttps() bool
- func (rs *RouteServiceConfig) StrictSignatureValidation() bool
- func (rs *RouteServiceConfig) ValidateRequest(request RequestReceivedFromRouteService) (*SignatureContents, error)
- type SignatureContents
Constants ¶
View Source
const ( HeaderKeySignature = "X-CF-Proxy-Signature" HeaderKeyForwardedURL = "X-CF-Forwarded-Url" HeaderKeyMetadata = "X-CF-Proxy-Metadata" )
Variables ¶
View Source
var ErrExpired = errors.New("route service request expired")
Functions ¶
Types ¶
type RouteServiceConfig ¶
type RouteServiceConfig struct {
// contains filtered or unexported fields
}
func NewRouteServiceConfig ¶
func (*RouteServiceConfig) CreateRequest ¶
func (rs *RouteServiceConfig) CreateRequest(rsUrl, forwardedUrl string) (RequestToSendToRouteService, error)
func (*RouteServiceConfig) RouteServiceEnabled ¶
func (rs *RouteServiceConfig) RouteServiceEnabled() bool
func (*RouteServiceConfig) RouteServiceHairpinning ¶
func (rs *RouteServiceConfig) RouteServiceHairpinning() bool
func (*RouteServiceConfig) RouteServiceHairpinningAllowlist ¶
func (rs *RouteServiceConfig) RouteServiceHairpinningAllowlist() []string
func (*RouteServiceConfig) RouteServiceRecommendHttps ¶
func (rs *RouteServiceConfig) RouteServiceRecommendHttps() bool
func (*RouteServiceConfig) StrictSignatureValidation ¶
func (rs *RouteServiceConfig) StrictSignatureValidation() bool
func (*RouteServiceConfig) ValidateRequest ¶
func (rs *RouteServiceConfig) ValidateRequest(request RequestReceivedFromRouteService) (*SignatureContents, error)
type SignatureContents ¶
type SignatureContents struct { ForwardedUrl string `json:"forwarded_url"` RequestedTime time.Time `json:"requested_time"` }
func SignatureContentsFromHeaders ¶
func SignatureContentsFromHeaders(signatureHeader, metadataHeader string, crypto secure.Crypto) (SignatureContents, error)
Click to show internal directories.
Click to hide internal directories.