-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.go
63 lines (50 loc) · 1.15 KB
/
settings.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package gw
import (
"crypto/rsa"
"github.com/auth0/go-jwt-middleware"
"github.com/oxtoacart/bpool"
"html/template"
)
type Settings interface {
GetLDAP() []LDAPConfiguration
SetTemplates(map[string]*template.Template)
GetTemplates() map[string]*template.Template
GetPool() *bpool.BufferPool
GetJWT() *jwtmiddleware.JWTMiddleware
GetJWTSigningKey() *rsa.PrivateKey
GetJWTPublicKey() string
GetEvents() Events
GetCORSOptions() *CORSOptions
}
type Events interface {
OnLogin(*LDAPUser) error
}
type MockSettings struct {
}
func (s MockSettings) GetLDAP() []LDAPConfiguration {
return nil
}
func (s MockSettings) SetTemplates(map[string]*template.Template) {
return
}
func (s MockSettings) GetTemplates() map[string]*template.Template {
return nil
}
func (s MockSettings) GetPool() *bpool.BufferPool {
return nil
}
func (s MockSettings) GetJWT() *jwtmiddleware.JWTMiddleware {
return nil
}
func (s MockSettings) GetJWTSigningKey() *rsa.PrivateKey {
return nil
}
func (s MockSettings) GetJWTPublicKey() string {
return ""
}
func (s MockSettings) GetEvents() Events {
return nil
}
func (s MockSettings) GetCORSOptions() *CORSOptions {
return nil
}