refactor(mock/openid): use interface for handler

This commit is contained in:
Trong Huu Nguyen
2022-09-02 18:43:59 +02:00
parent 08eefbf1d5
commit 2a80bd7765

View File

@@ -20,20 +20,31 @@ import (
"github.com/nais/wonderwall/pkg/cookie"
"github.com/nais/wonderwall/pkg/crypto"
handlerpkg "github.com/nais/wonderwall/pkg/handler"
errorhandler "github.com/nais/wonderwall/pkg/handler/error"
"github.com/nais/wonderwall/pkg/ingress"
"github.com/nais/wonderwall/pkg/openid"
openidclient "github.com/nais/wonderwall/pkg/openid/client"
openidconfig "github.com/nais/wonderwall/pkg/openid/config"
scopespkg "github.com/nais/wonderwall/pkg/openid/scopes"
"github.com/nais/wonderwall/pkg/router"
"github.com/nais/wonderwall/pkg/session"
)
type RelyingPartyHandler interface {
router.Source
GetClient() *openidclient.Client
GetCrypter() crypto.Crypter
GetErrorHandler() errorhandler.Handler
GetSessions() *session.Handler
SetIngresses(ingresses *ingress.Ingresses)
}
type IdentityProvider struct {
Cfg *config.Config
OpenIDConfig *TestConfiguration
ProviderHandler *IdentityProviderHandler
ProviderServer *httptest.Server
RelyingPartyHandler *handlerpkg.StandardHandler
RelyingPartyHandler RelyingPartyHandler
RelyingPartyServer *httptest.Server
}