mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-12-04 02:38:18 +00:00
fix(valid-detection-benchmark): normalize mixed-case .git suffixes in reservation identity
A reference such as OWNER/REPO.GIT escaped the reserved-identity check at both reservation sites because the suffix was stripped case-sensitively. One shared strip now handles the suffix case-insensitively; identities without a mixed-case suffix are byte-identical.
This commit is contained in:
@@ -23,6 +23,7 @@ from benchmarks.valid.reservation import (
|
||||
census_bytes,
|
||||
)
|
||||
from benchmarks.valid.reservation_guard_sources import PINNED_LEGACY_RESERVATION_SOURCE_DIGESTS
|
||||
from benchmarks.valid.reservation_identity import strip_git_suffix
|
||||
from openultrasast.core.canonical import JsonValue, content_digest
|
||||
|
||||
GUARD_REPORT_SCHEMA = "openultrasast.valid-detection-benchmark.reservation-guard.v1"
|
||||
@@ -175,7 +176,7 @@ def _historical_paths(root: Path, withdrawal: HistoricalWithdrawalV1 | None) ->
|
||||
|
||||
|
||||
def _repository_matches(content: bytes) -> tuple[str, ...]:
|
||||
values = {match.group(1).decode("ascii").removesuffix(".git") for match in _REPOSITORY.finditer(content)}
|
||||
values = {strip_git_suffix(match.group(1).decode("ascii")) for match in _REPOSITORY.finditer(content)}
|
||||
return tuple(sorted(f"https://github.com/{value}" for value in values))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user