Documentation
¶
Overview ¶
Package httperror provides a shared error type that carries HTTP status codes for gateway responses. The gateway uses StatusCodeFrom(err) only.
Domain-specific mappers (wrap errors before returning to gateway):
- gateway/rest.writeClusterError (calls clusterErrorToHTTP)
- manifest.ManifestSubmitErrorToHTTP
- gateway/utils.jwtErrorToHTTP (JWT parse errors)
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrJWTMissing = NewHttpError(http.StatusBadRequest, errors.New("JWT is missing")) ErrInvalidAuthHeader = NewHttpError(http.StatusBadRequest, errors.New("invalid authorization header")) ErrInvalidRequest = NewHttpError(http.StatusBadRequest, errors.New("invalid request")) ErrJWTInvalidClaims = NewHttpError(http.StatusBadRequest, errors.New("JWT has invalid claims")) ErrAuthAmbiguous = NewHttpError(http.StatusBadRequest, errors.New("auth: ambiguous authentication. may not use mTLS and JWT at the same time")) ErrJWTInvalid = NewHttpError(http.StatusUnauthorized, errors.New("JWT is invalid")) ErrJWTExpired = NewHttpError(http.StatusUnauthorized, errors.New("JWT is expired")) )
Functions ¶
func StatusCodeFrom ¶
Types ¶
type HttpError ¶
HttpError wraps an error with the appropriate HTTP status code.
func NewHttpError ¶
Click to show internal directories.
Click to hide internal directories.