Add endpoint-bound Verizon DNS adapter

This commit is contained in:
Lyncoln
2026-09-19 18:42:13 -04:00
parent 694191b1d7
commit 5a61b6e409
3 changed files with 422 additions and 2 deletions
+20 -2
View File
@@ -6,6 +6,7 @@ import time
import requests
import urllib3
from ...adapters import Endpoint
from ...models import ProviderCapabilities, ProviderRecord
from ...normalizer import normalize_hostname, normalize_ipv4
@@ -36,9 +37,26 @@ class Plugin:
max_records=64,
)
def __init__(self, config):
def __init__(
self,
config,
endpoint: Endpoint | None = None,
):
self.config = config
self.router_url = os.getenv("ROUTER_URL", "https://192.168.1.1").rstrip("/")
self.endpoint = endpoint
if endpoint is None:
self.router_url = os.getenv(
"ROUTER_URL",
"https://192.168.1.1",
).rstrip("/")
else:
if endpoint.plugin != "verizon":
raise RuntimeError(
"Verizon provider requires a verizon endpoint"
)
self.router_url = f"https://{endpoint.address}"
self.password = os.getenv("ROUTER_PASSWORD")
if not self.password:
raise RuntimeError("ROUTER_PASSWORD is required when DNS_PROVIDER=verizon")