From 563d598aeee9b439fa9fac820ce50f8c30e1a3d5 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 16 May 2016 12:47:40 +0200 Subject: [PATCH] api auth --- api/aliases.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/aliases.go b/api/aliases.go index e7b8a5b..83983d0 100644 --- a/api/aliases.go +++ b/api/aliases.go @@ -23,7 +23,8 @@ func NewAliases (config *models.Config, router *httprouter.Router,prefix string, router.GET(prefix, api.GetAll) router.GET(prefix+"/ansible", api.AnsibleDiff) router.GET(prefix+"/cleanup", api.Cleanup) - router.GET(prefix+"/alias/:nodeid", BasicAuth(api.GetOne, []byte(config.Webserver.Api.Passphrase))) + router.GET(prefix+"/auth", BasicAuth(api.Cleanup, []byte(config.Webserver.Api.Passphrase))) + router.GET(prefix+"/alias/:nodeid", api.GetOne) router.POST(prefix+"/alias/:nodeid", BasicAuth(api.SaveOne,[]byte(config.Webserver.Api.Passphrase))) } func (api *ApiAliases) cleaner(){