route_service

package
v0.0.0-...-1ce3cd0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2015 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 1 more Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RouteServiceSignature    = "X-CF-Proxy-Signature"
	RouteServiceForwardedUrl = "X-CF-Forwarded-Url"
	RouteServiceMetadata     = "X-CF-Proxy-Metadata"
)

Variables

View Source
var RouteServiceExpired = errors.New("Route service request expired")
View Source
var RouteServiceForwardedUrlMismatch = errors.New("Route service forwarded url mismatch")

Functions

func BuildSignatureAndMetadata

func BuildSignatureAndMetadata(crypto secure.Crypto, signature *Signature) (string, string, error)

Types

type Metadata

type Metadata struct {
	Nonce []byte `json:"nonce"`
}

type RouteServiceArgs

type RouteServiceArgs struct {
	UrlString       string
	ParsedUrl       *url.URL
	Signature       string
	Metadata        string
	ForwardedUrlRaw string
}

type RouteServiceConfig

type RouteServiceConfig struct {
	// contains filtered or unexported fields
}

func NewRouteServiceConfig

func NewRouteServiceConfig(enabled bool, timeout time.Duration, crypto secure.Crypto, cryptoPrev secure.Crypto) *RouteServiceConfig

func (*RouteServiceConfig) GenerateSignatureAndMetadata

func (rs *RouteServiceConfig) GenerateSignatureAndMetadata(forwardedUrlRaw string) (string, string, error)

func (*RouteServiceConfig) RouteServiceEnabled

func (rs *RouteServiceConfig) RouteServiceEnabled() bool

func (*RouteServiceConfig) SetupRouteServiceRequest

func (rs *RouteServiceConfig) SetupRouteServiceRequest(request *http.Request, args RouteServiceArgs)

func (*RouteServiceConfig) ValidateSignature

func (rs *RouteServiceConfig) ValidateSignature(headers *http.Header) error

type Signature

type Signature struct {
	ForwardedUrl  string    `json:"forwarded_url"`
	RequestedTime time.Time `json:"requested_time"`
}

func SignatureFromHeaders

func SignatureFromHeaders(signatureHeader, metadataHeader string, crypto secure.Crypto) (Signature, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL