pass auth by reference
This commit is contained in:
@@ -261,7 +261,7 @@ func (s *ServerCommand) newServerApp() (*serverApp, error) {
|
||||
Migrator: migr,
|
||||
ReadOnlyAge: s.ReadOnlyAge,
|
||||
SharedSecret: s.SharedSecret,
|
||||
Authenticator: *authenticator,
|
||||
Authenticator: authenticator,
|
||||
Cache: loadingCache,
|
||||
NotifyService: notifyService,
|
||||
SSLConfig: sslConfig,
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
type admin struct {
|
||||
dataService *service.DataStore
|
||||
cache cache.LoadingCache
|
||||
authenticator auth.Service
|
||||
authenticator *auth.Service
|
||||
readOnlyAge int
|
||||
migrator *Migrator
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ type Rest struct {
|
||||
Version string
|
||||
|
||||
DataService *service.DataStore
|
||||
Authenticator auth.Service
|
||||
Authenticator *auth.Service
|
||||
Cache cache.LoadingCache
|
||||
ImageProxy *proxy.Image
|
||||
CommentFormatter *store.CommentFormatter
|
||||
|
||||
@@ -62,7 +62,7 @@ func TestRest_GetStarted(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRest_Shutdown(t *testing.T) {
|
||||
srv := Rest{Authenticator: auth.Service{}, ImageProxy: &proxy.Image{}}
|
||||
srv := Rest{Authenticator: &auth.Service{}, ImageProxy: &proxy.Image{}}
|
||||
|
||||
go func() {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
@@ -91,7 +91,7 @@ func TestRest_filterComments(t *testing.T) {
|
||||
|
||||
func TestRest_RunStaticSSLMode(t *testing.T) {
|
||||
srv := Rest{
|
||||
Authenticator: *auth.NewService(auth.Opts{
|
||||
Authenticator: auth.NewService(auth.Opts{
|
||||
AvatarStore: avatar.NewLocalFS("/tmp"),
|
||||
AvatarResizeLimit: 300,
|
||||
}),
|
||||
@@ -143,7 +143,7 @@ func TestRest_RunStaticSSLMode(t *testing.T) {
|
||||
|
||||
func TestRest_RunAutocertModeHTTPOnly(t *testing.T) {
|
||||
srv := Rest{
|
||||
Authenticator: auth.Service{},
|
||||
Authenticator: &auth.Service{},
|
||||
ImageProxy: &proxy.Image{},
|
||||
SSLConfig: SSLConfig{
|
||||
SSLMode: Auto,
|
||||
@@ -191,7 +191,7 @@ func prep(t *testing.T) (srv *Rest, ts *httptest.Server) {
|
||||
|
||||
srv = &Rest{
|
||||
DataService: dataStore,
|
||||
Authenticator: *auth.NewService(auth.Opts{
|
||||
Authenticator: auth.NewService(auth.Opts{
|
||||
DevPasswd: "password",
|
||||
SecretReader: token.SecretFunc(func(id string) (string, error) { return "secret", nil }),
|
||||
AvatarStore: avatar.NewLocalFS("/tmp"),
|
||||
|
||||
Reference in New Issue
Block a user