mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 21:09:58 +00:00
TUN-6142: Add tunnel details support to RPC
This commit adds the tunnel details to RPC register connection response so we can have access to some of the details associacted to the tunnel that only the edge knows. Currently this is limited to knowing if the tunnel is remotely managed or not. In the future we could extend this with more information.
This commit is contained in:
@@ -224,8 +224,9 @@ func (a *TunnelAuth) UnmarshalCapnproto(s tunnelrpc.TunnelAuth) error {
|
||||
}
|
||||
|
||||
type ConnectionDetails struct {
|
||||
UUID uuid.UUID
|
||||
Location string
|
||||
UUID uuid.UUID
|
||||
Location string
|
||||
TunnelIsRemotelyManaged bool
|
||||
}
|
||||
|
||||
func (details *ConnectionDetails) MarshalCapnproto(s tunnelrpc.ConnectionDetails) error {
|
||||
@@ -235,6 +236,7 @@ func (details *ConnectionDetails) MarshalCapnproto(s tunnelrpc.ConnectionDetails
|
||||
if err := s.SetLocationName(details.Location); err != nil {
|
||||
return err
|
||||
}
|
||||
s.SetTunnelIsRemotelyManaged(details.TunnelIsRemotelyManaged)
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -252,6 +254,7 @@ func (details *ConnectionDetails) UnmarshalCapnproto(s tunnelrpc.ConnectionDetai
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
details.TunnelIsRemotelyManaged = s.TunnelIsRemotelyManaged()
|
||||
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user