fix(agent99): align transport framing with payload cap
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m27s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m27s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -336,11 +336,12 @@ compressed = gzip.compress(
|
||||
)
|
||||
payload = base64.b64encode(compressed).decode("ascii")
|
||||
line_width = 65536
|
||||
max_payload_lines = 16
|
||||
payload_lines = [
|
||||
payload[offset : offset + line_width]
|
||||
for offset in range(0, len(payload), line_width)
|
||||
]
|
||||
if not payload_lines or len(payload_lines) > 8:
|
||||
if not payload_lines or len(payload_lines) > max_payload_lines:
|
||||
raise SystemExit("remote_bootstrap_payload_line_contract_failed")
|
||||
output_path.write_text(
|
||||
"\n".join(payload_lines) + "\n" + sentinel + "\n",
|
||||
@@ -504,8 +505,9 @@ if ($allLines.Count -lt 2 -or $allLines[-1] -cne $sentinel) {{
|
||||
throw "remote_bootstrap_sentinel_missing"
|
||||
}}
|
||||
$payloadLines = @($allLines[0..($allLines.Count - 2)])
|
||||
$maxPayloadLines = 16
|
||||
$charCount = [int](($payloadLines | Measure-Object -Property Length -Sum).Sum) + (2 * $payloadLines.Count)
|
||||
if ($payloadLines.Count -gt 8 -or $charCount -gt 1048576) {{
|
||||
if ($payloadLines.Count -gt $maxPayloadLines -or $charCount -gt 1048576) {{
|
||||
throw "remote_bootstrap_input_limit_exceeded"
|
||||
}}
|
||||
$payload = [string]::Join("", $payloadLines)
|
||||
|
||||
@@ -163,10 +163,12 @@ def test_sender_builds_sha256_envelope_and_streams_it_without_remote_cli_data()
|
||||
assert "remote_bootstrap_input_limit_exceeded" in source
|
||||
assert "remote_bootstrap_sentinel_missing" in source
|
||||
assert "line_width = 65536" in source
|
||||
assert "len(payload_lines) > 8" in source
|
||||
assert "max_payload_lines = 16" in source
|
||||
assert "len(payload_lines) > max_payload_lines" in source
|
||||
assert '"\\n".join(payload_lines)' in source
|
||||
assert "remote_bootstrap_payload_line_contract_failed" in source
|
||||
assert "$payloadLines.Count -gt 8" in source
|
||||
assert "$maxPayloadLines = 16" in source
|
||||
assert "$payloadLines.Count -gt $maxPayloadLines" in source
|
||||
assert "$charCount -gt 1048576" in source
|
||||
assert '<"${BOOTSTRAP_PAYLOAD_PATH}"' not in source
|
||||
assert "rawEnvelope" not in source
|
||||
|
||||
Reference in New Issue
Block a user