feat(storage): support signed read options and local byte ranges

This commit is contained in:
2026-09-30 22:44:54 +08:00
parent 01a03149f9
commit f0c62152d7
29 changed files with 1395 additions and 30 deletions

View File

@@ -162,6 +162,11 @@ def main():
"remoteCheckConfigBeforeDependencies", "removedImplicitEnvironmentRules"]
for package, expected in {
"storage": {"TestReadOptions", "TestReadSignatureAndExpiry", "TestReadRangeStreamingAndCache"},
"storage/local": {"TestSignedPayloadRanges"},
"storage/oss": {"TestReadOptionsNativeSignatures"},
"storage/s3": {"TestReadOptionsS3AndR2"},
"examples/signedRead": {"TestSignedReadHTTP"},
"copyx": {"TestCheckTypesAndEmptyCollections", "TestCheckRulesAndConverterBoundaries", "TestCopierCheckConcurrentAndOptionsIsolation"},
"logx": {"TestLoggerTimeZoneIsolation", "TestLoggerTimeZoneValidationAndDST", "TestLoggerTimeZoneConcurrentChildren"},
"cors": {"TestPolicyPreflightAndActual", "TestPolicyValidation", "TestPolicyCredentialsWildcardAndDuplicates", "TestPolicyPreservesHTTPAndSnapshot"},
@@ -181,6 +186,11 @@ def main():
events = [json.loads(line) for line in output.splitlines() if line.startswith("{")]
passed = {event.get("Test") for event in events if event.get("Action") == "pass"}
assert expected <= passed
signed_read_output = run(["go", "run", MODULE + "/examples/signedRead", "-check"], starter, env)
assert "PDF preview, Chinese filename, download, HEAD and Range passed" in signed_read_output
checks += ["remoteSignedReadOptionsAndLegacyLinks", "remoteReadSignatureTamperingAndExpiry",
"remoteLocalPayloadRangesAndHEAD", "remoteOSSNativeV1V4Signatures",
"remoteS3R2ReadOptions", "remoteSignedReadHTTPExample"]
checks += ["remotePreciseModuleDiagnostics", "remoteJSONSuccessStatuses", "remoteRejectedStatusBodyCleanup",
"remoteCopyTypePreflight", "remoteEmptyCollectionTypeRejection", "remoteLoggerTimeZoneIsolation",
"remoteCORSPolicyRace", "remoteCORSErrorResponses", "remoteCORSTransports", "generatedCORSConfigOnly"]
@@ -247,6 +257,8 @@ def main():
sources += ["app/body.go", "app/router.go", "app/requests.go", "app/bodyPolicy_test.go", "app/requests_test.go", "app/transport_test.go",
"httpx/context.go", "internal/httplimits/limits.go", "lifecycle/runtime_test.go", "transport/http2/server.go", "transport/http2/lifecycle_test.go",
"transport/native/server.go", "transport/native/earlyReject_test.go", "examples/httpSafety/main.go"]
sources += [str(p.relative_to(ROOT)) for p in (ROOT / "storage").rglob("*.go")]
sources += [str(p.relative_to(ROOT)) for p in (ROOT / "examples/signedRead").glob("*.go")]
report = {"passed": True, "frameworkVersion": args.version, "frameworkSum": dependency["Sum"],
"freshModuleCache": True, "noLocalReplace": True,
"durationSeconds": round(time.monotonic() - started, 2), "checks": checks,