Documentation ¶
Overview ¶
Package bakerytest provides test helper functions for the bakery.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Discharger ¶
Discharger is a third-party caveat discharger suitable for testing. It listens on a local network port for discharge requests. It should be shut down by calling Close when done with.
func NewDischarger ¶
func NewDischarger( locator bakery.PublicKeyLocator, checker func(req *http.Request, cond, arg string) ([]checkers.Caveat, error), ) *Discharger
NewDischarger returns a new third party caveat discharger which uses the given function to check caveats. The cond and arg arguments to the function are as returned by checkers.ParseCaveat.
If locator is non-nil, it will be used to find public keys for any third party caveats returned by the checker.
func (*Discharger) Location ¶
func (d *Discharger) Location() string
Location returns the location of the discharger, suitable for setting as the location in a third party caveat. This will be the URL of the server.
func (*Discharger) PublicKeyForLocation ¶
func (d *Discharger) PublicKeyForLocation(loc string) (*bakery.PublicKey, error)
PublicKeyForLocation implements bakery.PublicKeyLocator.