Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ GITLAWB_ENFORCE_OWNER_PUSH=true
GITLAWB_P2P_BOOTSTRAP=

# ── Access control ────────────────────────────────────────────────────────
# Reserved for private-read mode. Public/private repo read enforcement is not
# wired in the current live release; do not rely on this for private repositories.
# Reserved and currently inert. Repo reads are gated per repository by
# is_public and path-scoped visibility rules; this flag changes nothing.
GITLAWB_PUBLIC_READ=true

# Maximum git smart-HTTP pack request size, in bytes.
Expand Down
27 changes: 26 additions & 1 deletion crates/gitlawb-node/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ pub struct Config {
#[arg(long, env = "GITLAWB_KEY", default_value = "~/.gitlawb/identity.pem")]
pub key_path: String,

/// Reserved for private-read mode; per-repo read enforcement is not wired in alpha
/// Reserved and currently inert: read access is enforced per repository
/// through `is_public` and path-scoped visibility rules, not this flag.
/// Setting it to false changes nothing; make a repo private through its
/// own visibility instead.
#[arg(long, env = "GITLAWB_PUBLIC_READ", default_value_t = true)]
pub public_read: bool,

Expand Down Expand Up @@ -1424,6 +1427,28 @@ mod tests {
);
}

/// #338: GITLAWB_PUBLIC_READ is inert, so its help must not claim read
/// enforcement is missing; it must tell the operator the flag changes
/// nothing and where the real control lives.
#[test]
fn public_read_help_describes_the_flag_as_inert() {
use clap::CommandFactory;
let cmd = Config::command();
let arg = cmd
.get_arguments()
.find(|a| a.get_id() == "public_read")
.expect("the argument must exist");
let help = arg.get_help().map(|h| h.to_string()).unwrap_or_default();
assert!(
!help.contains("not wired"),
"the help still claims read enforcement is unwired: {help}"
);
assert!(
help.contains("inert"),
"the help must say the flag is inert so an operator does not rely on it: {help}"
);
Comment on lines +1442 to +1449

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Test Misses Key Guidance

The test says it must ensure operators are directed to the real per-repository control, but it only requires “inert” and forbids the exact phrase “not wired.” Removing every reference to is_public and path-scoped visibility—or describing missing enforcement with different words—would leave the test green. Assert the substantive guidance so this correction remains protected.

Suggested change
assert!(
!help.contains("not wired"),
"the help still claims read enforcement is unwired: {help}"
);
assert!(
help.contains("inert"),
"the help must say the flag is inert so an operator does not rely on it: {help}"
);
assert!(
!help.contains("not wired"),
"the help still claims read enforcement is unwired: {help}"
);
assert!(
help.contains("inert"),
"the help must say the flag is inert so an operator does not rely on it: {help}"
);
assert!(
help.contains("is_public") && help.contains("path-scoped visibility"),
"the help must direct operators to the per-repository controls: {help}"
);

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

}

/// The flip must not strand an operator mid-upgrade.
///
/// Turning the gate on is a breaking change for any deployment whose pushers are
Expand Down
2 changes: 1 addition & 1 deletion crates/gitlawb-node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async fn main() -> Result<()> {

if !config.public_read {
warn!(
"GITLAWB_PUBLIC_READ=false is reserved; per-repository private-read enforcement is not wired in alpha"
"GITLAWB_PUBLIC_READ=false has no effect; reads are gated per repository by is_public and path-scoped visibility rules, not this flag"
);
}

Expand Down
4 changes: 2 additions & 2 deletions docs/OSS-READINESS-AUDIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Live-network blockers to prioritize:
- GraphQL POST is still open for compatibility; GraphQL mutations should get mutation-aware auth before it becomes a public write API surface.
- Push authorization is still not capability-complete. A valid DID signature is authentication, not authorization. Owner checks are now enforced on every branch, protected or not (`GITLAWB_ENFORCE_OWNER_PUSH`, on by default); what remains is that a UCAN `git/push` capability is not yet honored, so a delegated or CI key cannot push.
- UCAN chain validation is incomplete and UCAN revocation/blocklisting is not implemented as an operator feature.
- Private repository reads are not enforced. `is_public` and `GITLAWB_PUBLIC_READ` exist, but per-repository private-read behavior is not wired.
- Private repository reads are enforced per repository through `is_public` and path-scoped visibility rules. `GITLAWB_PUBLIC_READ` remains reserved and inert.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Resolved Item Remains Blocker

This entry remains under “Live-network blockers to prioritize,” but the revised text now says private-read enforcement is implemented and the remaining flag is intentionally inert. Keeping this resolved, non-actionable statement in the blocker list makes the readiness audit ambiguous; remove it or move it to a section that records implemented controls.

Suggested change
- Private repository reads are enforced per repository through `is_public` and path-scoped visibility rules. `GITLAWB_PUBLIC_READ` remains reserved and inert.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

- Peer URLs are self-asserted by DIDs. Signatures prove control of the DID key when present, not ownership/safety of the announced URL.
- Outbound peer fetch/ping/sync paths should be reviewed for SSRF protections before accepting arbitrary public peer registrations.

Expand Down Expand Up @@ -146,7 +146,7 @@ Risks:
## Obvious live-network priorities

1. Implement repo write authorization: owner checks, UCAN capability checks, and clear delegation semantics for push/PR/issue/bounty operations.
2. Implement private-read enforcement or remove private repo affordances until it exists.
2. Private reads are already enforced per repository (`is_public` plus path-scoped rules); retire the reserved and inert `GITLAWB_PUBLIC_READ` flag or document it as permanently reserved.
3. Add UCAN revocation/blocklisting and operator docs for emergency key compromise.
4. Harden peer registration and outbound fetch behavior against SSRF and peer-list poisoning.
5. Add Docker/installer/release smoke tests to CI.
Expand Down
Loading