agent: implement an always-200 authorize endpoint

This commit is contained in:
Mitchell Hashimoto 2018-03-21 13:02:46 -10:00
parent a54d1af421
commit d28ee70a56
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
2 changed files with 14 additions and 0 deletions

View File

@ -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
}

View File

@ -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)