Mercedes: generalize provider login (#2384)

This commit is contained in:
andig 2022-01-26 08:21:30 +01:00 • committed by GitHub
parent b031610594
commit b4a004b7bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 246 additions and 236 deletions

View file

@ -196,25 +196,10 @@ type WebController interface {
WebControl(*mux.Router)
}
type Callback struct {
Path string
Handler RedirectHandlerFunc
}
// RedirectHandlerFunc should return an http.HandlerFunc responding with an http.Redirect(..., redirectURi, ...)
type RedirectHandlerFunc func(redirectURI string) http.HandlerFunc
// ProviderLogin is the ability to provide OAuth authentication through the ui
type ProviderLogin interface {
SetBasePath(basePath string)
// Provides ....
Callback() Callback
SetOAuthCallbackURI(uri string)
LoggedIn() bool
LoginPath() string
SetCallbackParams(uri string, authenticated chan<- bool)
LoginHandler() http.HandlerFunc
LogoutPath() string
LogoutHandler() http.HandlerFunc
CallbackHandler(baseURI string) http.HandlerFunc
}