Documentation
¶
Overview ¶
Package login provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func NoCaching(next echo.HandlerFunc) echo.HandlerFunc
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type EchoRouter
- type GetCallbackParams
- type GetLoginParams
- type GetLogoutParams
- type LoginServer
- func (l *LoginServer) GetCallback(c echo.Context, params GetCallbackParams) error
- func (l *LoginServer) GetGitLabLogout(c echo.Context) error
- func (l *LoginServer) GetGitLabToken(c echo.Context) error
- func (*LoginServer) GetHealth(c echo.Context) error
- func (l *LoginServer) GetLogin(c echo.Context, params GetLoginParams) error
- func (l *LoginServer) GetLogout(c echo.Context, params GetLogoutParams) error
- func (l *LoginServer) GetUserProfile(c echo.Context) error
- func (l *LoginServer) RegisterHandlers(server *echo.Echo, commonMiddlewares ...echo.MiddlewareFunc)
- type LoginServerOption
- type ServerInterface
- type ServerInterfaceWrapper
- func (w *ServerInterfaceWrapper) GetCallback(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetHealth(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetLogin(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetLogout(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetUserProfile(ctx echo.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func NoCaching ¶
func NoCaching(next echo.HandlerFunc) echo.HandlerFunc
NoCaching sets headers in responses that prevent caching by the browser. Taken from oauth2 proxy.
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func RegisterHandlers ¶
func RegisterHandlers(router EchoRouter, si ServerInterface)
RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlersWithBaseURL ¶
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.
Types ¶
type EchoRouter ¶
type EchoRouter interface {
CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}
This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration
type GetCallbackParams ¶
type GetCallbackParams struct {
Code string `form:"code" json:"code"`
State string `form:"state" json:"state"`
}
GetCallbackParams defines parameters for GetCallback.
type GetLoginParams ¶
type GetLoginParams struct {
RedirectUrl *string `form:"redirect_url,omitempty" json:"redirect_url,omitempty"`
// ProviderId Providing `provider_id` query parameters should be used for testing only.
ProviderId *[]string `form:"provider_id,omitempty" json:"provider_id,omitempty"`
}
GetLoginParams defines parameters for GetLogin.
type GetLogoutParams ¶
type GetLogoutParams struct {
RedirectUrl *string `form:"redirect_url,omitempty" json:"redirect_url,omitempty"`
}
GetLogoutParams defines parameters for GetLogout.
type LoginServer ¶
type LoginServer struct {
// contains filtered or unexported fields
}
func NewLoginServer ¶
func NewLoginServer(options ...LoginServerOption) (*LoginServer, error)
NewLoginServer creates a new LoginServer that handles the callbacks from oauth2 and initiates the login flow for users.
func (*LoginServer) GetCallback ¶
func (l *LoginServer) GetCallback(c echo.Context, params GetCallbackParams) error
func (*LoginServer) GetGitLabLogout ¶
func (l *LoginServer) GetGitLabLogout(c echo.Context) error
func (*LoginServer) GetGitLabToken ¶
func (l *LoginServer) GetGitLabToken(c echo.Context) error
func (*LoginServer) GetLogin ¶
func (l *LoginServer) GetLogin(c echo.Context, params GetLoginParams) error
GetLogin is a handler for the initiation of a authorization code flow login for Renku
func (*LoginServer) GetLogout ¶
func (l *LoginServer) GetLogout(c echo.Context, params GetLogoutParams) error
func (*LoginServer) GetUserProfile ¶
func (l *LoginServer) GetUserProfile(c echo.Context) error
func (*LoginServer) RegisterHandlers ¶
func (l *LoginServer) RegisterHandlers(server *echo.Echo, commonMiddlewares ...echo.MiddlewareFunc)
type LoginServerOption ¶
type LoginServerOption func(*LoginServer) error
func WithConfig ¶
func WithConfig(loginConfig config.LoginConfig) LoginServerOption
func WithMetricsClient ¶
func WithMetricsClient(client models.MetricsClientInterface) LoginServerOption
func WithSessionStore ¶
func WithSessionStore(sessions *sessions.SessionStore) LoginServerOption
func WithTokenStore ¶
func WithTokenStore(store models.TokenStoreInterface) LoginServerOption
type ServerInterface ¶
type ServerInterface interface {
// (GET /callback)
GetCallback(ctx echo.Context, params GetCallbackParams) error
// (GET /health)
GetHealth(ctx echo.Context) error
// (GET /login)
GetLogin(ctx echo.Context, params GetLoginParams) error
// (GET /logout)
GetLogout(ctx echo.Context, params GetLogoutParams) error
// (GET /user-profile)
GetUserProfile(ctx echo.Context) error
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) GetCallback ¶
func (w *ServerInterfaceWrapper) GetCallback(ctx echo.Context) error
GetCallback converts echo context to params.
func (*ServerInterfaceWrapper) GetHealth ¶
func (w *ServerInterfaceWrapper) GetHealth(ctx echo.Context) error
GetHealth converts echo context to params.
func (*ServerInterfaceWrapper) GetLogin ¶
func (w *ServerInterfaceWrapper) GetLogin(ctx echo.Context) error
GetLogin converts echo context to params.
func (*ServerInterfaceWrapper) GetLogout ¶
func (w *ServerInterfaceWrapper) GetLogout(ctx echo.Context) error
GetLogout converts echo context to params.
func (*ServerInterfaceWrapper) GetUserProfile ¶
func (w *ServerInterfaceWrapper) GetUserProfile(ctx echo.Context) error
GetUserProfile converts echo context to params.