initial commit

This commit is contained in:
Mike Mason
2023-07-01 00:04:52 +00:00
commit 80fb879ef6
65 changed files with 3544 additions and 0 deletions

22
internal/routes/errors.go Normal file
View File

@@ -0,0 +1,22 @@
package routes
import (
"errors"
"net/http"
"github.com/labstack/echo/v4"
)
var (
// ErrInvalidJWTPrivateKeyType is returned when the private key type is not of an expected value.
ErrInvalidJWTPrivateKeyType = errors.New("invalid JWT private key provided")
// ErrAuthTokenHeaderRequired is returned when a token check request is made, but the Authorization header is missing.
ErrAuthTokenHeaderRequired = echo.NewHTTPError(http.StatusBadRequest, "header Authorization missing or invalid")
// ErrInvalidSigningMethod is returned when defined jwt signing method is not recognized.
ErrInvalidSigningMethod = errors.New("unrecognized jwt signing method provided")
// ErrMissingIssuer is returned when the jwt issuer is not defined in the config.
ErrMissingIssuer = errors.New("jwt issuer required")
)