MM-40813: Add config interface (#19571)
We create the basic boilerplate to pass services to each product. The basic idea is to have a map containing service names and the services. The server will pass all services to all products. But it is on the product, to choose what services they will actually consume. Each product will cast the received service to an interface with the methods that product requires. https://mattermost.atlassian.net/browse/MM-40813 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e96daef1e1
Коммит
dbf779b828
@@ -118,7 +118,7 @@ func (ch *Channels) servePluginRequest(w http.ResponseWriter, r *http.Request, h
|
||||
token := ""
|
||||
context := &plugin.Context{
|
||||
RequestId: model.NewId(),
|
||||
IPAddress: utils.GetIPAddress(r, ch.srv.Config().ServiceSettings.TrustedProxyIPHeader),
|
||||
IPAddress: utils.GetIPAddress(r, ch.cfgSvc.Config().ServiceSettings.TrustedProxyIPHeader),
|
||||
AcceptLanguage: r.Header.Get("Accept-Language"),
|
||||
UserAgent: r.UserAgent(),
|
||||
}
|
||||
@@ -183,7 +183,7 @@ func (ch *Channels) servePluginRequest(w http.ResponseWriter, r *http.Request, h
|
||||
mlog.String("user_id", userID),
|
||||
}
|
||||
|
||||
if *ch.srv.Config().ServiceSettings.ExperimentalStrictCSRFEnforcement {
|
||||
if *ch.cfgSvc.Config().ServiceSettings.ExperimentalStrictCSRFEnforcement {
|
||||
mlog.Warn(csrfErrorMessage, fields...)
|
||||
} else {
|
||||
mlog.Debug(csrfErrorMessage, fields...)
|
||||
@@ -212,7 +212,7 @@ func (ch *Channels) servePluginRequest(w http.ResponseWriter, r *http.Request, h
|
||||
|
||||
params := mux.Vars(r)
|
||||
|
||||
subpath, _ := utils.GetSubpathFromConfig(ch.srv.Config())
|
||||
subpath, _ := utils.GetSubpathFromConfig(ch.cfgSvc.Config())
|
||||
|
||||
newQuery := r.URL.Query()
|
||||
newQuery.Del("access_token")
|
||||
|
||||
Ссылка в новой задаче
Block a user