feat: thread SVN auth (username/password) through all svn call sites

This commit is contained in:
2026-06-23 13:23:44 +02:00
parent 45fb8c40d0
commit 99a056d9fb
7 changed files with 56 additions and 20 deletions
+15 -1
View File
@@ -28,6 +28,14 @@ class SVNConfig:
trunk: str = "trunk"
branches: str = "branches"
tags: str = "tags"
username: Optional[str] = None
password: Optional[str] = None
def auth_args(self) -> list:
"""Return ``['--username', u, '--password', p]`` if configured, else []."""
if self.username:
return ["--username", self.username, "--password", self.password or ""]
return []
@classmethod
def from_dict(cls, d: dict, prefix: str) -> "SVNConfig":
@@ -47,7 +55,13 @@ class SVNConfig:
for name, val in [("trunk", trunk), ("branches", branches), ("tags", tags)]:
_check_type(val, str, f"{prefix}.{name}")
return cls(url=url, layout=layout, trunk=trunk, branches=branches, tags=tags)
username = d.get("username")
_check_optional(username, str, f"{prefix}.username")
password = d.get("password")
_check_optional(password, str, f"{prefix}.password")
return cls(url=url, layout=layout, trunk=trunk, branches=branches,
tags=tags, username=username, password=password)
@dataclass