summaryrefslogtreecommitdiffstats
path: root/services/auth
diff options
context:
space:
mode:
Diffstat (limited to 'services/auth')
-rw-r--r--services/auth/group.go5
-rw-r--r--services/auth/interface.go2
-rw-r--r--services/auth/sspi_windows.go12
3 files changed, 7 insertions, 12 deletions
diff --git a/services/auth/group.go b/services/auth/group.go
index 0f40e1a76c..bbafe64b49 100644
--- a/services/auth/group.go
+++ b/services/auth/group.go
@@ -5,6 +5,7 @@
package auth
import (
+ "context"
"net/http"
"reflect"
"strings"
@@ -51,14 +52,14 @@ func (b *Group) Name() string {
}
// Init does nothing as the Basic implementation does not need to allocate any resources
-func (b *Group) Init() error {
+func (b *Group) Init(ctx context.Context) error {
for _, method := range b.methods {
initializable, ok := method.(Initializable)
if !ok {
continue
}
- if err := initializable.Init(); err != nil {
+ if err := initializable.Init(ctx); err != nil {
return err
}
}
diff --git a/services/auth/interface.go b/services/auth/interface.go
index a05ece2078..ecc9ad2ca6 100644
--- a/services/auth/interface.go
+++ b/services/auth/interface.go
@@ -34,7 +34,7 @@ type Method interface {
type Initializable interface {
// Init should be called exactly once before using any of the other methods,
// in order to allow the plugin to allocate necessary resources
- Init() error
+ Init(ctx context.Context) error
}
// Named represents a named thing
diff --git a/services/auth/sspi_windows.go b/services/auth/sspi_windows.go
index 7e31378b6c..757d596c4c 100644
--- a/services/auth/sspi_windows.go
+++ b/services/auth/sspi_windows.go
@@ -5,6 +5,7 @@
package auth
import (
+ "context"
"errors"
"net/http"
"strings"
@@ -52,21 +53,14 @@ type SSPI struct {
}
// Init creates a new global websspi.Authenticator object
-func (s *SSPI) Init() error {
+func (s *SSPI) Init(ctx context.Context) error {
config := websspi.NewConfig()
var err error
sspiAuth, err = websspi.New(config)
if err != nil {
return err
}
- s.rnd = render.New(render.Options{
- Extensions: []string{".tmpl"},
- Directory: "templates",
- Funcs: templates.NewFuncMap(),
- Asset: templates.GetAsset,
- AssetNames: templates.GetAssetNames,
- IsDevelopment: !setting.IsProd,
- })
+ _, s.rnd = templates.HTMLRenderer(ctx)
return nil
}