This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2022-01-24 20:41:15 +00:00
|
|
|
package application
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/quasoft/memstore"
|
|
|
|
"goauthentik.io/api"
|
|
|
|
"goauthentik.io/internal/outpost/ak"
|
|
|
|
)
|
|
|
|
|
|
|
|
func newTestApplication() *Application {
|
|
|
|
a, _ := NewApplication(
|
|
|
|
api.ProxyOutpostConfig{
|
|
|
|
Name: ak.TestSecret(),
|
|
|
|
ClientId: api.PtrString(ak.TestSecret()),
|
|
|
|
ClientSecret: api.PtrString(ak.TestSecret()),
|
|
|
|
CookieSecret: api.PtrString(ak.TestSecret()),
|
2022-02-15 12:43:55 +00:00
|
|
|
ExternalHost: "https://ext.t.goauthentik.io",
|
2022-01-24 20:41:15 +00:00
|
|
|
CookieDomain: api.PtrString(""),
|
|
|
|
Mode: api.PROXYMODE_FORWARD_SINGLE.Ptr(),
|
|
|
|
SkipPathRegex: api.PtrString("/skip.*"),
|
|
|
|
BasicAuthEnabled: api.PtrBool(true),
|
|
|
|
BasicAuthUserAttribute: api.PtrString("username"),
|
|
|
|
BasicAuthPasswordAttribute: api.PtrString("password"),
|
|
|
|
},
|
|
|
|
http.DefaultClient,
|
|
|
|
nil,
|
|
|
|
ak.MockAK(
|
|
|
|
api.Outpost{
|
|
|
|
Config: map[string]interface{}{
|
|
|
|
"authentik_host": ak.TestSecret(),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
ak.MockConfig(),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
a.sessions = memstore.NewMemStore(
|
|
|
|
[]byte(ak.TestSecret()),
|
|
|
|
)
|
|
|
|
return a
|
|
|
|
}
|