Commit 550eac9e authored by ale's avatar ale
Browse files

Rename NewApp to New to reduce stutter

parent bcc483e2
Pipeline #412 passed with stages
in 1 minute and 17 seconds
......@@ -191,7 +191,7 @@ func (c *serverCommand) run(ctx context.Context) error {
}
}
app, err := idpapp.NewApp(hc, &idpapp.Config{
app, err := idpapp.New(hc, &idpapp.Config{
PublicURL: c.publicURL,
CookieAuthKey: []byte(c.cookieAuthKey),
CookieEncKey: []byte(c.cookieEncKey),
......
......@@ -137,7 +137,7 @@ func newTestApp(t testing.TB) (*idpapp.App, *testMailer) {
t.Fatal(err)
}
mailer := newTestMailer()
app, err := idpapp.NewApp(hc, &idpapp.Config{
app, err := idpapp.New(hc, &idpapp.Config{
PublicURL: consentURL,
CookieAuthKey: securecookie.GenerateRandomKey(32),
CookieEncKey: securecookie.GenerateRandomKey(32),
......@@ -178,14 +178,14 @@ func newTestHTTPClient() *http.Client {
}
func newTestAppWithHydra(t testing.TB) (*http.Server, *hydraProcess) {
h := newHydra(t, consentURL + "/auth/idp/challenge")
h := newHydra(t, consentURL+"/auth/idp/challenge")
app, _ := newTestApp(t)
srv := newTestServer(app)
return srv, h
}
func newTestAppWithHydraAndMailer(t testing.TB) (*http.Server, *hydraProcess, *testMailer) {
h := newHydra(t, consentURL + "/auth/idp/challenge")
h := newHydra(t, consentURL+"/auth/idp/challenge")
app, mailer := newTestApp(t)
srv := newTestServer(app)
return srv, h, mailer
......
......@@ -43,8 +43,8 @@ type App struct {
admin *admin.Service
}
// NewApp creates a new application.
func NewApp(hc *hydra.Client, config *Config) (*App, error) {
// New creates a new application.
func New(hc *hydra.Client, config *Config) (*App, error) {
rlConfig, err := web.ParseRatelimitConfig(config.RatelimitConfig)
if err != nil {
return nil, err
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment