feat(agentcompat): expose dashboard capability routes

Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
This commit is contained in:
naiba
2026-07-20 04:30:50 +00:00
co-authored by naiba/CloudCode
parent 0c6eb416a5
commit 2640b86d3a
42 changed files with 4083 additions and 271 deletions
@@ -0,0 +1,25 @@
//go:build !agentcompat
package rpc
import (
"net/http"
"github.com/nezhahq/nezha/model"
serviceRPC "github.com/nezhahq/nezha/service/rpc"
)
type natCapabilityLease struct {
active bool
publicationOwned bool
streamLease *serviceRPC.AgentCompatNATStreamLease
access serviceRPC.AgentCompatCapabilityAccess
handle serviceRPC.AgentCompatNATPublishHandle
}
func prepareNATCapability(request *http.Request, _ *model.NAT) (natCapabilityLease, error) {
request.Header.Del("Authorization")
return natCapabilityLease{}, nil
}
func (lease natCapabilityLease) cleanup(*serviceRPC.NezhaHandler) {}