MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / NewServer

Function NewServer

pkg/account/server.go:64–83  ·  view source on GitHub ↗

NewServer returns a new account app on top of the given store.

(c *component.Component, store account_store.TransactionalInterface, config oauth.Config, cspFunc func(config *oauth.Config, nonce string) string)

Source from the content-addressed store, hash-verified

62
63// NewServer returns a new account app on top of the given store.
64func NewServer(c *component.Component, store account_store.TransactionalInterface, config oauth.Config, cspFunc func(config *oauth.Config, nonce string) string) (Server, error) {
65 s := &server{
66 c: c,
67 config: config,
68 store: store,
69 session: sess.Session{
70 Store: &sessionStore{store},
71 CookieMaxAge: config.Login.SessionTTL,
72 },
73 generateCSP: cspFunc,
74 schemaDecoder: schema.NewDecoder(),
75 }
76 s.schemaDecoder.IgnoreUnknownKeys(true)
77
78 if s.config.Mount == "" {
79 s.config.Mount = s.config.UI.MountPath()
80 }
81
82 return s, nil
83}
84
85type ctxKeyType struct{}
86

Callers 3

NewFunction · 0.92
TestAuthenticationFunction · 0.92

Calls 2

NewDecoderMethod · 0.80
MountPathMethod · 0.80

Tested by 2

TestAuthenticationFunction · 0.74