Repository navigation
Conversation
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
… file Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…e protocol Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
The Origin header is parsed as scheme://host[:port] with an http or https scheme, as BootUI 2.6.0 does: a path (a trailing slash included), query, fragment, userinfo, control character, trailing colon, unsupported scheme or a port above 65535 makes the origin unreadable, and an unreadable origin is cross-site. The value is no longer trimmed.\n\nA port of more than five digits is refused before int() converts it, in the origin and in the request's own Host, so a very long port is a cross-site refusal and no longer an unhandled ValueError. Adds a property test of the origin parser. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…UI 2.6.0) A write that carries Sec-Fetch-Site must send same-origin or none (ASCII, case-insensitive); same-site, cross-site, an empty value and any unknown value are refused. A present but empty Origin header is an unreadable origin and is cross-site, no longer read as absent. A same-site navigation GET still loads the shell, and an API path still requires the request's own scheme, host and port. A request whose own origin cannot be formed stays cross-site where that comparison applies.\n\nDocuments the rule in SECURITY.md and the BootUI contract note, and records the deviations in the 0.11.0 guard matrix fragment. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Record the two deviations of the inactivity log from BootUI 2.6.0 in a matrix fragment, update the MVP plan text that still described the old log line, extract the inactivity logging of install() into a helper to keep its complexity at the pinned count, and wrap one over-long test assertion. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
An invalid SHARPIT_ENABLED must log exactly one record, the fixed warning, as BootUI does. The count of the remaining configuration warnings stays. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
An invalid SHARPIT_ENABLED is already reported by the fixed inactive warning. Counting its settings warning as well produced a second WARNING record, where BootUI logs one. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…tests Port BootUiInactiveStartupDiagnosticTests.deliberateDisablementIsSilentAtInfo, cite the BootUI tests the other inactivity tests port, and keep the expected log texts in one test module. A single Inactivity alias types the inactivity category. The matrix row for the warning count records that it leaves out the invalid SHARPIT_ENABLED warning. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com> # Conflicts: # tests/fuzz/test_trust_boundary_fuzz.py
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…ootUI's URI rules Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…tector Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…I does Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com> # Conflicts: # docs/reference/matrix-updates/0.11.0-github.tsv
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Task 1.6 of the 0.11.0 plan (#367), row G4 of the BootUI 2.6.0 delta: an invalid GitHub response body is reported per
section, as BootUI's
GitHubApiClient.getdoes, instead of failing the whole refresh.src/sharpit/engine/collectors/github/client.py:_Response.successis2xx and message is None(BootUIApiResponse.success());new String(body, UTF_8)); a blank body, JSON that is not an objector array, trailing data,
NaN/Infinity, a number with more than 1000 digits or a property name longer than50,000 characters (Jackson 3 read limits; signs, decimal points and exponent markers are not counted), a decode
error or a recursion error gives
GitHub returned invalid JSON for <label>.;refreshing GitHub data.").
ERRORwith the scopes still read from the headers; another invalidsection adds a warning and the report is
PARTIAL; Copilot givesunavailableReason, and a 204 staysNO_DATA; arepository quota (cache, artifacts) is unavailable with the reason and adds no warning (BootUI
addRepositoryQuota).docs/reference/matrix-updates/0.11.0-github.tsv:op:github.refresh.invalid-json(matched) andop:github.refresh.json-depth(adapted: Jackson 3 rejects nesting deeper than 500; the standard Python parser has nodepth hook, and the 2 MiB body cap already bounds the work).
Behaviour change for users: a successful response with an empty body (other than Copilot's 204) used to count as an
empty result; it is now reported as invalid JSON for that section, as BootUI does.
Review scope
The branch was cut from the 0.11.0 integration line, so against
mainthe diff also shows the earlier 0.11.0 pullrequests (Wave 0, #368 to #377). The changes of this pull request are in
src/sharpit/engine/collectors/github/client.py,tests/engine/collectors/github/test_github_client.pyanddocs/reference/matrix-updates/0.11.0-github.tsv.Red evidence
test_malformed_optional_response_preserves_independent_sections[...],test_malformed_rate_limit_response_returns_safe_error[...],test_malformed_copilot_response_is_unavailable_without_discarding_other_sections[...]Network request failed...instead of the invalid-JSON text (40 cases, run against the earlierclient.py)test_github_non_json_number_constants_report_error(rewritten)json.loads, which guesses UTF-16/32, strips a BOM and rejects invalid UTF-8test_github_number_digit_limit_matches_jackson[negative-1000-digits, fraction-1000-digits, exponent-999-digits], correctedtest_github_number_literal_length_matches_jackson[float-1001]test_github_property_name_length_matches_jackson[rejected]failedRateLimitResponseKeepsHttpStatusandcopilotNoContentRemainsNoDataare ported as guards; they pass before andafter the change. The 5000-digit number case moved from the coercion test to the invalid-JSON tests: measured with
Jackson 3.1.7 and 3.1.8,
readTreeaccepts 1000 digits and rejects 1001 and 5000.Verification
uv run ruff check,uv run ruff format --check,uv run pyright(0 errors);uv run pytest -q -n 4 tests/engine/collectors/github tests/fastapi -k github(303 passed). The full suite runs in CI.