Documentation ¶
Index ¶
Constants ¶
View Source
const ( NotValidError = Error("signature not valid") ExpiredError = Error("signature expired") BadRequestError = Error("bad request") )
Error constants retured by various functions.
Variables ¶
This section is empty.
Functions ¶
func NewVerifier ¶
func NewVerifier(srv imageserver.Server, key string, expiration time.Duration) imageserver.Server
NewVerifier returns an initialized Verifier. If expiration is 0, expirations are not enforced.
Types ¶
type Parser ¶
type Parser struct{}
Parser is a imageserver/http.Parser implementation for imageserver/image/expiration.Processor.
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer is an http.Handler that signs the request URL + query parameters and redirects to the signed URL.
type Verifier ¶
type Verifier struct { Next imageserver.Server // contains filtered or unexported fields }
Verifier is an imageserver.Server that verifies the signature and possibly the timestamp of a request URL
func (*Verifier) Get ¶
func (srv *Verifier) Get(params imageserver.Params) (*imageserver.Image, error)
Get does the HMAC verification, and possibly expiration calculation, of the request
Click to show internal directories.
Click to hide internal directories.