diff --git a/scripts/validate_version_bump.py b/scripts/validate_version_bump.py index 21b35fad..6a0c1cb4 100644 --- a/scripts/validate_version_bump.py +++ b/scripts/validate_version_bump.py @@ -1,6 +1,7 @@ import argparse +import re +import subprocess import sys -from os import popen from pathlib import Path from packaging import version @@ -19,8 +20,15 @@ def main(base_branch: str): local_path = Path(__file__).parents[1] / version_file local_version = extract_version(local_path.read_text()) - with popen(f"git fetch origin && git show {base_branch}:{version_file}") as fh: - base_version = extract_version(fh.read()) + if not re.fullmatch(r"[A-Za-z0-9._/-]+", base_branch) or base_branch.startswith("-"): + raise ValueError(f"Invalid base branch ref: {base_branch!r}") + + subprocess.run(["git", "fetch", "origin"], check=True) + base_contents = subprocess.check_output( + ["git", "show", f"{base_branch}:{version_file}"], + text=True, + ) + base_version = extract_version(base_contents) if is_version_bump(local_version, base_version): print(f"Version bump detected: {base_version} -> {local_version}") diff --git a/src/albert/__init__.py b/src/albert/__init__.py index 5629ed49..280296be 100644 --- a/src/albert/__init__.py +++ b/src/albert/__init__.py @@ -4,4 +4,4 @@ __all__ = ["Albert", "AlbertClientCredentials", "AlbertSSOClient"] -__version__ = "1.11.2" +__version__ = "1.12.0" diff --git a/src/albert/core/auth/_listener.py b/src/albert/core/auth/_listener.py index 66d45a1b..4a8f8aa7 100644 --- a/src/albert/core/auth/_listener.py +++ b/src/albert/core/auth/_listener.py @@ -31,6 +31,10 @@ def do_GET(self): status = "successful" if self.server.token else "failed (no token found)" self.send_response(200) self.send_header("Content-Type", "text/html") + self.send_header( + "Content-Security-Policy", + "default-src 'none'; frame-ancestors 'none'; base-uri 'none';", + ) self.end_headers() self.wfile.write( f""" @@ -38,8 +42,6 @@ def do_GET(self):
You can close this window now.
- -