github.com/hellofresh/janus@v0.0.0-20230925145208-ce8de8183c67/pkg/plugin/oauth2/error.go (about)

     1  package oauth2
     2  
     3  import (
     4  	"net/http"
     5  
     6  	"github.com/hellofresh/janus/pkg/errors"
     7  )
     8  
     9  var (
    10  	// ErrClientIDNotFound is raised when a client_id was not found
    11  	ErrClientIDNotFound = errors.New(http.StatusBadRequest, "Invalid client ID provided")
    12  
    13  	// ErrAccessTokenOfOtherOrigin is used when the access token is of other origin
    14  	ErrAccessTokenOfOtherOrigin = errors.New(http.StatusUnauthorized, "access token of other origin")
    15  
    16  	// ErrOauthServerNotFound is used when the oauth server was not found in the datastore
    17  	ErrOauthServerNotFound = errors.New(http.StatusNotFound, "oauth server not found")
    18  
    19  	// ErrDBContextNotSet is used when the database request context is not set
    20  	ErrDBContextNotSet = errors.New(http.StatusInternalServerError, "DB context was not set for this request")
    21  
    22  	// ErrJWTSecretMissing is used when the database request context is not set
    23  	ErrJWTSecretMissing = errors.New(http.StatusBadRequest, "You need to set a JWT secret")
    24  
    25  	// ErrUnknownManager is used when a manager type is not known
    26  	ErrUnknownManager = errors.New(http.StatusBadRequest, "Unknown manager type provided")
    27  
    28  	// ErrUnknownStrategy is used when a token strategy is not known
    29  	ErrUnknownStrategy = errors.New(http.StatusBadRequest, "Unknown token strategy type provided")
    30  
    31  	// ErrInvalidIntrospectionURL is used when an introspection URL is invalid
    32  	ErrInvalidIntrospectionURL = errors.New(http.StatusBadRequest, "The provided introspection URL is invalid")
    33  
    34  	// ErrOauthServerNameExists is used when the Oauth Server name is already registered on the datastore
    35  	ErrOauthServerNameExists = errors.New(http.StatusConflict, "oauth server name is already registered")
    36  )