18 lines
485 B
Python
18 lines
485 B
Python
from core.models.BaseConnection import BaseConnection
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass
|
|
class SessionConnection(BaseConnection):
|
|
masked: bool = False
|
|
|
|
def __post_init__(self):
|
|
|
|
if self.code not in ('system', 'tor', 'wireguard'):
|
|
raise ValueError('Invalid connection code.')
|
|
|
|
def is_unprotected(self):
|
|
return self.code == 'system' and self.masked is False
|
|
|
|
def needs_proxy_configuration(self):
|
|
return self.masked is True
|