removes unused/commented code
This commit is contained in:
@@ -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())
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
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())
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
Reference in New Issue
Block a user