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>
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>
…sitory (BootUI 2.6.0) Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…r section Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…rity Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
# Conflicts: # docs/reference/matrix-updates/0.11.0-github.tsv # src/sharpit/engine/collectors/github/client.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>
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.8 of the 0.11.0 plan (#367), rows S8, S10, C1, C2 and G1 of the BootUI 2.6.0 delta: the GitHub panel selects
the
originorupstreamremote, binds a refresh to the repository the page was given permission for, and reportsthe repository context, as BootUI's
GitHubDashboardService,GitHubControllerandGitHubResourcedo.src/sharpit/engine/collectors/github/selection.py(new):parse_remote_selection(GET) andparse_refresh_selection(POST refresh), framework-free ports of BootUI's parsers over the raw query items: a casealias of
remote(Remote=), a repeated or blankremote, or a value other thanorigin/upstreamis refused;the refresh also refuses unknown keys (after the remote is parsed) and requires
expectedHostandexpectedRepositorytogether, each single, non-blank and matching BootUI's patterns in full. Errors carry only thethree fixed messages.
src/sharpit/engine/collectors/github/dashboard.py: the refresh follows BootUI's order (parse, detect once,unavailable remote, identity mismatch, API disabled, no client, client). A mismatch returns the
ERRORreportThe configured GitHub repository changed after page permission was granted., built as BootUI builds it, with notoken read, no network call and no cache change. Reports are cached in two slots, origin and upstream, used only
when the slot's
fullNameandapiBaseUrlmatch the detected repository.repositoryContext(selectedRemote,origin,upstream,upstreamUnavailableReason) is recomputed on every return and emitted last; a cached reportis never modified by a caller.
src/sharpit/engine/collectors/github/detector.py:Remotescarries the origin unavailable reason from the sameconfiguration read.
src/sharpit/fastapi/routes/github.py:GET /githubandPOST /github/refreshread the query items and answer arefused query with 400
{"error": <fixed message>}; the guard chain runs before parsing.origin; their output gainsrepositoryContext.docs/reference/BOOTUI-CONTRACT-MVP.md,tests/parity/routes_status.json,docs/reference/matrix-updates/0.11.0-github.tsv(deviation rows: the 400 body shape on both routes; parametersare read from the query string only).
Behaviour change for users: a report cached for one repository is no longer served after the remote points at a
repository with the same name on another host.
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 #380). This pull request's changes are in the files listed above and their tests
(
tests/engine/collectors/github/test_github_selection.py,test_github_refresh.py,test_github.py,tests/fastapi/test_github_api.py,tests/fastapi/test_github_refresh_api.py,tests/parity/).Red evidence
Tests were committed first with the selection module and the new service signatures as stubs; each red is an
assertion (
scripts/dev/red_check.py).test_upstream_is_an_explicit_host_bound_selection_with_independent_caches,test_github_routes_pass_the_selected_remote_to_servicetest_refresh_rejects_a_changed_repository_identity_before_calling_the_client,test_identity_mismatch_precedes_api_disabled_and_missing_client[...]test_enterprise_and_github_com_with_same_full_name_do_not_collide_in_cache,test_changing_only_the_remote_host_invalidates_the_selected_cachetest_repository_context_is_the_last_key_on_every_path,test_github_golden_shape_23test_github_selection.py,test_refresh_400_precedence_and_canary_never_echoedtest_raw_query_rejection_precedes_io_and_cache_changes1 == 0with the route calling the client before parsingtest_detect_remotes_reports_required_origin_reasonsThe BootUI tests ported (
# ported:) come fromGitHubDashboardServiceTests,GitHubControllerTestsandGitHubResourceTest.Verification
uv run ruff check,uv run ruff format --check,uv run pyright(0 errors); targeted run over the GitHubcollector, FastAPI, parity, safety, CLI, masking, fuzz, root rule and docs tests; the overhead budget tests run alone.
The full suite runs in CI.