mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 23:22:16 +08:00
add Token authentication support
Added CRUD methods for Tokens. Extend Auth Handler to check for the presence of a Bearer Authorization header to authenticate against. If there is no header, or the token is not valid, the Auth Handler falls back to looking for a Session.
This commit is contained in:
@ -26,6 +26,12 @@ func Register(m *macaron.Macaron) {
|
||||
m.Post("/api/account/using/:id", auth, SetUsingAccount)
|
||||
m.Get("/api/account/others", auth, GetOtherAccounts)
|
||||
|
||||
// Token
|
||||
m.Get("/api/tokens/list", auth, GetTokens)
|
||||
m.Put("/api/tokens", auth, AddToken)
|
||||
m.Post("/api/tokens", auth, UpdateToken)
|
||||
m.Delete("/api/tokens/:id", auth, DeleteToken)
|
||||
|
||||
// data sources
|
||||
m.Get("/acount/datasources/", auth, Index)
|
||||
m.Get("/api/datasources/list", auth, GetDataSources)
|
||||
|
Reference in New Issue
Block a user