Documentation ¶
Index ¶
- Constants
- Variables
- func AddDefaultResponseHeaders() macaron.Handler
- func AddRenderAuthKey(orgId int64, userId int64, orgRole m.RoleType) string
- func Auth(options *AuthOptions) macaron.Handler
- func GetContextHandler() macaron.Handler
- func Gziper() macaron.Handler
- func HandleNoCacheHeader() macaron.Handler
- func Logger() macaron.Handler
- func MeasureRequestTime() macaron.Handler
- func OrgRedirect() macaron.Handler
- func Quota(target string) macaron.Handler
- func Recovery() macaron.Handler
- func RedirectFromLegacyDashboardSoloURL() macaron.Handler
- func RedirectFromLegacyDashboardURL() macaron.Handler
- func RemoveRenderAuthKey(key string)
- func RequestMetrics(handler string) macaron.Handler
- func RequestTracing(handler string) macaron.Handler
- func RoleAuth(roles ...m.RoleType) macaron.Handler
- func Sessioner(options *ms.Options, sessionConnMaxLifetime int64) macaron.Handler
- func SnapshotPublicModeOrSignedIn() macaron.Handler
- func ValidateHostHeader(domain string) macaron.Handler
- type AuthOptions
Constants ¶
View Source
const HeaderNameNoBackendCache = "X-Grafana-NoCache"
Variables ¶
View Source
var ( ReqGrafanaAdmin = Auth(&AuthOptions{ReqSignedIn: true, ReqGrafanaAdmin: true}) ReqSignedIn = Auth(&AuthOptions{ReqSignedIn: true}) ReqEditorRole = RoleAuth(m.ROLE_EDITOR, m.ROLE_ADMIN) ReqOrgAdmin = RoleAuth(m.ROLE_ADMIN) )
View Source
var AUTH_PROXY_SESSION_VAR = "authProxyHeaderValue"
Functions ¶
func AddDefaultResponseHeaders ¶
func AddDefaultResponseHeaders() macaron.Handler
func Auth ¶
func Auth(options *AuthOptions) macaron.Handler
func GetContextHandler ¶
func GetContextHandler() macaron.Handler
func HandleNoCacheHeader ¶ added in v5.4.0
func MeasureRequestTime ¶
func MeasureRequestTime() macaron.Handler
func OrgRedirect ¶
func OrgRedirect() macaron.Handler
func Recovery ¶
func Recovery() macaron.Handler
Recovery returns a middleware that recovers from any panics and writes a 500 if there was one. While Martini is in development mode, Recovery will also output the panic as HTML.
func RedirectFromLegacyDashboardSoloURL ¶ added in v5.1.0
func RedirectFromLegacyDashboardSoloURL() macaron.Handler
func RedirectFromLegacyDashboardURL ¶ added in v5.1.0
func RedirectFromLegacyDashboardURL() macaron.Handler
func RemoveRenderAuthKey ¶
func RemoveRenderAuthKey(key string)
func RequestMetrics ¶
func RequestMetrics(handler string) macaron.Handler
func RequestTracing ¶
func RequestTracing(handler string) macaron.Handler
func SnapshotPublicModeOrSignedIn ¶ added in v5.4.5
func SnapshotPublicModeOrSignedIn() macaron.Handler
func ValidateHostHeader ¶
func ValidateHostHeader(domain string) macaron.Handler
Types ¶
type AuthOptions ¶
Click to show internal directories.
Click to hide internal directories.