Skip to content

Commit 87c2812

Browse files
authored
Align list_repository_collaborators DIFC integrity to reader-level (#5843)
Compliance review found a mismatch between stated policy intent and implementation for `list_repository_collaborators`: the PR rationale specified reader integrity, but the guard assigned writer integrity. This change resolves that discrepancy in code and tests so the tool’s label semantics match the documented access-sensitive intent. - **Policy alignment** - Updated `list_repository_collaborators` in `tool_rules.rs` to assign `reader_integrity(repo_id, ctx)` instead of `writer_integrity(repo_id, ctx)`. - Kept secrecy handling as private policy scope for collaborator/permission metadata. - **Documentation-in-code clarification** - Updated the inline integrity comment from writer-level to reader-level to reflect the intended trust boundary for access-sensitive collaborator data. - **Unit expectation update** - Adjusted the dedicated test assertion to expect reader-level integrity and updated the assertion message accordingly. ```rust "list_repository_collaborators" => { // S = private policy scope // I = reader (access-sensitive metadata should not directly authorize writes) secrecy = policy_private_scope_label(&owner, &repo, repo_id, ctx); integrity = reader_integrity(repo_id, ctx); } ```
2 parents ed86bc3 + f0f232d commit 87c2812

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

guards/github-guard/rust-guard/src/labels/tool_rules.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,9 @@ pub fn apply_tool_labels(
388388
// Lists users with access to the repository; reveals who holds write/admin rights.
389389
// S = private policy scope — collaborator/permission information is access-controlled
390390
// even for public repositories.
391-
// I = writer (GitHub-controlled repository access metadata)
391+
// I = reader (access-sensitive metadata should not directly authorize writes)
392392
secrecy = policy_private_scope_label(&owner, &repo, repo_id, ctx);
393-
integrity = writer_integrity(repo_id, ctx);
393+
integrity = reader_integrity(repo_id, ctx);
394394
}
395395

396396
// === Content Access ===
@@ -939,11 +939,11 @@ mod tests {
939939
&ctx,
940940
);
941941
let _ = secrecy; // secrecy inherits from repo visibility (backend unavailable in tests)
942-
let expected_integrity = super::writer_integrity("octocat/hello-world", &ctx);
942+
let expected_integrity = super::reader_integrity("octocat/hello-world", &ctx);
943943
assert_eq!(
944944
integrity,
945945
expected_integrity,
946-
"list_repository_collaborators must produce writer-level integrity"
946+
"list_repository_collaborators must produce reader-level integrity"
947947
);
948948
}
949949
}

0 commit comments

Comments
 (0)