summaryrefslogtreecommitdiffstats
path: root/app/app.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2018-02-07 11:05:46 -0600
committerHarrison Healey <harrisonmhealey@gmail.com>2018-02-07 12:05:46 -0500
commiteff65aa05c74e93533c2504b8141b0474011e68c (patch)
tree60bec436bb92818bb1498fe2e7e4083ab13b7142 /app/app.go
parent7bd298ceaa24c0721e0acd65692cb2d1ca4983f3 (diff)
downloadchat-eff65aa05c74e93533c2504b8141b0474011e68c.tar.gz
chat-eff65aa05c74e93533c2504b8141b0474011e68c.tar.bz2
chat-eff65aa05c74e93533c2504b8141b0474011e68c.zip
ABC-132: sign error page parameters (#8197)
* sign error page parameters * add comments
Diffstat (limited to 'app/app.go')
-rw-r--r--app/app.go22
1 files changed, 14 insertions, 8 deletions
diff --git a/app/app.go b/app/app.go
index 1e46d29d0..0b5efa76b 100644
--- a/app/app.go
+++ b/app/app.go
@@ -4,6 +4,7 @@
package app
import (
+ "crypto/ecdsa"
"html/template"
"net"
"net/http"
@@ -60,13 +61,14 @@ type App struct {
newStore func() store.Store
- htmlTemplateWatcher *utils.HTMLTemplateWatcher
- sessionCache *utils.Cache
- roles map[string]*model.Role
- configListenerId string
- licenseListenerId string
- disableConfigWatch bool
- configWatcher *utils.ConfigWatcher
+ htmlTemplateWatcher *utils.HTMLTemplateWatcher
+ sessionCache *utils.Cache
+ roles map[string]*model.Role
+ configListenerId string
+ licenseListenerId string
+ disableConfigWatch bool
+ configWatcher *utils.ConfigWatcher
+ asymmetricSigningKey *ecdsa.PrivateKey
pluginCommands []*PluginCommand
pluginCommandsLock sync.RWMutex
@@ -139,6 +141,10 @@ func New(options ...Option) (*App, error) {
}
app.Srv.Store = app.newStore()
+ if err := app.ensureAsymmetricSigningKey(); err != nil {
+ return nil, errors.Wrapf(err, "unable to ensure asymmetric signing key")
+ }
+
app.initJobs()
app.initBuiltInPlugins()
@@ -448,5 +454,5 @@ func (a *App) Handle404(w http.ResponseWriter, r *http.Request) {
l4g.Debug("%v: code=404 ip=%v", r.URL.Path, utils.GetIpAddress(r))
- utils.RenderWebError(err, w, r)
+ utils.RenderWebAppError(w, r, err, a.AsymmetricSigningKey())
}