update admin proxies: handle ACME DNS 01 proxy

This commit is contained in:
AJ ONeal 2020-07-22 07:11:24 +00:00
parent d5b2837033
commit 6b7a642350
2 changed files with 10 additions and 1 deletions

View File

@ -3,7 +3,10 @@
"api_host": ":hostname/api",
"authn": {
"method": "GET",
"pathname": "inspect"
"pathname": ""
},
"acme_dns_01_proxy": {
"pathname": "dns"
},
"pair_request": {
"method": "POST",

View File

@ -53,9 +53,15 @@ func InitAdmin(authURL string) {
r.URL.Path = strings.TrimPrefix(r.URL.Path, "/api")
proxyHandler.ServeHTTP(w, r)
}
// Proxy mgmt server Registration & Authentication
r.Get("/api/inspect", proxyHandleFunc)
r.Post("/api/register-device", proxyHandleFunc)
r.Post("/api/register-device/*", proxyHandleFunc)
// Proxy mgmt server ACME DNS 01 Challenges
r.Get("/api/dns/*", proxyHandleFunc)
r.Route("/api", func(r chi.Router) {
// TODO token needs a globally unique subject