Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
04263db
feat(db): add migration v24 for status claims, PR head, and push events
beardthelion Aug 7, 2026
af17831
feat(pulls): track the source branch head on open pull requests
beardthelion Aug 7, 2026
ac31868
feat(api): add the owner-gated commit status write path
beardthelion Aug 7, 2026
6663fed
feat(api): serve the combined commit status behind the visibility gate
beardthelion Aug 7, 2026
7be9f08
feat(api): add the pull request head rollup
beardthelion Aug 7, 2026
db3681e
feat(api): add the catch-up poll surface for missed push webhooks
beardthelion Aug 7, 2026
90b8294
fix(api): resolve the rollup head from push events, not pinned CIDs
beardthelion Aug 7, 2026
ad71f79
fix(status): make a stored claim actually re-verifiable
beardthelion Aug 8, 2026
806f902
fix(status): make the caps hold and the projection mean one identity
beardthelion Aug 8, 2026
612d9d2
fix(api): order the poll cursor on a sequence and batch the push writes
beardthelion Aug 8, 2026
d3074a6
fix(status): make a replayed write idempotent and stop dropping refs
beardthelion Aug 8, 2026
5445dda
fix(db): stop the push cursor skipping a concurrently committed row
beardthelion Aug 8, 2026
61033af
fix(auth): carry the request body only where a route persists it
beardthelion Aug 8, 2026
a4e2b9f
fix(status): bind a stored claim to the body its signature covered
kevincodex1 Aug 31, 2026
8652b86
fix(api): apply a push's side effects only to the refs git accepted
kevincodex1 Aug 31, 2026
6b0763a
fix(api): make the push-event cursor opaque and bound to its repository
kevincodex1 Aug 31, 2026
e9e5e3d
Merge remote-tracking branch 'origin/main' into feat/commit-status-su…
beardthelion Nov 12, 2026
41bbe70
refactor(node): simplify commit-status surface after main merge
beardthelion Nov 12, 2026
48e8897
fix(node): harden status surface writers and close-path head freeze
beardthelion Nov 12, 2026
600c358
fix(node): write status surfaces from proven landings in the effect e…
beardthelion Nov 12, 2026
862293c
fix(node): add head_commit to test-harness PR fixture
beardthelion Nov 12, 2026
9519078
test(node): drive the status and push-events routes in the deny sweep
beardthelion Nov 12, 2026
ddc4a2c
fix(node): refuse re-closing a closed PR, drop 429 Retry-After, pin t…
beardthelion Nov 12, 2026
e8952f5
fix(node): close_pr fallback head fills an empty head only (#304)
beardthelion Nov 13, 2026
20f725e
Merge remote-tracking branch 'origin/main' into feat/commit-status-su…
beardthelion Nov 13, 2026
705e652
Merge origin/main into feat/commit-status-surface
beardthelion Nov 13, 2026
7a2d70f
Merge remote-tracking branch 'origin/main' into feat/commit-status-su…
beardthelion Nov 13, 2026
e52c585
fix(node): purge status_claims and repo_push_events in delete_repo_by_id
beardthelion Nov 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,221 changes: 1,213 additions & 8 deletions crates/gitlawb-node/src/api/events.rs

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions crates/gitlawb-node/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub mod replicas;
pub mod repos;
pub mod resolve;
pub mod stars;
pub mod status;
pub mod task_cursor;
pub mod tasks;
pub mod visibility;
Expand Down Expand Up @@ -68,6 +69,12 @@ pub(crate) async fn authorize_repo_read(
/// representation only within `did:key`; never let a bare id match across methods —
/// `did:web` / `did:gitlawb` share the base58 space with `did:key`, so a
/// trailing-segment compare would treat `did:key:X` and `did:gitlawb:X` as equal.
///
/// The collapse itself lives in exactly one place, [`crate::db::normalize_owner_key`],
/// which is also the function the stored `owner_did` / `authorizing_did` columns
/// are normalized through and which `OWNER_KEY_CASE_SQL` mirrors byte for byte.
/// Two identities match when they normalize to the same key; a second copy of the
/// rule here is how the Rust gate and the SQL filters would drift apart.
pub(crate) fn did_matches(a: &str, b: &str) -> bool {
// One implementation, shared with `gl` and `git-remote-gitlawb` through core:
// every boundary that compares a DID applies the same collapse rule.
Expand Down Expand Up @@ -205,6 +212,7 @@ mod authz_guard {
let events = include_str!("events.rs");
let tasks = include_str!("tasks.rs");
let stars = include_str!("stars.rs");
let status = include_str!("status/mod.rs");
let protect = include_str!("protect.rs");
let visibility = include_str!("visibility.rs");
let profiles = include_str!("profiles.rs");
Expand All @@ -230,6 +238,13 @@ mod authz_guard {
// (existence hiding) and require_repo_owner guards the owner half.
(webhooks, "list_webhooks", "authorize_repo_read("),
(webhooks, "list_webhooks", "require_repo_owner("),
// Same two-half shape as list_webhooks: authorize_repo_read runs
// first (a quarantined or unreadable repo gets the missing-repo
// not-found, never a 403 that would confirm existence), then
// require_repo_owner 403s a non-owner of a readable repo. Both halves
// are pinned, because dropping either changes what a stranger learns.
(status, "create_status", "authorize_repo_read("),
(status, "create_status", "require_repo_owner("),
(labels, "add_label", "authorize_repo_read("),
(labels, "add_label", "require_repo_owner("),
(labels, "remove_label", "authorize_repo_read("),
Expand Down Expand Up @@ -261,6 +276,19 @@ mod authz_guard {
(protect, "list_protected_branches", "authorize_repo_read("),
(labels, "list_labels", "authorize_repo_read("),
(events, "list_repo_events", "authorize_repo_read("),
// The catch-up poll surface gates before any push-event row is read,
// so a stranger cannot use it to learn that a private repo exists or
// is being pushed to.
(events, "list_repo_push_events", "authorize_repo_read("),
// The status read gates before any claim data is loaded, so its deny
// is the repo's own not-found rather than an existence oracle over
// which commits were reported on.
(status, "commit_status", "authorize_repo_read("),
// The rollup gates on the same helper before the pull request row is
// loaded, so a caller who cannot read the repo cannot learn which
// pull request numbers exist on it — and the fallback's branch
// resolve and head persist sit behind that same gate.
(status, "pull_request_status", "authorize_repo_read("),
// Bucket C — signer-self: the acting DID is matched/bound to auth.0
(tasks, "create_task", "did_matches("),
// #496: create_task is signer-self AND owner-when-repo-scoped — a
Expand Down Expand Up @@ -1171,6 +1199,7 @@ mod tests { async fn t() { let _ = did_matches(x, y); } }
(include_str!("replicas.rs"), "replicas.rs"),
(include_str!("repos.rs"), "repos.rs"),
(include_str!("stars.rs"), "stars.rs"),
(include_str!("status/mod.rs"), "status/mod.rs"),
(include_str!("visibility.rs"), "visibility.rs"),
(include_str!("webhooks.rs"), "webhooks.rs"),
];
Expand Down
Loading
Loading