Browse Source

agent: implement an always-200 authorize endpoint

pull/4275/head
Mitchell Hashimoto 7 years ago
parent
commit
d28ee70a56
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
  1. 13
      agent/agent_endpoint.go
  2. 1
      agent/http_oss.go

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

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

Loading…
Cancel
Save