From d28ee70a56735c3d6e3dd035b06596deadad6e0e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 21 Mar 2018 13:02:46 -1000 Subject: [PATCH] agent: implement an always-200 authorize endpoint --- agent/agent_endpoint.go | 13 +++++++++++++ agent/http_oss.go | 1 + 2 files changed, 14 insertions(+) diff --git a/agent/agent_endpoint.go b/agent/agent_endpoint.go index bc684f115c..1cbb4b1da7 100644 --- a/agent/agent_endpoint.go +++ b/agent/agent_endpoint.go @@ -885,3 +885,16 @@ func (s *HTTPServer) AgentConnectCALeafCert(resp http.ResponseWriter, req *http. return &reply, nil } + +// AgentConnectAuthorize +// +// POST /v1/agent/connect/authorize +func (s *HTTPServer) AgentConnectAuthorize(resp http.ResponseWriter, req *http.Request) (interface{}, error) { + // Test the method + if req.Method != "POST" { + return nil, MethodNotAllowedError{req.Method, []string{"POST"}} + } + + // NOTE(mitchellh): return 200 for now. To be implemented later. + return nil, nil +} diff --git a/agent/http_oss.go b/agent/http_oss.go index 6c2e697eaa..774388ad3e 100644 --- a/agent/http_oss.go +++ b/agent/http_oss.go @@ -29,6 +29,7 @@ func init() { registerEndpoint("/v1/agent/check/warn/", []string{"PUT"}, (*HTTPServer).AgentCheckWarn) registerEndpoint("/v1/agent/check/fail/", []string{"PUT"}, (*HTTPServer).AgentCheckFail) registerEndpoint("/v1/agent/check/update/", []string{"PUT"}, (*HTTPServer).AgentCheckUpdate) + registerEndpoint("/v1/agent/connect/authorize", []string{"POST"}, (*HTTPServer).AgentConnectAuthorize) registerEndpoint("/v1/agent/connect/ca/roots", []string{"GET"}, (*HTTPServer).AgentConnectCARoots) registerEndpoint("/v1/agent/connect/ca/leaf/", []string{"GET"}, (*HTTPServer).AgentConnectCALeafCert) registerEndpoint("/v1/agent/service/register", []string{"PUT"}, (*HTTPServer).AgentRegisterService)