Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrHashInvalid is returned when hash is // considered invalid. ErrHashInvalid = errors.New("Invalid Hash") // ErrTokenExpires is returned when token time // is considerd invalid. ErrTokenExpires = errors.New("Token expires") // ErrSecretNotFound tells that no secret has been found. ErrSecretNotFound = errors.New("Secret not found") // ErrInvalidScopes tells the user has no access ErrInvalidScopes = errors.New("No valid scopes found") )
Functions ¶
This section is empty.
Types ¶
type SecretProvider ¶
type SecretProvider interface {
GetSecret(identifier string) (string, error)
GetScopes(identifier string) ([]string, error)
}
SecretProvider helps to retrieve informations about the user.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator validates request
func NewValidator ¶
NewValidator returns a new validator
func (*Validator) HashRequest ¶
func (v *Validator) HashRequest(r *http.Request, date time.Time, public string, identifier string) error
HashRequest hash the requests with the given parameters. Ex: Authorization: FIRE-TOKEN apikey="0PN5J17HBGZHT7JJ3X82", hash="frJIUN8DYpKDtOLCwo//yllqDzg=" See http://stackoverflow.com/questions/7802116/custom-http-authorization-header
Click to show internal directories.
Click to hide internal directories.
