(self)
return peers
Returns list of wireguard peers, the result is cached.
Returns list of wireguard peers, the result is cached.
Returns list of wireguard peers the result is cached .
def _get_wireguard_peers(self):
        """
        Returns list of wireguard peers, the result is cached.
        """
        peers = []
        for vpnclient in self._get_peer_queryset():
            if vpnclient.ip:
                ip_address = ipaddress.ip_address(vpnclient.ip.ip_address)
                peers.append(
                    {
                        'public_key': vpnclient.public_key,
                        'allowed_ips': f'{ip_address}/{ip_address.max_prefixlen}',
                    }
                )
        return peers
def _get_wireguard_peers ( self ) : peers = [ ] for vpnclient in self . _get_peer_queryset ( ) : if vpnclient . ip : ip_address = ipaddress . ip_address ( vpnclient . ip . ip_address ) peers . append ( { 'public_key' : vpnclient . public_key , 'allowed_ips' : f'{ip_address}/{ip_address.max_prefixlen}' , } ) return peers