Files
rdp-proxy/agents/rap-node-agent/internal/agent/payload.go
T
m 20d361a886
build / backend (push) Has been cancelled
build / node-agent (push) Has been cancelled
build / worker (push) Has been cancelled
рабочий вариант, но скороть 10 МБит
2026-05-22 21:46:49 +03:00

110 lines
3.8 KiB
Go

package agent
import (
"runtime"
"github.com/example/remote-access-platform/agents/rap-node-agent/internal/client"
"github.com/example/remote-access-platform/agents/rap-node-agent/internal/state"
)
const Version = "0.2.372-vpn-opaque-channel"
func EnrollmentPayload(clusterID, joinToken string, identity state.Identity) client.EnrollRequest {
return client.EnrollRequest{
ClusterID: clusterID,
JoinToken: joinToken,
NodeName: identity.NodeName,
NodeFingerprint: identity.NodeFingerprint,
PublicKey: identity.PublicKey,
ReportedCapabilities: map[string]any{
"can_accept_client_ingress": false,
"can_accept_node_ingress": false,
"can_route_mesh": false,
"can_run_rdp_worker": true,
"can_run_vnc_worker": false,
"can_run_vpn_exit": true,
"can_run_vpn_connector": true,
"can_run_file_cache": false,
"can_run_update_cache": false,
"can_run_video_relay": false,
"native_node_agent_version": Version,
"node_update_plan_contract": "rap.node_update_plan.v1",
"node_update_status_report": true,
"host_agent_update_required": true,
"service_supervision_enabled": false,
"vpn_assignment_status": true,
"vpn_packet_forwarding": true,
"vpn_fabric_packet_transport": true,
"vpn_local_gateway_shortcut": false,
"vpn_farm_owned_dataplane": true,
"fabric_data_session_v1": true,
"fabric_session_quic_smoke": true,
"vpn_backend_relay_fallback": false,
"fabric_service_channel_required": true,
"web_ingress_workload_contract": "rap.web_ingress.workload_contract.v1",
"web_ingress_real_listener_gate": "RAP_WEB_INGRESS_RUNTIME_ENABLED",
"web_ingress_runtime_enabled": false,
"external_backend_entry_proxy": true,
},
ReportedFacts: map[string]any{
"os": runtime.GOOS,
"arch": runtime.GOARCH,
"agent": "rap-node-agent",
"agent_ver": Version,
},
RequestedRoles: []string{},
}
}
func HeartbeatPayload() client.HeartbeatRequest {
return client.HeartbeatRequest{
HealthStatus: "healthy",
ReportedVersion: Version,
Capabilities: map[string]any{
"native_node_agent": true,
"node_update_plan_contract": "rap.node_update_plan.v1",
"node_update_status_report": true,
"vpn_assignment_status": true,
"vpn_packet_forwarding": true,
"vpn_fabric_packet_transport": true,
"vpn_local_gateway_shortcut": false,
"vpn_farm_owned_dataplane": true,
"fabric_data_session_v1": true,
"fabric_session_quic_smoke": true,
"vpn_backend_relay_fallback": false,
"fabric_service_channel_required": true,
"web_ingress_workload_contract": "rap.web_ingress.workload_contract.v1",
"web_ingress_real_listener_gate": "RAP_WEB_INGRESS_RUNTIME_ENABLED",
"web_ingress_runtime_enabled": false,
"external_backend_entry_proxy": true,
},
ServiceStates: map[string]any{
"workload_supervision": "not_implemented_c3",
},
Metadata: map[string]any{
"stage": "c3",
"update_runtime": map[string]any{
"product": "rap-node-agent",
"current_version": Version,
"host_agent_present": true,
"self_update_enabled": true,
"rollback_executor_ready": true,
"reason": "host-agent updater active",
},
},
}
}
func MeshSelfObservationPayload(identity state.Identity) client.MeshLinkObservationRequest {
return client.MeshLinkObservationRequest{
SourceNodeID: identity.NodeID,
TargetNodeID: identity.NodeID,
LinkStatus: "reachable",
Metadata: map[string]any{
"stage": "c6",
"traffic_forwarding": false,
"observation_type": "self",
},
}
}