Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultServerConfig ¶
func NewDefaultServerConfig() *osin.ServerConfig
Types ¶
type AccessHandler ¶
type AccessHandler interface { // HandleAccess populates an AccessRequest (typically the Authorized and UserData fields) HandleAccess(ar *osin.AccessRequest, w http.ResponseWriter) error }
AccessHandler populates an AccessRequest
type AccessHandlerFunc ¶
type AccessHandlerFunc func(ar *osin.AccessRequest, w http.ResponseWriter) error
func (AccessHandlerFunc) HandleAccess ¶
func (f AccessHandlerFunc) HandleAccess(ar *osin.AccessRequest, w http.ResponseWriter) error
type AccessHandlers ¶
type AccessHandlers []AccessHandler
func (AccessHandlers) HandleAccess ¶
func (all AccessHandlers) HandleAccess(ar *osin.AccessRequest, w http.ResponseWriter) error
type AuthorizeHandler ¶
type AuthorizeHandler interface { // HandleAuthorize does one of the following: // 1. populates an AuthorizeRequest (typically the Authorized and UserData fields) and returns false // 2. populates the error fields of a Response object and returns false // 3. returns an internal server error and returns false // 4. writes the response itself and returns true HandleAuthorize(ar *osin.AuthorizeRequest, resp *osin.Response, w http.ResponseWriter) (handled bool, err error) }
AuthorizeHandler populates an AuthorizeRequest or handles the request itself
type AuthorizeHandlerFunc ¶
type AuthorizeHandlerFunc func(ar *osin.AuthorizeRequest, resp *osin.Response, w http.ResponseWriter) (bool, error)
func (AuthorizeHandlerFunc) HandleAuthorize ¶
func (f AuthorizeHandlerFunc) HandleAuthorize(ar *osin.AuthorizeRequest, resp *osin.Response, w http.ResponseWriter) (bool, error)
type AuthorizeHandlers ¶
type AuthorizeHandlers []AuthorizeHandler
func (AuthorizeHandlers) HandleAuthorize ¶
func (all AuthorizeHandlers) HandleAuthorize(ar *osin.AuthorizeRequest, resp *osin.Response, w http.ResponseWriter) (bool, error)
type ErrorHandler ¶
type ErrorHandler interface { // HandleError writes an error response HandleError(err error, w http.ResponseWriter, req *http.Request) }
ErrorHandler writes an error response
func NewDefaultErrorHandler ¶
func NewDefaultErrorHandler() ErrorHandler
NewDefaultErrorHandler returns a simple ErrorHandler
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func New ¶
func New(config *osin.ServerConfig, storage osin.Storage, authorize AuthorizeHandler, access AccessHandler, errorHandler ErrorHandler) *Server
type TokenGen ¶
type TokenGen struct{}
func (TokenGen) GenerateAccessToken ¶
func (TokenGen) GenerateAuthorizeToken ¶
func (TokenGen) GenerateAuthorizeToken(data *osin.AuthorizeData) (ret string, err error)
Click to show internal directories.
Click to hide internal directories.