Repository navigation
Security: Sync S3 access control with repository visibility - #91
Conversation
- Add S3 bucket policy management (getBucketPolicy, addPublicReadPolicy, hasPublicRead) - Update GitHub visibility service with updateRepositoryVisibility function - Enhance admin visibility endpoint to sync S3 public access when making datasets public - Add dataset publish endpoint (POST /datasets/:id/publish) for owner/admin one-way publishing - Add CLI command 'nemar admin make-public' with strong confirmation UX - Support both admin toggle (repo public/private) and permanent publish workflows
PR Review Results (Automated)Ran comprehensive review with 3 specialized agents: code-reviewer, silent-failure-hunter, comment-analyzer.
|
- Remove duplicate updateRepositoryVisibility function - Use existing setRepoVisibility with better error handling - Add removePublicReadPolicy for S3 revert capability - Add rollback logic to publish endpoint - Update admin endpoint to remove S3 policy when private - Fix repo name extraction using split index - Remove unused hasPublicRead import Addresses all 3 critical issues identified in PR review.
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR91Version: 🤖 Updated on each push. |
Admin visibility endpoint now reverts both GitHub and S3 when database update fails, matching the publish endpoint pattern. Prevents state where S3 remains public after failed operation. Addresses issue found in follow-up PR review.
PR Review Follow-upRe-ran comprehensive review after addressing the 3 critical issues from the initial review. ✅ Initial Critical Issues - ALL FIXED
🔧 Additional Fix AppliedAdmin endpoint DB rollback incomplete - Found during re-review that admin endpoint only reverted GitHub on DB failure, not S3. Now mirrors the publish endpoint pattern: reverts both GitHub and S3 to maintain consistency. 📊 Review SummaryCode Quality Review:
Error Handling Review:
Documentation Review:
🎯 Commits
Ready for final review. |
- Remove unused variables (exitCode, stderr) - Fix constant condition warning (use while loop) - Auto-fix formatting issues - Migrate biome config to v2.3.11
- Install @biomejs/[email protected] to match CI version - Revert biome.json to original v1.9.4 schema - Fix import sorting issues in affected files
Fixes #88
Summary
Implements visibility management for datasets to sync S3 object access with GitHub repository visibility:
Changes
Backend Services
backend/src/services/s3.ts: Add getBucketPolicy(), addPublicReadPolicy(), hasPublicRead()backend/src/services/github.ts: Add updateRepositoryVisibility()Backend Routes
backend/src/routes/admin.ts: Enhanced visibility endpoint to sync S3 public accessbackend/src/routes/datasets.ts: Add /datasets/:id/publish endpoint (owner or admin)CLI
src/lib/api.ts: Add publishDataset() client functionsrc/commands/admin.ts: Add 'nemar admin make-public' commandTwo Complementary Workflows
nemar admin repo public/private- Can toggle visibility bidirectionallynemar admin make-public- One-way permanent publish with strong confirmationTesting
Build successful. Manual testing required for:
Security