some work on auth/sessions

This commit is contained in:
simon987
2019-02-01 21:21:14 -05:00
parent d3188c512d
commit 9e09246a29
24 changed files with 265 additions and 66 deletions

View File

@@ -3,16 +3,19 @@ package config
import (
"github.com/Sirupsen/logrus"
"github.com/spf13/viper"
"time"
)
var Cfg struct {
ServerAddr string
DbConnStr string
WebHookSecret []byte
WebHookHash string
WebHookSigHeader string
LogLevel logrus.Level
DbLogLevels []logrus.Level
ServerAddr string
DbConnStr string
WebHookSecret []byte
WebHookHash string
WebHookSigHeader string
LogLevel logrus.Level
DbLogLevels []logrus.Level
SessionCookieName string
SessionCookieExpiration time.Duration
}
func SetupConfig() {
@@ -35,4 +38,7 @@ func SetupConfig() {
newLevel, _ := logrus.ParseLevel(level)
Cfg.DbLogLevels = append(Cfg.DbLogLevels, newLevel)
}
Cfg.SessionCookieName = viper.GetString("session.cookie_name")
Cfg.SessionCookieExpiration, err = time.ParseDuration(viper.GetString("session.expiration"))
}