github.com/brycereitano/goa@v0.0.0-20170315073847-8ffa6c85e265/middleware/security/jwt/error.go (about)

     1  package jwt
     2  
     3  import (
     4  	"errors"
     5  
     6  	"github.com/goadesign/goa"
     7  )
     8  
     9  var (
    10  	// ErrEmptyHeaderName is returned when the header value given to the standard key resolver
    11  	// constructor is empty.
    12  	ErrEmptyHeaderName = errors.New("header name must not be empty")
    13  
    14  	// ErrInvalidKey is returned when a key is not of type string, []string, *rsa.PublicKey or
    15  	// []*rsa.PublicKey.
    16  	ErrInvalidKey = errors.New("invalid parameter, the only keys accepted " +
    17  		"are *rsa.publicKey, []*rsa.PublicKey (for RSA-based algorithms) or a " +
    18  		"signing secret string, []string (for HS algorithms)")
    19  
    20  	// ErrKeyDoesNotExist is returned when a key cannot be found by the provided key name.
    21  	ErrKeyDoesNotExist = errors.New("key does not exist")
    22  
    23  	// ErrJWTError is the error returned by this middleware when any sort of validation or
    24  	// assertion fails during processing.
    25  	ErrJWTError = goa.NewErrorClass("jwt_security_error", 401)
    26  )