Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
4506480
fix(node): gate GET /ipfs/{cid} on reachable allowed-set, not deny-se…
Gravirei Jun 30, 2026
3aa7bf0
perf(ipfs): check object existence before allowed-blob walk
Gravirei Jun 30, 2026
63580c7
refactor(ipfs): improve formatting and readability in get_by_cid func…
Gravirei Jun 30, 2026
002f354
refactor(ipfs): streamline object retrieval by separating type and co…
Gravirei Jun 30, 2026
f2c91a8
docs(ipfs): update get_by_cid comment to reflect split object retrieval
Gravirei Jul 1, 2026
0b7c494
Merge remote-tracking branch 'upstream/main'
Gravirei Jul 1, 2026
03ba714
Run cargo fmt on store.rs
Gravirei Jul 1, 2026
03c90f8
Merge remote-tracking branch 'upstream/main'
Gravirei Jul 2, 2026
94bb216
Merge remote-tracking branch 'upstream/main'
Gravirei Jul 3, 2026
79650df
Merge remote-tracking branch 'upstream/main'
Gravirei Jul 5, 2026
26d8d48
Merge remote-tracking branch 'upstream/main'
Gravirei Jul 6, 2026
3ec0acc
fix(visibility): gate repo-scoped read surfaces on visibility (#120)
Gravirei Jul 6, 2026
f3b08c1
fix(visibility): enhance repo read authorization checks and improve t…
Gravirei Jul 6, 2026
459e21e
Fix review feedback: clamp limit, memoize authz, identical 404 body, …
Gravirei Jul 7, 2026
6fd29c9
cargo update -p crossbeam-epoch: fix RUSTSEC-2026-0204 (invalid point…
Gravirei Jul 7, 2026
119bfb1
Fix review findings: correct authz memoization, page past hidden boun…
Gravirei Jul 7, 2026
0be5e42
Fix findings: sign CLI/MCP reads, keyset pagination, gate claim_bounty
Gravirei Jul 7, 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
Prev Previous commit
Next Next commit
fix(visibility): enhance repo read authorization checks and improve t…
…est coverage
  • Loading branch information
Gravirei committed Jul 6, 2026
commit f3b08c18f3fd49ff7e24e26e34512ec472d7d851
20 changes: 19 additions & 1 deletion crates/gitlawb-node/src/api/bounties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,25 +137,43 @@ pub async fn list_repo_bounties(
pub async fn list_all_bounties(
State(state): State<AppState>,
Query(q): Query<ListBountiesQuery>,
auth: Option<Extension<AuthenticatedDid>>,
) -> Result<Json<serde_json::Value>> {
let bounties = state
.db
.list_bounties(None, None, q.status.as_deref(), q.limit.unwrap_or(50))
.await?;

Ok(Json(serde_json::json!({ "bounties": bounties })))
let caller = auth.as_ref().map(|e| e.0 .0.as_str());
let mut allowed = Vec::new();
for b in bounties {
if crate::api::authorize_repo_read(&state, &b.repo_owner, &b.repo_name, caller, "/")
.await
.is_ok()
{
allowed.push(b);
}
}

Ok(Json(serde_json::json!({ "bounties": allowed })))
}

/// GET /api/v1/bounties/{id}
pub async fn get_bounty(
State(state): State<AppState>,
Path(id): Path<String>,
auth: Option<Extension<AuthenticatedDid>>,
) -> Result<Json<BountyRecord>> {
let bounty = state
.db
.get_bounty(&id)
.await?
.ok_or_else(|| AppError::NotFound(format!("bounty {id} not found")))?;

let caller = auth.as_ref().map(|e| e.0 .0.as_str());
crate::api::authorize_repo_read(&state, &bounty.repo_owner, &bounty.repo_name, caller, "/")
.await?;

Ok(Json(bounty))
}

Expand Down
3 changes: 2 additions & 1 deletion crates/gitlawb-node/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ pub fn build_router(state: AppState) -> Router {
.route(
"/api/v1/agents/{did}/bounties",
get(bounties::agent_bounty_stats),
);
)
.layer(middleware::from_fn(auth::optional_signature));

// ── Profile routes (write — require HTTP Signature) ─────────────────
let profile_write_routes = add_auth_layers(
Expand Down
Loading
Loading