Documentation ¶
Index ¶
Constants ¶
View Source
const ( // KeyHeader contains secret private key of a remote service KeyHeader = "X-Auth-Sign" // CallerHeader contains name of a remote service CallerHeader = "X-Auth-Id" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier parses and verifies access keys.
func NewVerifier ¶
NewVerifier creates a new Verifier.
func (*Verifier) GetAccessKey ¶
GetAccessKey returns a key associated with the given caller or ”.
func (*Verifier) Wrap ¶
func (v *Verifier) Wrap(next http.HandlerFunc) http.HandlerFunc
Wrap wraps an HTTP handler with a middleware that acts as a access limiter. Requests which wouldn't have an access key are simply rejected with an error. The successfully verified caller is saved to the request's context.
Click to show internal directories.
Click to hide internal directories.