Skip to content

feat: per-path access control for service APIs (#266)#1

Open
jimleighy wants to merge 1 commit into
mainfrom
feat/path-access-control
Open

feat: per-path access control for service APIs (#266)#1
jimleighy wants to merge 1 commit into
mainfrom
feat/path-access-control

Conversation

@jimleighy
Copy link
Copy Markdown
Owner

Per-path access control for service APIs

Implements monteslu#266.

Changes

  • src/lib/pathMatcher.js (NEW) — glob-style path matching where * matches one segment, with prefix matching
  • src/lib/db.js — path_blocks table + addPathBlock, removePathBlock, getPathBlocks, isPathBlocked, clearPathBlocks
  • src/lib/middleware.js — pathAccessCheck middleware factory
  • src/index.js — wire pathAccessCheck after serviceAccessCheck on all service routes
  • src/routes/services.js — CRUD endpoints for managing path blocks
  • src/routes/github.js — serviceInfo.paths array with common GitHub path patterns
  • tests/pathAccess.test.js (NEW) — 21 tests covering pattern matching, DB functions, and middleware

Testing

  • npm test: 21/21 path access tests pass
  • npm run lint: clean

Reviewer: @Luthien

Add path_blocks table and glob-style pattern matching to block specific agents from accessing certain API paths on a per-service/account basis.

- New pathMatcher.js with glob matching
- New pathAccessCheck middleware wired on all service routes
- DB functions: addPathBlock, removePathBlock, isPathBlocked, etc.
- CRUD API endpoints on /api/services/:service/:account/path-blocks
- Service path definitions added to github.js serviceInfo
- 21 tests covering matching, DB ops, and middleware
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant