Began work on hashing api keys

This commit is contained in:
Torkel Ödegaard
2015-02-09 13:30:04 +01:00
parent c9f06e1da1
commit 5269422f7c
6 changed files with 33 additions and 29 deletions
+3 -5
View File
@@ -2,10 +2,10 @@ package api
import (
"github.com/Unknwon/macaron"
"github.com/macaron-contrib/binding"
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/middleware"
m "github.com/grafana/grafana/pkg/models"
"github.com/macaron-contrib/binding"
)
// Register adds http routes
@@ -61,10 +61,8 @@ func Register(r *macaron.Macaron) {
// auth api keys
r.Group("/auth/keys", func() {
r.Combo("/").
Get(GetApiKeys).
Post(bind(m.AddApiKeyCommand{}), AddApiKey).
Put(bind(m.UpdateApiKeyCommand{}), UpdateApiKey)
r.Get("/", GetApiKeys)
r.Post("/", bind(m.AddApiKeyCommand{}), AddApiKey)
r.Delete("/:id", DeleteApiKey)
}, reqAccountAdmin)