feat(ansible): GIT_ASKPASS per-source HTTP token auth + settings UI

This commit is contained in:
2026-06-05 18:48:00 -04:00
parent ea47169049
commit d906232eb2
4 changed files with 232 additions and 23 deletions
+9
View File
@@ -226,6 +226,9 @@ async def ansible_add_source():
entry["pull_interval_seconds"] = int(form.get("pull_interval_seconds", 3600))
except ValueError:
entry["pull_interval_seconds"] = 3600
token = form.get("http_token", "").strip()
if token:
entry["http_token"] = token
else:
entry["path"] = form.get("path", "").strip()
sources = await _get_ansible_sources()
@@ -263,6 +266,12 @@ async def ansible_save_source(idx: int):
entry["pull_interval_seconds"] = int(form.get("pull_interval_seconds", 3600))
except ValueError:
entry["pull_interval_seconds"] = 3600
token = form.get("http_token", "").strip()
if token:
entry["http_token"] = token
elif "http_token" in sources[idx]:
# Preserve existing token — password fields don't round-trip via browser
entry["http_token"] = sources[idx]["http_token"]
else:
entry["path"] = form.get("path", "").strip()
sources[idx] = entry