Commit f257101c by bergquist

removes unused/commented code

parent ff483f37
......@@ -143,7 +143,6 @@ provider = file
provider_config = sessions
# Session cookie name
cookie_name = grafana_sess
......
......@@ -68,7 +68,7 @@ func initContextWithAuthProxy(ctx *m.ReqContext, orgID int64) bool {
query.UserId = getRequestUserId(ctx)
// if we're using ldap, pass authproxy login name to ldap user sync
} else if setting.LdapEnabled {
ctx.Session.Delete(session.SESS_KEY_LASTLDAPSYNC) //makes sure we always sync with ldap if session if we only have last sync info in session but not user.
ctx.Session.Delete(session.SESS_KEY_LASTLDAPSYNC)
syncQuery := &m.LoginUserQuery{
ReqContext: ctx,
......
......@@ -88,29 +88,6 @@ func initContextWithAnonymousUser(ctx *m.ReqContext) bool {
return true
}
// func initContextWithUserSessionCookie(ctx *m.ReqContext, orgId int64) bool {
// // initialize session
// if err := ctx.Session.Start(ctx.Context); err != nil {
// ctx.Logger.Error("Failed to start session", "error", err)
// return false
// }
// var userId int64
// if userId = getRequestUserId(ctx); userId == 0 {
// return false
// }
// query := m.GetSignedInUserQuery{UserId: userId, OrgId: orgId}
// if err := bus.Dispatch(&query); err != nil {
// ctx.Logger.Error("Failed to get user with id", "userId", userId, "error", err)
// return false
// }
// ctx.SignedInUser = query.Result
// ctx.IsSignedIn = true
// return true
// }
func initContextWithApiKey(ctx *m.ReqContext) bool {
var keyString string
if keyString = getApiKey(ctx); keyString == "" {
......
......@@ -9,7 +9,7 @@ import (
"github.com/grafana/grafana/pkg/services/session"
"github.com/grafana/grafana/pkg/setting"
. "github.com/smartystreets/goconvey/convey"
"gopkg.in/macaron.v1"
macaron "gopkg.in/macaron.v1"
)
func TestRecoveryMiddleware(t *testing.T) {
......@@ -67,7 +67,6 @@ func recoveryScenario(desc string, url string, fn scenarioFunc) {
sc.m.Use(GetContextHandler(sc.userAuthTokenService))
// mock out gc goroutine
session.StartSessionGC = func() {}
//sc.m.Use(Sessioner(&ms.Options{}, 0))
sc.m.Use(OrgRedirect())
sc.m.Use(AddDefaultResponseHeaders())
......
package middleware
// func Sessioner(options *ms.Options, sessionConnMaxLifetime int64) macaron.Handler {
// session.Init(options, sessionConnMaxLifetime)
// return func(ctx *m.ReqContext) {
// ctx.Next()
// if err := ctx.Session.Release(); err != nil {
// panic("session(release): " + err.Error())
// }
// }
// }
......@@ -223,7 +223,6 @@ type Cfg struct {
EnterpriseLicensePath string
LoginCookieName string
LoginCookieUsername string
LoginCookieSecure bool
LoginCookieMaxDays int
LoginCookieRotation time.Duration
......@@ -556,7 +555,6 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
cfg.LoginCookieName = login.Key("cookie_name").MustString("grafana_session")
cfg.LoginCookieMaxDays = login.Key("login_remember_days").MustInt(7)
cfg.LoginCookieSecure = login.Key("cookie_secure").MustBool(false)
cfg.LoginCookieUsername = login.Key("cookie_username").MustString("grafana_username")
cfg.LoginDeleteExpiredTokensAfterDays = login.Key("delete_expired_token_after_days").MustInt(30)
cfg.LoginCookieRotation = login.Key("rotate_cookie_every").MustDuration(time.Minute * 30)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment