added auth method
This commit is contained in:
parent
7715fcf373
commit
a735b9cc5e
8 changed files with 270 additions and 12 deletions
|
|
@ -2,10 +2,10 @@ package server
|
|||
|
||||
import (
|
||||
"git.giftfish.de/ston1th/haproxy-lb/pkg/api"
|
||||
"git.giftfish.de/ston1th/haproxy-lb/pkg/api/v1/schema"
|
||||
schemav1 "git.giftfish.de/ston1th/haproxy-lb/pkg/api/v1/schema"
|
||||
)
|
||||
|
||||
const version = "/" + schema.Version
|
||||
const v1 = "/" + schemav1.Version
|
||||
|
||||
var routes = []api.Route{
|
||||
{
|
||||
|
|
@ -14,8 +14,13 @@ var routes = []api.Route{
|
|||
[]string{"GET"},
|
||||
},
|
||||
{
|
||||
version + "/alloc",
|
||||
authHandler(allocHandler),
|
||||
[]string{"POST"},
|
||||
v1 + "/lb",
|
||||
authHandler(lbListHandler),
|
||||
[]string{"GET"},
|
||||
},
|
||||
{
|
||||
v1 + "/lb/{cluster:[a-zA-Z0-9-]+}/{name:[a-zA-Z0-9-]+$}",
|
||||
authHandler(lbHandler),
|
||||
[]string{"GET", "POST", "DELETE"},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue