Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
f257101c
Commit
f257101c
authored
Jan 24, 2019
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removes unused/commented code
parent
ff483f37
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
2 additions
and
42 deletions
+2
-42
conf/defaults.ini
+0
-1
pkg/middleware/auth_proxy.go
+1
-1
pkg/middleware/middleware.go
+0
-23
pkg/middleware/recovery_test.go
+1
-2
pkg/middleware/session.go
+0
-13
pkg/setting/setting.go
+0
-2
No files found.
conf/defaults.ini
View file @
f257101c
...
...
@@ -143,7 +143,6 @@ provider = file
provider_config
=
sessions
# Session cookie name
cookie_name
=
grafana_sess
...
...
pkg/middleware/auth_proxy.go
View file @
f257101c
...
...
@@ -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
,
...
...
pkg/middleware/middleware.go
View file @
f257101c
...
...
@@ -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
==
""
{
...
...
pkg/middleware/recovery_test.go
View file @
f257101c
...
...
@@ -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
())
...
...
pkg/middleware/session.go
deleted
100644 → 0
View file @
ff483f37
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())
// }
// }
// }
pkg/setting/setting.go
View file @
f257101c
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment