← back to Cf Dns Migration
migrate GoDaddy auth → Bearer PAT (TK-10 key rotation); sso-key fallback retained
0393dd36d21485de0e9856a728626c918b37216d · 2026-07-27 20:04:55 -0700 · Steve Abrams
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Files touched
Diff
commit 0393dd36d21485de0e9856a728626c918b37216d
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Mon Jul 27 20:04:55 2026 -0700
migrate GoDaddy auth → Bearer PAT (TK-10 key rotation); sso-key fallback retained
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
stage.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/stage.py b/stage.py
index 670c5d7..8ffbe54 100644
--- a/stage.py
+++ b/stage.py
@@ -30,6 +30,9 @@ def load_env(path):
return e
E = load_env(ENV)
GD_KEY = E.get("GODADDY_API_KEY"); GD_SEC = E.get("GODADDY_API_SECRET")
+GD_PAT = E.get("GODADDY_PAT")
+# Prefer a Bearer PAT when present (TK-10 key rotation); else legacy sso-key.
+GD_AUTH = f"Bearer {GD_PAT}" if GD_PAT else f"sso-key {GD_KEY}:{GD_SEC}"
CF_TOKEN = E.get("CLOUDFLARE_API_TOKEN") or E.get("CF_API_TOKEN") or E.get("CLOUDFLARE_DNS_TOKEN")
COPY_TYPES = {"A", "AAAA", "CNAME", "MX", "TXT", "SRV", "CAA", "NS_SUB"} # zone-apex NS handled by CF
@@ -53,7 +56,7 @@ def gd_records(domain, tries=5):
earlier run's 135 'no records' were false empties from being throttled."""
for i in range(tries):
st, d = req(f"https://api.godaddy.com/v1/domains/{domain}/records",
- headers={"Authorization": f"sso-key {GD_KEY}:{GD_SEC}"})
+ headers={"Authorization": GD_AUTH})
if st == 200 and isinstance(d, list):
return d
if st == 429 or st == 0 or (isinstance(d, dict) and d.get("code") == "TOO_MANY_REQUESTS"):
← 9f7662a stage.py fixes: GoDaddy read backoff/retry (kills false-empt
·
back to Cf Dns Migration
·
auto-save: 2026-07-27T20:24:23 (1 files) — __pycache__/ 207bbad →